From 48923c16e00892fac916a83c8fdccca63800615f Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 16 Apr 2015 14:41:58 -0400 Subject: load shape images from posts --- site/db.json | 2 +- site/public/assets/javascripts/_env.js | 20 ++++++++++++-------- site/templates/index.liquid | 17 ++++++++--------- themes/okadmin/public/js/app.js | 10 ++++++---- themes/okadmin/public/js/upload.js | 4 ++-- 5 files changed, 29 insertions(+), 24 deletions(-) diff --git a/site/db.json b/site/db.json index 12ccb38..f1721a6 100644 --- a/site/db.json +++ b/site/db.json @@ -29,7 +29,7 @@ ], "__index": "0", "shape": { - "uri": "", + "uri": "http://okfocus.s3.amazonaws.com/2h/13.gif", "caption": "" } } diff --git a/site/public/assets/javascripts/_env.js b/site/public/assets/javascripts/_env.js index c4e9ace..b567a3d 100644 --- a/site/public/assets/javascripts/_env.js +++ b/site/public/assets/javascripts/_env.js @@ -7,8 +7,11 @@ environment.init = function(){ $("#scene").addClass("fade") var loader = new Loader(environment.ready, new HustleLoader) var preloadImages = $("#preload-image-list").html().split("\n").filter(function(s){ return !!s }) - boxImages = $("#box-image-list").html().split("\n").filter(function(s){ return !!s }) - loader.preloadImages( preloadImages.concat(boxImages) ) + boxImages = $("#box-image-list").html().split("\n") + var postImages = $(".sub a").toArray().map(function(el){ return $(el).data("image") }) + + var images = preloadImages.concat(postImages).concat(boxImages).filter(function(s){ return !!s }) + loader.preloadImages( images ) loader.ready() } environment.ready = function(){ @@ -191,7 +194,7 @@ function build_scene () { controls.zoom(1000) strips.push( new Strip({ - images: boxImages.slice(0, 5), + images: $(".sub[data-type=advertising] a"), x: -100, y: 100, rotationY: PI/4, @@ -199,7 +202,7 @@ function build_scene () { }) ) strips.push( new Strip({ - images: boxImages.slice(5, 10), + images: $(".sub[data-type=retail] a"), x: 100, y: 100, rotationX: PI/4, @@ -208,7 +211,7 @@ function build_scene () { }) ) strips.push( new Strip({ - images: boxImages.slice(10, 15), + images: $(".sub[data-type=experiential] a"), x: 0, y: 100, z: 100, @@ -217,7 +220,7 @@ function build_scene () { }) ) strips.push( new Strip({ - images: boxImages.slice(15, 20), + images: $(".sub[data-type=content] a"), x: 0, y: 100, z: -50, @@ -455,9 +458,10 @@ var Strip = function( opt ){ root.addTo(scene) var prev = root - this.els = opt.images.map(function(url, i){ + this.els = opt.images.toArray().map(function(el, i){ + var data = $(el).data() var el = new MX.Image({ - src: url, + src: data.image, onload: function(img){ } }) diff --git a/site/templates/index.liquid b/site/templates/index.liquid index 224803a..db6bf20 100644 --- a/site/templates/index.liquid +++ b/site/templates/index.liquid @@ -86,27 +86,27 @@ WEBSITE BY OKFOCUS, http://okfoc.us, Internet Legends.
retail
-
+
{% for project in retails %} - {{ project.menu }} + {{ project.menu }} {% endfor %}
advertising
-
+
{% for project in advertisings %} - {{ project.menu }} + {{ project.menu }} {% endfor %}
experiential
-
+
{% for project in experientials %} - {{ project.menu }} + {{ project.menu }} {% endfor %}
content
-
+
{% for project in contents %} - {{ project.menu }} + {{ project.menu }} {% endfor %}
@@ -238,7 +238,6 @@ WEBSITE BY OKFOCUS, http://okfoc.us, Internet Legends.