diff options
Diffstat (limited to 'studio-susie/public/assets/js/lib/view')
| -rw-r--r-- | studio-susie/public/assets/js/lib/view/HomeView.js | 27 | ||||
| -rw-r--r-- | studio-susie/public/assets/js/lib/view/ListView.js | 37 | ||||
| -rw-r--r-- | studio-susie/public/assets/js/lib/view/PageView.js | 41 | ||||
| -rw-r--r-- | studio-susie/public/assets/js/lib/view/PaintingView.js | 32 |
4 files changed, 137 insertions, 0 deletions
diff --git a/studio-susie/public/assets/js/lib/view/HomeView.js b/studio-susie/public/assets/js/lib/view/HomeView.js new file mode 100644 index 0000000..3eac71e --- /dev/null +++ b/studio-susie/public/assets/js/lib/view/HomeView.js @@ -0,0 +1,27 @@ +var HomeView = View.extend({ + + el: "#home", + + // template: liquid($('#tmpl-home').html()), + + events: { + }, + + initialize: function(options){ + options = options || {} + var data = this.data = options.data + }, + + render: function(){ + if (this.rendered) return + this.rendered = true + }, + + show: function(){ + this.render(this.data) + }, + + hide: function(){ + }, + +}) diff --git a/studio-susie/public/assets/js/lib/view/ListView.js b/studio-susie/public/assets/js/lib/view/ListView.js new file mode 100644 index 0000000..5161a31 --- /dev/null +++ b/studio-susie/public/assets/js/lib/view/ListView.js @@ -0,0 +1,37 @@ +var ListView = View.extend({ + + el: "#list", + + events: { + "click div": "load", + }, + + initialize: function(options){ + options = options || {} + var data = this.data = options.data + }, + + render: function(){ + if (this.rendered) return + this.rendered = true + }, + + show: function(){ + this.render(this.data) + document.body.className = "listopen" + }, + + hide: function(){ + document.body.className = "" + $(".visible").removeClass("visible") + $("#nav a.active").removeClass('active') + }, + + load: function(e){ + var index = $(e.currentTarget).data("index") + $.fn.fullpage.moveTo(index+1) + console.log(index) + this.hide() + }, + +}) diff --git a/studio-susie/public/assets/js/lib/view/PageView.js b/studio-susie/public/assets/js/lib/view/PageView.js new file mode 100644 index 0000000..d69328e --- /dev/null +++ b/studio-susie/public/assets/js/lib/view/PageView.js @@ -0,0 +1,41 @@ +var PageView = View.extend({ + + el: "body", + + events: { + "click #close": "close", + }, + + initialize: function(options){ + options = options || {} + var data = this.data = options.data + }, + + render: function(){ + if (this.rendered) return + this.rendered = true + }, + + show: function(){ + this.render(this.data) + document.body.className = "pageopen" + MAKE_CONFETTI() + }, + + hide: function(){ + document.body.className = "" + $(".visible").removeClass("visible") + $("#nav a.active").removeClass('active') + }, + + close: function(){ + app.router.go("/") + }, + + load: function(id){ + $("#nav a[href='/page/" + id + "']").addClass('active') + this.$("#" + id).addClass("visible") + }, + + +}) diff --git a/studio-susie/public/assets/js/lib/view/PaintingView.js b/studio-susie/public/assets/js/lib/view/PaintingView.js new file mode 100644 index 0000000..1fdc179 --- /dev/null +++ b/studio-susie/public/assets/js/lib/view/PaintingView.js @@ -0,0 +1,32 @@ +var PaintingView = View.extend({ + + el: "body", + + // template: liquid($('#tmpl-about').html()), + + events: { + }, + + initialize: function(options){ + options = options || {} + var data = this.data = options.data + }, + + render: function(){ + if (this.rendered) return + this.rendered = true + }, + + show: function(){ + this.render(this.data) + document.body.className = "painting" + }, + + hide: function(){ + // document.body.className = "about" + }, + + load: function(id){ + }, + +}) |
