From 96d3b84593362eecc2e8f1d5b4f13b7779efcbcd Mon Sep 17 00:00:00 2001 From: Sean Fridman Date: Thu, 9 Apr 2015 12:46:44 -0400 Subject: Update app manifest to use one schema --- site/templates/index.liquid | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'site/templates/index.liquid') diff --git a/site/templates/index.liquid b/site/templates/index.liquid index 8797f25..41de3e2 100644 --- a/site/templates/index.liquid +++ b/site/templates/index.liquid @@ -87,26 +87,34 @@ WEBSITE BY OKFOCUS, http://okfoc.us, Internet Legends.
RETAIL
- {% for project in retail %} - {{ project.shortname }} + {% for project in projects %} + {% if project.category == 'retail' %} + {{ project.shortname }} + {% endif %} {% endfor %}
advertising
- {% for project in advertising %} - {{ project.shortname || project.title }} + {% for project in projects %} + {% if project.category == 'advertising' %} + {{ project.shortname || project.title }} + {% endif %}} {% endfor %}
experiential
- {% for project in experiential %} - {{ project.shortname || project.title }} + {% for project in projects %} + {% if project.category == 'experiential' %} + {{ project.shortname || project.title }} + {% endif %}} {% endfor %}
content
- {% for project in content %} - {{ project.shortname || project.title }} + {% for project in projects %} + {% if project.category == 'content' %} + {{ project.shortname || project.title }} + {% endif %}} {% endfor %}
-- cgit v1.2.3-70-g09d2 From 89b9693aaa02ee80be0e4efdf9cad8b1d0fe7978 Mon Sep 17 00:00:00 2001 From: Sean Fridman Date: Thu, 9 Apr 2015 12:54:29 -0400 Subject: Remove stray curlies --- site/templates/index.liquid | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'site/templates/index.liquid') diff --git a/site/templates/index.liquid b/site/templates/index.liquid index 41de3e2..3d31f91 100644 --- a/site/templates/index.liquid +++ b/site/templates/index.liquid @@ -98,7 +98,7 @@ WEBSITE BY OKFOCUS, http://okfoc.us, Internet Legends. {% for project in projects %} {% if project.category == 'advertising' %} {{ project.shortname || project.title }} - {% endif %}} + {% endif %} {% endfor %}
experiential
@@ -106,7 +106,7 @@ WEBSITE BY OKFOCUS, http://okfoc.us, Internet Legends. {% for project in projects %} {% if project.category == 'experiential' %} {{ project.shortname || project.title }} - {% endif %}} + {% endif %} {% endfor %}
content
@@ -114,7 +114,7 @@ WEBSITE BY OKFOCUS, http://okfoc.us, Internet Legends. {% for project in projects %} {% if project.category == 'content' %} {{ project.shortname || project.title }} - {% endif %}} + {% endif %} {% endfor %} -- cgit v1.2.3-70-g09d2 From d414f4c0aeb535df89e52139f10ec85cac1312e6 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 9 Apr 2015 17:00:26 -0400 Subject: preloading images from projects/pages --- site/index.js | 1 + site/public/assets/javascripts/_env.js | 3 ++- site/templates/index.liquid | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) (limited to 'site/templates/index.liquid') diff --git a/site/index.js b/site/index.js index 6e5aed0..a59e74e 100644 --- a/site/index.js +++ b/site/index.js @@ -45,6 +45,7 @@ var app = okcms.createApp({ '/': { data: [ {type: 'project', query: '*'}, + {type: 'page', query: '*'} ] }, '/about': { diff --git a/site/public/assets/javascripts/_env.js b/site/public/assets/javascripts/_env.js index 3badf41..ca94ee2 100644 --- a/site/public/assets/javascripts/_env.js +++ b/site/public/assets/javascripts/_env.js @@ -16,9 +16,10 @@ environment.init = function(){ var loader = new Loader(function(){ environment.ready() }) + var preloadImages = $("#preload-image-list").html().split("\n").filter(function(s){ return !!s }) loader.preloadImages(box_images.map(function(url){ return base_href + url - })) + }).concat(preloadImages)) loader.ready() } environment.ready = function(){ diff --git a/site/templates/index.liquid b/site/templates/index.liquid index 3d31f91..e459d7b 100644 --- a/site/templates/index.liquid +++ b/site/templates/index.liquid @@ -132,6 +132,10 @@ WEBSITE BY OKFOCUS, http://okfoc.us, Internet Legends. +
-- cgit v1.2.3-70-g09d2 From 185751955605a7f302470094528117ff32077e3f Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 9 Apr 2015 17:05:12 -0400 Subject: fix --- site/templates/index.liquid | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'site/templates/index.liquid') diff --git a/site/templates/index.liquid b/site/templates/index.liquid index e459d7b..954670a 100644 --- a/site/templates/index.liquid +++ b/site/templates/index.liquid @@ -89,7 +89,7 @@ WEBSITE BY OKFOCUS, http://okfoc.us, Internet Legends.
@@ -97,7 +97,7 @@ WEBSITE BY OKFOCUS, http://okfoc.us, Internet Legends.
{% for project in projects %} {% if project.category == 'advertising' %} - {{ project.shortname || project.title }} + {{ project.shortname }} {% endif %} {% endfor %}
@@ -105,7 +105,7 @@ WEBSITE BY OKFOCUS, http://okfoc.us, Internet Legends.
{% for project in projects %} {% if project.category == 'experiential' %} - {{ project.shortname || project.title }} + {{ project.shortname }} {% endif %} {% endfor %}
@@ -113,7 +113,7 @@ WEBSITE BY OKFOCUS, http://okfoc.us, Internet Legends.
{% for project in projects %} {% if project.category == 'content' %} - {{ project.shortname || project.title }} + {{ project.shortname }} {% endif %} {% endfor %}
-- cgit v1.2.3-70-g09d2 From 34f1ca02bea38e0b7ef185ebf07d3ec6df30f370 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 13 Apr 2015 17:57:17 -0400 Subject: split up the projects by category, add a schema flag so we can use the same singular template --- app/index.js | 6 ++-- app/node_modules/okquery/index.js | 6 ++++ app/node_modules/okview/index.js | 2 +- site/db.json | 8 +++-- site/index.js | 67 +++++++++++++++++++++------------------ site/templates/index.liquid | 31 ++++++++---------- 6 files changed, 65 insertions(+), 55 deletions(-) (limited to 'site/templates/index.liquid') diff --git a/app/index.js b/app/index.js index 419adfc..7860f76 100644 --- a/app/index.js +++ b/app/index.js @@ -87,7 +87,6 @@ function OKCMS(options) { this._createResources(resourceConfig, db, schemas); var errorHandler = createErrorHandlerProducer( templateProvider, adminTemplateProvider, debug); - // Create view instances from config var views = this._views = this._createViews(viewConfig, db, meta, resourceCache, templateProvider, @@ -141,7 +140,7 @@ OKCMS.prototype._createResources = function(resourceConfig, db, schemaCache) { var type = config.type; var schema = schemaCache[type]; if (!schema) - throw new Error('Resource config references nonexistent schema'); + throw new Error('Resource config references nonexistent schema ' + type); var resource = OKResource({ type: type, db: db, @@ -244,7 +243,8 @@ OKCMS.prototype._createQueries = function(queryConfig, resourceCache) { var query = config.query || '*'; return new OKQuery({ resource: resource, - query: query + query: query, + as: config.as, }); }); }; diff --git a/app/node_modules/okquery/index.js b/app/node_modules/okquery/index.js index 9cc8b78..519bc08 100644 --- a/app/node_modules/okquery/index.js +++ b/app/node_modules/okquery/index.js @@ -33,6 +33,12 @@ function OKQuery(options) { enumerable: true }); + Object.defineProperty(this, 'as', { + value: options.as, + writable: false, + enumerable: true + }); + this.get = createQuery(resource, query, { default: options.default }); diff --git a/app/node_modules/okview/index.js b/app/node_modules/okview/index.js index 63f22b5..951261c 100644 --- a/app/node_modules/okview/index.js +++ b/app/node_modules/okview/index.js @@ -139,7 +139,7 @@ function fetchTemplateData(meta, queries, id) { return cache; } var resource = queries[i].resource; - var type = queries[i].type; + var type = queries[i].as || queries[i].type; var manyResult = isarray(result); // Inform template of ID in generic field if (manyResult) { diff --git a/site/db.json b/site/db.json index b6fbf24..22833f1 100644 --- a/site/db.json +++ b/site/db.json @@ -1,9 +1,8 @@ { "meta": [], - "project": [ + "retail": [ { "id": "diesel-ss15", - "category": "advertising", "title": "DIESEL JOGG JEANS SS15 DENIM CAMPAIGN", "shortname": "DIESEL SS15", "description": "Sed posuere consectetur est at lobortis. Donec id elit non mi porta gravida at eget metus. Cras mattis consectetur purus sit amet fermentum. Vestibulum id ligula porta felis euismod semper. Donec sed odio dui. \r\n\r\nVestibulum id ligula porta felis euismod semper. Vestibulum id ligula porta felis euismod semper. Vestibulum id ligula porta felis euismod semper. Aenean lacinia bibendum nulla sed consectetur. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. \r\n\r\nCurabitur blandit tempus porttitor. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec ullamcorper nulla non metus auctor fringilla. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur blandit tempus porttitor. Maecenas sed diam eget risus varius blandit sit amet non magna.", @@ -50,5 +49,8 @@ "image": "http://checkingintocollege.com/wp/wp-content/uploads/2014/08/angryphone.jpg", "__index": 0 } - ] + ], + "advertising": [], + "experiential": [], + "content": [] } \ No newline at end of file diff --git a/site/index.js b/site/index.js index dace900..8eec697 100644 --- a/site/index.js +++ b/site/index.js @@ -1,5 +1,14 @@ var okcms = require('..'); +var projectSchema = { + id: {type: 'string', id: true}, + title: {type: 'string'}, + shortname: {type: 'string'}, + description: {type: 'text'}, + video: {type: 'video'}, + images: {type: 'captioned-image-list'}, +} + var app = okcms.createApp({ root: 'public', @@ -11,26 +20,19 @@ var app = okcms.createApp({ body: {type: 'text'}, image: {type: 'string'} }, - project: { - id: {type: 'string', id: true}, - title: {type: 'string'}, - shortname: {type: 'string'}, - category: {type: 'enum', options: [ - 'retail', - 'advertising', - 'experiential', - 'content'] - }, - description: {type: 'text'}, - video: {type: 'video'}, - images: {type: 'captioned-image-list'}, - } + retail: projectSchema, + advertising: projectSchema, + experiential: projectSchema, + content: projectSchema, }, resources: [ { type: 'page', static: {id: 'about'}}, { type: 'page', static: {id: 'contact'}}, - { type: 'project' } + { type: 'retail' }, + { type: 'advertising' }, + { type: 'experiential' }, + { type: 'content' } ], services: { @@ -44,8 +46,11 @@ var app = okcms.createApp({ views: { '/': { data: [ - {type: 'project', query: '*'}, - {type: 'page', query: '*'} + {type: 'page', query: '*'}, + {type: 'retail', query: '*'}, + {type: 'advertising', query: '*'}, + {type: 'experiential', query: '*'}, + {type: 'content', query: '*'}, ] }, '/about': { @@ -55,17 +60,19 @@ var app = okcms.createApp({ data: {type: 'page', query: 'contact'} }, '/all': { - data: { - type: 'project', - query: '*' - }, + data: [ + {type: 'retail', query: '*'}, + {type: 'advertising', query: '*'}, + {type: 'experiential', query: '*'}, + {type: 'content', query: '*'}, + ], template: 'all' }, '/retail/:id': { data: { - type: 'project', + type: 'retail', + as: 'project', query: { - category: 'retail', id: ':id' } }, @@ -73,9 +80,8 @@ var app = okcms.createApp({ }, '/advertising/:id': { data: { - type: 'project', + type: 'advertising', query: { - category: 'advertising', id: ':id' } }, @@ -83,9 +89,9 @@ var app = okcms.createApp({ }, '/experiential/:id': { data: { - type: 'project', + type: 'experiential', + as: 'project', query: { - category: 'experiential', id: ':id' } }, @@ -93,12 +99,13 @@ var app = okcms.createApp({ }, '/content/:id': { data: { - type: 'project', + type: 'content', + as: 'project', query: { - category: 'content', id: ':id' } - } + }, + template: 'project' } } diff --git a/site/templates/index.liquid b/site/templates/index.liquid index 954670a..0bd6b7d 100644 --- a/site/templates/index.liquid +++ b/site/templates/index.liquid @@ -85,36 +85,28 @@ WEBSITE BY OKFOCUS, http://okfoc.us, Internet Legends. + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
diff --git a/themes/okadmin/public/js/app.js b/themes/okadmin/public/js/app.js index a5bd0fc..22317f3 100644 --- a/themes/okadmin/public/js/app.js +++ b/themes/okadmin/public/js/app.js @@ -60,8 +60,8 @@ var OKAdmin = function(){ var id = $section.data("id"), type = $section.data("type") if ($title.length && ! $title.val()) { - alert("Please enter a title") $title.focus() + alert("Please enter a title") e.preventDefault() return } -- cgit v1.2.3-70-g09d2 From 55bba9f4aab51fb05ebeb01987924e1f97226210 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 14 Apr 2015 15:37:19 -0400 Subject: store shape images in CMS --- site/db.json | 69 ++++++++++++++++++++++++++++++++++ site/index.js | 7 ++++ site/public/assets/javascripts/_env.js | 49 ++++++------------------ site/templates/index.liquid | 13 +++---- 4 files changed, 92 insertions(+), 46 deletions(-) (limited to 'site/templates/index.liquid') diff --git a/site/db.json b/site/db.json index 4c8321e..f8431f0 100644 --- a/site/db.json +++ b/site/db.json @@ -46,6 +46,75 @@ "__index": "0" } ], + "shape": [ + { + "id": "shape-images", + "title": "Shape Images", + "images": [ + { + "uri": "http://okfocus.s3.amazonaws.com/2h/1.gif", + "caption": "" + }, + { + "uri": "http://okfocus.s3.amazonaws.com/2h/2.gif", + "caption": "" + }, + { + "uri": "http://okfocus.s3.amazonaws.com/2h/3.gif", + "caption": "" + }, + { + "uri": "http://okfocus.s3.amazonaws.com/2h/4.gif", + "caption": "" + }, + { + "uri": "http://okfocus.s3.amazonaws.com/2h/5.gif", + "caption": "" + }, + { + "uri": "http://okfocus.s3.amazonaws.com/2h/6.gif", + "caption": "" + }, + { + "uri": "http://okfocus.s3.amazonaws.com/2h/7.gif", + "caption": "" + }, + { + "uri": "http://okfocus.s3.amazonaws.com/2h/8.gif", + "caption": "" + }, + { + "uri": "http://okfocus.s3.amazonaws.com/2h/9.gif", + "caption": "" + }, + { + "uri": "http://okfocus.s3.amazonaws.com/2h/12.gif", + "caption": "" + }, + { + "uri": "http://okfocus.s3.amazonaws.com/2h/13.gif", + "caption": "" + }, + { + "uri": "http://okfocus.s3.amazonaws.com/2h/14.gif", + "caption": "" + }, + { + "uri": "http://okfocus.s3.amazonaws.com/2h/15.gif", + "caption": "" + }, + { + "uri": "http://okfocus.s3.amazonaws.com/2h/16.gif", + "caption": "" + }, + { + "uri": "http://okfocus.s3.amazonaws.com/2h/17.gif", + "caption": "" + } + ], + "__index": "0" + } + ], "experiential": [], "content": [], "advertising": [] diff --git a/site/index.js b/site/index.js index b6dea48..7457bbf 100644 --- a/site/index.js +++ b/site/index.js @@ -24,11 +24,17 @@ var app = okcms.createApp({ advertising: projectSchema, experiential: projectSchema, content: projectSchema, + shape: { + id: {type: 'string', id: true, hidden: true}, + title: {type: 'string'}, + images: {type: 'captioned-image-list'}, + } }, resources: [ { type: 'page', static: {id: 'about'}}, { type: 'page', static: {id: 'contact'}}, + { type: 'shape', static: {id: 'shape-images'}}, { type: 'retail' }, { type: 'advertising' }, { type: 'experiential' }, @@ -47,6 +53,7 @@ var app = okcms.createApp({ '/': { data: [ {type: 'page', query: '*'}, + {type: 'shape', query: 'shape-images'}, {type: 'retail', query: '*'}, {type: 'advertising', query: '*'}, {type: 'experiential', query: '*'}, diff --git a/site/public/assets/javascripts/_env.js b/site/public/assets/javascripts/_env.js index 5fddaa7..ac155b3 100644 --- a/site/public/assets/javascripts/_env.js +++ b/site/public/assets/javascripts/_env.js @@ -1,13 +1,4 @@ -var base_href = "http://okfocus.s3.amazonaws.com/2h/" -var box_images = shuffle([ - "1.gif", "2.gif", "3.gif", "4.gif", "5.gif", -// "dies2.gif", "dies3.gif", - "6.gif", "7.gif", "8.gif", "9.gif", - "12.gif", "13.gif", "14.gif", "15.gif", - "16.gif", "17.gif", // "CCP-GIF.gif", "dies1.gif", -]) - -var strips = [] +var strips = [], boxImages = [] var done_loading = false, menu_open = false, entry_open = false @@ -16,9 +7,8 @@ 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 }) - loader.preloadImages(box_images.map(function(url){ - return base_href + url - }).concat(preloadImages)) + boxImages = $("#box-image-list").html().split("\n").filter(function(s){ return !!s }) + loader.preloadImages( preloadImages.concat(boxImages) ) loader.ready() } environment.ready = function(){ @@ -160,7 +150,9 @@ environment.ready = function(){ } else { build_scene() - $("#scene").removeClass("fade") + setTimeout(function(){ + $("#scene").removeClass("fade") + }, 50) } setTimeout(function(){ done_loading = true }, 200) @@ -194,7 +186,7 @@ function build_scene () { controls.zoom(1000) strips.push( new Strip({ - images: box_images.slice(0, 5), + images: boxImages.slice(0, 5), x: -100, y: 100, rotationY: PI/4, @@ -202,7 +194,7 @@ function build_scene () { }) ) strips.push( new Strip({ - images: box_images.slice(5, 10), + images: boxImages.slice(5, 10), x: 100, y: 100, rotationX: PI/4, @@ -211,7 +203,7 @@ function build_scene () { }) ) strips.push( new Strip({ - images: box_images.slice(10, 15), + images: boxImages.slice(10, 15), x: 0, y: 100, z: 100, @@ -220,7 +212,7 @@ function build_scene () { }) ) strips.push( new Strip({ - images: box_images.slice(15, 20), + images: boxImages.slice(15, 20), x: 0, y: 100, z: -50, @@ -438,24 +430,6 @@ environment.updateOnReady = function(t){ controls.update() } -var titles = [ - "BARNEY'S, GAGA CONSTELLATION", - "CCP GAMES, EVE ONLINE", - "DIESEL ACCESSORIES", - "DIESEL CAMPAIGN FW13/SS14", - "DIESEL CAMPAIGN FW14", - "#DIESELREBOOT", - "#DIESELTRIBUTE", - "DIESEL JOGG JEANS", - "DIESEL WATCHES", - 'MAC, "UNTITLED, SELF-PORTRAIT"', - "MUGLER, BROTHERS OF ARCADIA", - "MUGLER, LADY GAGA", - "MUGLER, MEN’S FW11", - "NICOLA’S, HO HO HO CHRISTMAS SHOP", - "NICOLA'S, LANE CRAWFORD", - "NICOLA’S, NEW YORK" -] var Strip = function( opt ){ this.opt = opt @@ -471,11 +445,10 @@ var Strip = function( opt ){ var prev = root this.els = opt.images.map(function(url, i){ var el = new MX.Image({ - src: base_href + url, + src: url, onload: function(img){ } }) - $(el.el).attr("data-title", choice(titles)) el.setCSSTransformOrigin( "50% 100%" ) el.addTo(prev) el.update() diff --git a/site/templates/index.liquid b/site/templates/index.liquid index e870a6d..b05590b 100644 --- a/site/templates/index.liquid +++ b/site/templates/index.liquid @@ -235,16 +235,13 @@ WEBSITE BY OKFOCUS, http://okfoc.us, Internet Legends.
+ - -
-
-- cgit v1.2.3-70-g09d2 From 0f625b3e6b511f4ee1323da30e6280f4880955fc Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 16 Apr 2015 12:38:31 -0400 Subject: get rid of contact image --- site/db.json | 2 +- site/public/assets/images/2H_LOGOMARK.svg | 12 ++++++------ site/public/assets/style.css | 4 ++++ site/templates/index.liquid | 6 +++--- site/templates/page.liquid | 14 ++++++++++---- 5 files changed, 24 insertions(+), 14 deletions(-) (limited to 'site/templates/index.liquid') diff --git a/site/db.json b/site/db.json index f8431f0..d0624e8 100644 --- a/site/db.json +++ b/site/db.json @@ -42,7 +42,7 @@ "id": "contact", "title": "CONTACT", "body": "TWOHUSTLERS\r\n50 WHITE STREET\r\nNEW YORK, NY 10013\r\nINFO@TWOHUSTLERS.COM\r\n+1 646 370-1180\r\nTWOHUSTLERS ©2014\r\nWEBSITE BY OKFOCUS", - "image": "http://checkingintocollege.com/wp/wp-content/uploads/2014/08/angryphone.jpg", + "image": "", "__index": "0" } ], diff --git a/site/public/assets/images/2H_LOGOMARK.svg b/site/public/assets/images/2H_LOGOMARK.svg index 9af234a..43a9691 100644 --- a/site/public/assets/images/2H_LOGOMARK.svg +++ b/site/public/assets/images/2H_LOGOMARK.svg @@ -7,11 +7,11 @@ - - + - - + - -
+ viewBox="338.1 276.3 660.5 819.7" xml:space="preserve"> - + @@ -176,7 +176,7 @@ WEBSITE BY OKFOCUS, http://okfoc.us, Internet Legends. c0,1-0.1,1.8-0.3,2.7c-0.1,0.8-0.1,1.7-0.3,2.5c0,0.3,0,0.6-0.1,0.8c-4,29.5-20.9,56.4-58.2,93.1l-81.8,80.1 c-53.5,52.1-85.9,103.9-101.6,162.9c-6.7,25.1-13.7,52.6-14.5,81L712.3,705.6z"/> - + diff --git a/site/templates/page.liquid b/site/templates/page.liquid index 52b64dc..7c295ff 100644 --- a/site/templates/page.liquid +++ b/site/templates/page.liquid @@ -1,9 +1,15 @@
{{page.title}} - -
- {{page.body | newline_to_br}} -
+ {% if page.image %} + +
+ {{page.body | newline_to_br}} +
+ {% else %} +
+ {{page.body | newline_to_br}} +
+ {% endif %}
-- cgit v1.2.3-70-g09d2 From b51455df828fde90edbee3143bd8d49b00cc3f1a Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 16 Apr 2015 14:04:10 -0400 Subject: single image upload field, abstract upload class a bit --- site/db.json | 6 +- site/index.js | 1 + site/public/assets/style.css | 3 +- site/templates/index.liquid | 2 + themes/okadmin/public/css/main.css | 25 +++++-- themes/okadmin/public/js/app.js | 93 +++++++++++++++++-------- themes/okadmin/public/js/upload.js | 91 +++++++++++------------- themes/okadmin/templates/partials/inputs.liquid | 52 +++++++++----- 8 files changed, 171 insertions(+), 102 deletions(-) (limited to 'site/templates/index.liquid') diff --git a/site/db.json b/site/db.json index d0624e8..12ccb38 100644 --- a/site/db.json +++ b/site/db.json @@ -27,7 +27,11 @@ "caption": "CURABITUR BLANDIT TEMPUS PORTTITOR 4" } ], - "__index": "0" + "__index": "0", + "shape": { + "uri": "", + "caption": "" + } } ], "page": [ diff --git a/site/index.js b/site/index.js index 521b7d7..30e4a76 100644 --- a/site/index.js +++ b/site/index.js @@ -7,6 +7,7 @@ var projectSchema = { description: {type: 'text'}, video: {type: 'video'}, images: {type: 'captioned-image-list'}, + shape: {type: 'image'}, } var app = okcms.createApp({ diff --git a/site/public/assets/style.css b/site/public/assets/style.css index 3c2526b..28d0013 100644 --- a/site/public/assets/style.css +++ b/site/public/assets/style.css @@ -285,6 +285,7 @@ nav .middle { } nav .bottom { + height: 20%; width: 100%; background: #bbb; } @@ -489,7 +490,7 @@ nav .sub.active a { } .entry span div.content.noline { border-top: 0; - padding-top: 0px; + padding-top: 0; } .entry span div.content div { width:50%; diff --git a/site/templates/index.liquid b/site/templates/index.liquid index afb5de3..d18098c 100644 --- a/site/templates/index.liquid +++ b/site/templates/index.liquid @@ -110,9 +110,11 @@ WEBSITE BY OKFOCUS, http://okfoc.us, Internet Legends. {% endfor %}
+
ABOUT
CONTACT
diff --git a/themes/okadmin/public/css/main.css b/themes/okadmin/public/css/main.css index ec426f9..685e368 100644 --- a/themes/okadmin/public/css/main.css +++ b/themes/okadmin/public/css/main.css @@ -228,7 +228,9 @@ button, input[type=submit] { border: 0; display: none; } -.main.resource form .group.loaded input:first-child, +.main.resource form .group.image input, +.main.resource form .group.video input:first-child, +.main.resource form .group.loaded.video input[type=text], .main.resource form .group input:first-child { display: block; width: 25em; @@ -238,17 +240,24 @@ button, input[type=submit] { } .main.resource form .group.loaded input { display: block; - width: 20.05em; } -.main.resource form .group input { - display: none; +.main.resource form .group input[type=text] { + width: 20.05em; margin-bottom: 0.1em; } +.main.resource form .group.image .image-element, +.main.resource form .group.video input[type=text], .main.resource form .group.loaded input[hidden], +.main.resource form .group.image.loaded .fields, .main.resource form input[hidden] { display: none; } - +.main.resource form .group.image.loaded .image-element { + display: block; +} +.main.resource form .fields { + height: 3em; +} .main.resource form textarea { padding: 0.5em; height: 15em; @@ -280,6 +289,8 @@ button, input[type=submit] { width: 10em; max-height: 10em; border: 0; +} +.main.resource form .images img { cursor: -webkit-grab; cursor: grab; } @@ -313,10 +324,10 @@ button, input[type=submit] { margin: 0; padding: 0; cursor: pointer; } -li.image-element:hover .remove-image { +.image-element:hover .remove-image { display: block; } -li.image-element .remove-image:hover { +.image-element .remove-image:hover { color: red; } .remove-image { diff --git a/themes/okadmin/public/js/app.js b/themes/okadmin/public/js/app.js index 22317f3..baa4873 100644 --- a/themes/okadmin/public/js/app.js +++ b/themes/okadmin/public/js/app.js @@ -1,38 +1,75 @@ var OKAdmin = function(){ - // initialize our (single) ajax image uploader with an element and a template - OKUpload.bind( document.getElementById("file") ) - OKUpload.add = function(data){ - var url = data[0].extra.Location - add_image(url) - } - - // also handle straight image urls - $("#add-image-url").keydown(pressEnter(function(e){ - var url = $(this).val() - $(this).val("") - add_image(url) - })) + // initialize our multi-image uploader with an element and a template + $(".image-list").each(function(){ + var uploader = new OKUpload () + uploader.bind( $(".add-image-button input", this) ) + uploader.add = function(data){ + var url = data[0].extra.Location + add_image(url) + } + // also handle straight image urls + $(".add-image-url", this).keydown(pressEnter(function(e){ + var url = $(this).val() + $(this).val("") + add_image(url) + })) + + // clone and populate template + function add_image(url){ + var imageTemplate = $("#captioned-image-template").html() + var $el = $(imageTemplate) + $el.find(".uri").val(url) + $el.find("img").attr("src", url) + $(".captioned-image-list ol").append($el) + } + }) + // delete image from gallery + $(document).on("mousedown", ".image-list .remove-image", function(){ + if (confirm("Delete this image?")) { + $(this).parent().remove() + } + }) - // clone and populate template - function add_image(url){ - var imageTemplate = $("#captioned-image-template").html() - var $el = $(imageTemplate) - $el.find(".uri").val(url) - $el.find("img").attr("src", url) - $(".captioned-image-list ol").append($el) - } + // initialize our single image uploader with existing DOM + $(".image").each(function(){ + var $el = $(this) + + var uploader = new OKUpload () + uploader.bind( $(".add-image-button input", this) ) + uploader.add = function(data){ + var url = data[0].extra.Location + add_image(url) + } + // also handle straight image urls + $(".add-image-url", this).keydown(pressEnter(function(e){ + var url = $(this).val() + $(this).val("") + add_image(url) + })) + + // clone and populate template + function add_image(url){ + $el.find(".uri").val(url) + $el.find(".caption").val("") + $el.find("img").attr("src", url) + $el.addClass("loaded") + } + }) + // delete image from single image entry + $(document).on("mousedown", ".image .remove-image", function(){ + if (confirm("Delete this image?")) { + var $el = $(this).closest(".image") + $el.removeClass('loaded') + $el.find(".uri").val("") + $el.find(".caption").val("") + $el.find("img").attr("src", "") + } + }) // make the region sortable with drag-and-drop $(".captioned-image-list ol").sortable() $(".captioned-image-list ol").disableSelection() - - // delete image - $(document).on("mousedown", ".remove-image", function(){ - if (confirm("Delete this image?")) { - $(this).parent().remove() - } - }) // populate a video field with info from our url parser var last_url diff --git a/themes/okadmin/public/js/upload.js b/themes/okadmin/public/js/upload.js index 1c9094c..39f7427 100644 --- a/themes/okadmin/public/js/upload.js +++ b/themes/okadmin/public/js/upload.js @@ -1,55 +1,48 @@ -var OKUpload = { - action: "/_services/image", - - bind: function(el){ - if (! el) return - el.addEventListener("change", OKUpload.handleFileSelect) - }, - - handleFileSelect: function(e) { - e.stopPropagation(); - e.preventDefault(); - - var files = e.dataTransfer ? e.dataTransfer.files : e.target.files; - - for (var i = 0, f; f = files[i]; i++) { - if ( ! f.type.match('image.*')) { - continue; - } - OKUpload.upload(f) - } - }, +var OKUpload = function(){ + this.action = "/_services/image" +} +OKUpload.prototype.bind = function(el){ + if (el.length) el = el[0] + el.addEventListener("change", this.handleFileSelect.bind(this)) +} +OKUpload.prototype.handleFileSelect = function(e) { + e.stopPropagation(); + e.preventDefault(); - upload: function(f){ - var fd = new FormData() - fd.append('image', f) + var files = e.dataTransfer ? e.dataTransfer.files : e.target.files; - var request = $.ajax({ - url: OKUpload.action, - type: "post", - data: fd, - dataType: "json", - processData: false, - contentType: false, - }) - request.done(OKUpload.success) - }, - - success: function(media){ - if (media.error) { - console.log(media.error) - return + for (var i = 0, f; f = files[i]; i++) { + if ( ! f.type.match('image.*')) { + continue; } - OKUpload.add(media) - }, - - add: function(media){ - console.log(media) - }, - - error: function(error){ - throw error - }, + this.upload(f) + } +} +OKUpload.prototype.upload = function(f){ + var fd = new FormData() + fd.append('image', f) + var request = $.ajax({ + url: this.action, + type: "post", + data: fd, + dataType: "json", + processData: false, + contentType: false, + }) + request.done(this.success.bind(this)) +} +OKUpload.prototype.success = function(media){ + if (media.error) { + console.log(media.error) + return + } + this.add(media) +} +OKUpload.prototype.add = function(media){ + console.log(media) +} +OKUpload.prototype.error = function(error){ + throw error } diff --git a/themes/okadmin/templates/partials/inputs.liquid b/themes/okadmin/templates/partials/inputs.liquid index 253b275..c9a4d92 100644 --- a/themes/okadmin/templates/partials/inputs.liquid +++ b/themes/okadmin/templates/partials/inputs.liquid @@ -22,15 +22,48 @@ {% elsif type == 'video' %}
- - + +
+ {% elsif type == 'image' %} +
+
+
+ + +
+ +
+
+ + + {{spec.value.caption}} + +
+
{% elsif type == 'captioned-image-list' %} -
+
+
+
+ + +
+ +
+ + +
    {% for image in spec.value %}
  1. @@ -41,19 +74,6 @@
  2. {% endfor %}
-
- - -
- -
{% elsif type == 'meta' %} -- cgit v1.2.3-70-g09d2 From 3f26845f934e95a5c3f9486f83f715240347bbcd Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 16 Apr 2015 14:22:14 -0400 Subject: dry --- site/templates/index.liquid | 8 ++++---- themes/okadmin/public/js/app.js | 41 ++++---------------------------------- themes/okadmin/public/js/upload.js | 30 +++++++++++++++++++++------- 3 files changed, 31 insertions(+), 48 deletions(-) (limited to 'site/templates/index.liquid') diff --git a/site/templates/index.liquid b/site/templates/index.liquid index d18098c..224803a 100644 --- a/site/templates/index.liquid +++ b/site/templates/index.liquid @@ -88,25 +88,25 @@ 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 %}
diff --git a/themes/okadmin/public/js/app.js b/themes/okadmin/public/js/app.js index baa4873..874b7e1 100644 --- a/themes/okadmin/public/js/app.js +++ b/themes/okadmin/public/js/app.js @@ -3,20 +3,8 @@ var OKAdmin = function(){ // initialize our multi-image uploader with an element and a template $(".image-list").each(function(){ var uploader = new OKUpload () - uploader.bind( $(".add-image-button input", this) ) - uploader.add = function(data){ - var url = data[0].extra.Location - add_image(url) - } - // also handle straight image urls - $(".add-image-url", this).keydown(pressEnter(function(e){ - var url = $(this).val() - $(this).val("") - add_image(url) - })) - - // clone and populate template - function add_image(url){ + uploader.bind( this ) + uploader.add = function(url){ var imageTemplate = $("#captioned-image-template").html() var $el = $(imageTemplate) $el.find(".uri").val(url) @@ -36,20 +24,8 @@ var OKAdmin = function(){ var $el = $(this) var uploader = new OKUpload () - uploader.bind( $(".add-image-button input", this) ) - uploader.add = function(data){ - var url = data[0].extra.Location - add_image(url) - } - // also handle straight image urls - $(".add-image-url", this).keydown(pressEnter(function(e){ - var url = $(this).val() - $(this).val("") - add_image(url) - })) - - // clone and populate template - function add_image(url){ + uploader.bind( this ) + uploader.add = function(url){ $el.find(".uri").val(url) $el.find(".caption").val("") $el.find("img").attr("src", url) @@ -173,15 +149,6 @@ var OKAdmin = function(){ $input.val(JSON.stringify(parsed)); }) }); - - function pressEnter(fn){ - return function(e){ - if (e.keyCode && e.keyCode !== 13) return - e.preventDefault() - console.log("hi") - fn.apply(this) - } - } } $(function(){ diff --git a/themes/okadmin/public/js/upload.js b/themes/okadmin/public/js/upload.js index 39f7427..040654b 100644 --- a/themes/okadmin/public/js/upload.js +++ b/themes/okadmin/public/js/upload.js @@ -2,9 +2,14 @@ var OKUpload = function(){ this.action = "/_services/image" } -OKUpload.prototype.bind = function(el){ - if (el.length) el = el[0] - el.addEventListener("change", this.handleFileSelect.bind(this)) +OKUpload.prototype.bind = function(rapper){ + var uploader = this + $(".add-image-button input", rapper).change( uploader.handleFileSelect.bind(uploader) ) + $(".add-image-url", rapper).keydown(pressEnter(function(e){ + var url = $(this).val() + $(this).val("") + uploader.add(url) + })) } OKUpload.prototype.handleFileSelect = function(e) { e.stopPropagation(); @@ -33,12 +38,13 @@ OKUpload.prototype.upload = function(f){ }) request.done(this.success.bind(this)) } -OKUpload.prototype.success = function(media){ - if (media.error) { - console.log(media.error) +OKUpload.prototype.success = function(data){ + if (data.error) { + console.log(data.error) return } - this.add(media) + var url = data[0].extra.Location + this.add(url) } OKUpload.prototype.add = function(media){ console.log(media) @@ -46,3 +52,13 @@ OKUpload.prototype.add = function(media){ OKUpload.prototype.error = function(error){ throw error } + + + +function pressEnter(fn){ + return function(e){ + if (e.keyCode && e.keyCode !== 13) return + e.preventDefault() + fn.apply(this) + } +} \ No newline at end of file -- cgit v1.2.3-70-g09d2 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(-) (limited to 'site/templates/index.liquid') 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. + -- cgit v1.2.3-70-g09d2 From 4ebff1d371a6ddbf164aa29083ef00a9dfdc7895 Mon Sep 17 00:00:00 2001 From: Sean Fridman Date: Tue, 12 May 2015 18:23:24 -0400 Subject: Load scripts based on production flag --- site/templates/index.liquid | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'site/templates/index.liquid') diff --git a/site/templates/index.liquid b/site/templates/index.liquid index 4af22e4..573cfc0 100644 --- a/site/templates/index.liquid +++ b/site/templates/index.liquid @@ -181,22 +181,22 @@ WEBSITE BY OKFOCUS, http://okfoc.us, Internet Legends. - - - - - - - - - - - - - - - - +{% if meta.production %} + +{% else %} + + + + + + + + + + + + + + +{% endif %} -- cgit v1.2.3-70-g09d2 From 158aaa8ff7a9698b8a9f90739a1fe48ff2a6807b Mon Sep 17 00:00:00 2001 From: Julie Lala Date: Tue, 19 May 2015 01:42:56 +0200 Subject: merge retail section into experiental --- site/db.json | 6 ++---- site/index.js | 26 ++++++++++++-------------- site/templates/all.liquid | 6 ------ site/templates/index.liquid | 6 ------ 4 files changed, 14 insertions(+), 30 deletions(-) (limited to 'site/templates/index.liquid') diff --git a/site/db.json b/site/db.json index 4bb50e4..010ad37 100644 --- a/site/db.json +++ b/site/db.json @@ -1,6 +1,6 @@ { "meta": [], - "retail": [ + "experiential": [ { "id": "nicola-s-new-york", "title": "NICOLA’S NEW YORK", @@ -109,9 +109,7 @@ "caption": "" }, "__index": "2" - } - ], - "experiential": [ + }, { "id": "gaga-s-workshop-barneys-new-york", "title": "GAGA'S WORKSHOP + BARNEYS NEW YORK", diff --git a/site/index.js b/site/index.js index 04d2455..9e1f568 100644 --- a/site/index.js +++ b/site/index.js @@ -30,7 +30,6 @@ var app = okcms.createApp({ advertising: projectSchema, content: projectSchema, experiential: projectSchema, - retail: projectSchema, shape: { id: {type: 'string', id: true, hidden: true}, title: {type: 'string'}, @@ -46,7 +45,6 @@ var app = okcms.createApp({ { type: 'advertising' }, { type: 'content' }, { type: 'experiential' }, - { type: 'retail' }, ], services: { @@ -65,7 +63,7 @@ var app = okcms.createApp({ {type: 'page', query: 'contact'}, // {type: 'shape', query: 'about-images'}, {type: 'shape', query: 'shape-images'}, - {type: 'retail', query: '*'}, +// {type: 'retail', query: '*'}, {type: 'advertising', query: '*'}, {type: 'experiential', query: '*'}, {type: 'content', query: '*'}, @@ -83,23 +81,23 @@ var app = okcms.createApp({ }, '/all': { data: [ - {type: 'retail', query: '*'}, +// {type: 'retail', query: '*'}, {type: 'advertising', query: '*'}, {type: 'experiential', query: '*'}, {type: 'content', query: '*'}, ], template: 'all' }, - '/retail/:id': { - data: { - type: 'retail', - as: 'project', - query: { - id: ':id' - } - }, - template: 'project' - }, +// '/retail/:id': { +// data: { +// type: 'retail', +// as: 'project', +// query: { +// id: ':id' +// } +// }, +// template: 'project' +// }, '/advertising/:id': { data: { type: 'advertising', diff --git a/site/templates/all.liquid b/site/templates/all.liquid index 97528c2..ca4b83f 100644 --- a/site/templates/all.liquid +++ b/site/templates/all.liquid @@ -17,10 +17,4 @@ {{ project.menu }}
{% endfor %} - {% for project in retails %} -
- - {{ project.menu }} -
- {% endfor %}
diff --git a/site/templates/index.liquid b/site/templates/index.liquid index 573cfc0..41d64e6 100644 --- a/site/templates/index.liquid +++ b/site/templates/index.liquid @@ -101,12 +101,6 @@ WEBSITE BY OKFOCUS, http://okfoc.us, Internet Legends.
{% for project in experientials %} {{ project.menu }} - {% endfor %} -
-
retail
-
- {% for project in retails %} - {{ project.menu }} {% endfor %}
-- cgit v1.2.3-70-g09d2 From ccafdf24213ffe0d303cf8cc5bf11325a84751cc Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 27 May 2015 16:08:56 -0400 Subject: deviceorientation stuff --- Gruntfile.js | 1 + site/public/assets/javascripts/_env.js | 28 ++- .../mx/extensions/mx.unclampedOrbitCameraMobile.js | 225 +++++++++++++++++++++ site/templates/index.liquid | 1 + 4 files changed, 247 insertions(+), 8 deletions(-) create mode 100644 site/public/assets/javascripts/mx/extensions/mx.unclampedOrbitCameraMobile.js (limited to 'site/templates/index.liquid') diff --git a/Gruntfile.js b/Gruntfile.js index b32e6ad..bb6f1eb 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -12,6 +12,7 @@ module.exports = function(grunt) { "site/public/assets/javascripts/mx/mx.skew.js", "site/public/assets/javascripts/mx/extensions/mx.scene.js", "site/public/assets/javascripts/mx/extensions/mx.unclampedOrbitCamera.js", + "site/public/assets/javascripts/mx/extensions/mx.unclampedOrbitCameraMobile.js", "site/public/assets/javascripts/mx/primitives/mx.image.js", "site/public/assets/javascripts/vendor/jquery.min.js", diff --git a/site/public/assets/javascripts/_env.js b/site/public/assets/javascripts/_env.js index dee524c..6748409 100644 --- a/site/public/assets/javascripts/_env.js +++ b/site/public/assets/javascripts/_env.js @@ -74,14 +74,26 @@ environment.init = function(){ environment.ready = function(){ if (window.innerWidth < 500) document.body.classList.add('mobile') - controls = new MX.OrbitCamera({ - radius: 100000, - radiusRange: [ 10, 2000 ], - rotationX: PI/2, - rotationY: PI, - wheelEase: 20, - ease: 100 - }) + if (is_mobile) { + controls = new MX.OrbitCameraMobile({ + radius: 100000, + radiusRange: [ 10, 2000 ], + rotationX: PI/2, + rotationY: PI, + wheelEase: 20, + ease: 100 + }) + } + else { + controls = new MX.OrbitCamera({ + radius: 100000, + radiusRange: [ 10, 2000 ], + rotationX: PI/2, + rotationY: PI, + wheelEase: 20, + ease: 100 + }) + } controls.init() $('.cat').click( function(){ diff --git a/site/public/assets/javascripts/mx/extensions/mx.unclampedOrbitCameraMobile.js b/site/public/assets/javascripts/mx/extensions/mx.unclampedOrbitCameraMobile.js new file mode 100644 index 0000000..510a002 --- /dev/null +++ b/site/public/assets/javascripts/mx/extensions/mx.unclampedOrbitCameraMobile.js @@ -0,0 +1,225 @@ +MX.OrbitCameraMobile = function(opt){ + var exports = {}, bound = false + exports.opt = opt = defaults(opt, { + el: window, // object to bind events on + camera: scene.camera, // camera object we'll be moving + radius: 100, + radiusRange: [ 10, 1000 ], + rotationX: PI/2, + rotationY: 0, + center: { x: 0, y: 0, z: 0 }, + sensitivity: 10, // moving 1 pixel is like moving N radians + wheelSensitivity: 10, + ease: 10, + wheelEase: 10, + }) + var rx, ry, radius, px, py, epsilon = 1e-10 + var rotationSum = 0 + var rotationMedian = 0 + var orientationMax = 0 + var samples = 0 + var sampleThreshold = 20 + var lastAlpha + + exports.dragging = false + exports.init = function(){ + ry = opt.rotationY + rx = opt.rotationX + radius = opt.radius + exports.wheel = new wheel({ + el: opt.el, + update: function(e, delta){ + opt.radius = clamp( opt.radius + delta * opt.wheelSensitivity, opt.radiusRange[0], opt.radiusRange[1] ) + }, + }) + exports.bind() + + exports.orientationchange() + } + exports.toggle = function(state){ + if (state) exports.bind() + else exports.unbind() + } + exports.bind = function(){ + if (bound) return; + bound = true + opt.el.addEventListener("touchstart", touch(down)) + window.addEventListener("touchmove", touch(move)) + window.addEventListener("touchend", touch(up)) + + window.addEventListener('orientationchange', exports.orientationchange) + window.addEventListener("devicemotion", exports.devicemotion) + window.addEventListener("deviceorientation", exports.deviceorientation) + + exports.wheel.unlock() + } + exports.unbind = function(){ + if (! bound) return; + bound = false + exports.wheel.lock() + } + function cancelable (fn) { + return function(e){ + e.preventDefault() + fn(e) + } + } + function touch (fn){ + return function(e){ + fn(e.touches[0]) + } + } + function down (e) { + px = e.pageX + py = e.pageY + exports.dragging = true + } + function move (e) { + if (! exports.dragging) return + exports.delta(px- e.pageX, py - e.pageY) + px = e.pageX + py = e.pageY + } + function up (e) { + exports.dragging = false + } + + exports.orientationchange = function(e){ + is_portrait = window.innerWidth < window.innerHeight + if (is_portrait) { + lastAlpha = 0 + } + } + exports.devicemotion = function(e) { + if (! is_portrait) return; + var rotationBeta = e.rotationRate.alpha; // weird! + rotationSum += rotationBeta; + samples += 1; + } + exports.deviceorientation = function (e) { + if (! lastAlpha) { lastAlpha = e.alpha } + is_portrait ? exports.portraitorientation(e) : exports.landscapeorientation(e) + } + exports.portraitorientation = function(e) { + // compass gives most accurate orientation in portrait mode + var alpha, dx = 0, dy = 0 + + if (e.webkitCompassHeading) { + alpha = 180 - e.webkitCompassHeading; + } + else { + alpha = 180 - e.alpha; + } + + // android rotates in reverse + if (is_android) { + alpha = 360 - alpha + } + + // use rotationRate to gauge if we've tilted the screen past vertical + // for looking at ceiling + if (e.beta > orientationMax) { + orientationMax = e.beta + rotationMedian = rotationSum + } + + // this number was only going to 83 max.. not 90.. weird + var beta = e.beta + 7; + + // if we've got enough motion data, we should be able to determine + // if we've tilted backwards. otherwise, lock to the horizon. + if (! is_android && samples > sampleThreshold) { + dx = rotationSum > rotationMedian ? e.beta - 90 : 90 - e.beta + } + else { + dx = 0 + } + + // avoid jumping around in a circle + if (Math.abs(alpha - lastAlpha) < 100 || Math.abs(alpha - lastAlpha) > 300) { + dy = alpha - lastAlpha + lastAlpha = alpha + } + + // avoid jumping around in a circle #2 + if (dy > 300) { + dy -= 360 + } else if (dy < -300) { + dy += 360 + } + opt.rotationX = MX.toRad(dx * -5) + opt.rotationY += MX.toRad(dy * 10) + } + exports.landscapeorientation = function (e) { + var dx, dy + + dx = e.gamma > 0 ? 90 - e.gamma : 90 + e.gamma + dy = e.alpha - lastAlpha + lastAlpha = e.alpha + + // avoid the sudden jump from 0 to -360 + if (dy > 300) { + dy -= 360 + } + else if (dy < -300) { + dy += 360 + } + + opt.rotationX = dx > 45 ? 0 : MX.toRad(dx) + opt.rotationY += MX.toRad(dy) + } + + + exports.delta = function(x,y){ + opt.rotationY += x/window.innerWidth * opt.sensitivity + opt.rotationX = opt.rotationX + y/window.innerHeight * opt.sensitivity + } + exports.move = function(y, x){ + opt.rotationY = y + if (typeof x == "number") { opt.rotationX = x } + } + exports.zoom = function(r){ + opt.radius = r + } + exports.setZoom = function(r){ + radius = opt.radius = r + } + exports.zoomPercent = function(n){ + opt.radius = lerp(n, opt.radiusRange[0], opt.radiusRange[1]) + } + exports.zoomDelta = function(r){ + opt.radius += r + } + exports.pause = function(){ + var sy = sign(opt.rotationY-ry) + var sx = sign(opt.rotationX-rx) + opt.rotationY = ry + sy * 0.1 + opt.rotationX = rx + sx * 0.1 + } + exports.update = function(){ + if (abs(ry - opt.rotationY) > epsilon) { + ry = avg(ry, opt.rotationY, opt.ease) + } + else { + ry = opt.rotationY + } + if (abs(rx - opt.rotationX) > epsilon) { + rx = avg(rx, opt.rotationX, opt.ease) + } + else { + rx = opt.rotationX + } + if (abs(radius - opt.radius) > epsilon) { + radius = avg(radius, opt.radius, opt.wheelEase) + } + else { + radius = opt.radius + } + opt.camera.x = opt.center.x + radius * sin(rx) * cos(ry) + opt.camera.z = opt.center.y + radius * sin(rx) * sin(ry) + opt.camera.y = opt.center.z + radius * cos(rx) + opt.camera.rotationX = PI/2 - rx + opt.camera.rotationY = ry + PI/2 + } + return exports +} diff --git a/site/templates/index.liquid b/site/templates/index.liquid index 41d64e6..75fe389 100644 --- a/site/templates/index.liquid +++ b/site/templates/index.liquid @@ -181,6 +181,7 @@ WEBSITE BY OKFOCUS, http://okfoc.us, Internet Legends. + -- cgit v1.2.3-70-g09d2 From c87bb822ddc637cb4dec81c3d779a16f4edc5e26 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 5 Jun 2015 11:40:35 -0400 Subject: meta description --- site/templates/index.liquid | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'site/templates/index.liquid') diff --git a/site/templates/index.liquid b/site/templates/index.liquid index 75fe389..0308a79 100644 --- a/site/templates/index.liquid +++ b/site/templates/index.liquid @@ -67,7 +67,7 @@ WEBSITE BY OKFOCUS, http://okfoc.us, Internet Legends. - + -- cgit v1.2.3-70-g09d2 From f8e74cf7e9faddc5d28e6139d95ab25f1605e5ce Mon Sep 17 00:00:00 2001 From: ryderr Date: Mon, 8 Jun 2015 14:40:32 -0400 Subject: facebook tags --- site/templates/index.liquid | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'site/templates/index.liquid') diff --git a/site/templates/index.liquid b/site/templates/index.liquid index 0308a79..8dbac5c 100644 --- a/site/templates/index.liquid +++ b/site/templates/index.liquid @@ -67,11 +67,14 @@ WEBSITE BY OKFOCUS, http://okfoc.us, Internet Legends. - +\ + + + -- cgit v1.2.3-70-g09d2 From 61eba61e64ca2daec8ade071eaf5ef632b819018 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 8 Jun 2015 15:21:51 -0400 Subject: fb share --- site/public/assets/javascripts/_env.js | 4 +++- site/templates/index.liquid | 5 +---- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'site/templates/index.liquid') diff --git a/site/public/assets/javascripts/_env.js b/site/public/assets/javascripts/_env.js index 6748409..7ee9255 100644 --- a/site/public/assets/javascripts/_env.js +++ b/site/public/assets/javascripts/_env.js @@ -747,11 +747,13 @@ var Share = { // var msg = $(".postname").html() // var url = "https://www.facebook.com/share.php?u=" + encodeURIComponent(link) + "&t=" + encodeURIComponent(msg) // window.open(url, "_blank") + + var picture = $(".gallery img").first().attr("src") || ($(".gallery .underlay").css('background-image') || "").replace("url(","").replace(")","") || "http://twohustlers.com/assets/images/2H_LOGOMARK.png" FB.ui({ method: 'feed', link: window.location.href, caption: $(".postname").html(), - picture: $(".gallery img").first().attr("src"), + picture: picture, }, function(response){}); }, diff --git a/site/templates/index.liquid b/site/templates/index.liquid index 8dbac5c..a609ceb 100644 --- a/site/templates/index.liquid +++ b/site/templates/index.liquid @@ -67,15 +67,12 @@ WEBSITE BY OKFOCUS, http://okfoc.us, Internet Legends. -\ + - - - -- cgit v1.2.3-70-g09d2 From 65f18497e5b34cdedd4f967edf7f73234f9818ca Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 22 Jun 2015 15:22:59 -0400 Subject: custom content --- site/templates/index.liquid | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'site/templates/index.liquid') diff --git a/site/templates/index.liquid b/site/templates/index.liquid index a609ceb..28a7e04 100644 --- a/site/templates/index.liquid +++ b/site/templates/index.liquid @@ -91,7 +91,7 @@ WEBSITE BY OKFOCUS, http://okfoc.us, Internet Legends. {{ project.menu }} {% endfor %}
-
content
+
custom content
{% for project in contents %} {{ project.menu }} -- cgit v1.2.3-70-g09d2 From 4f8a4a332144b74ca277f1200dd41f37e1714c37 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 22 Jun 2015 16:16:04 -0400 Subject: copy --- site/templates/index.liquid | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'site/templates/index.liquid') diff --git a/site/templates/index.liquid b/site/templates/index.liquid index 28a7e04..738cbe7 100644 --- a/site/templates/index.liquid +++ b/site/templates/index.liquid @@ -91,7 +91,7 @@ WEBSITE BY OKFOCUS, http://okfoc.us, Internet Legends. {{ project.menu }} {% endfor %}
-
custom content
+
digital programs
{% for project in contents %} {{ project.menu }} -- cgit v1.2.3-70-g09d2 From e42a871b1a041ad68f6316aa1d50d1e7fe741123 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 24 Jun 2015 14:47:47 -0400 Subject: edits --- site/index.js | 1 + site/public/assets/style.css | 12 ++++++++++++ site/templates/about.liquid | 1 + site/templates/all.liquid | 1 + site/templates/index.liquid | 2 +- 5 files changed, 16 insertions(+), 1 deletion(-) (limited to 'site/templates/index.liquid') diff --git a/site/index.js b/site/index.js index aa1f58c..430f73f 100644 --- a/site/index.js +++ b/site/index.js @@ -87,6 +87,7 @@ var app = okcms.createApp({ {type: 'advertising', query: '*'}, {type: 'experiential', query: '*'}, {type: 'content', query: '*'}, + {type: 'page', query: 'about'} ], template: 'all' }, diff --git a/site/public/assets/style.css b/site/public/assets/style.css index 4f28979..2cd2d29 100644 --- a/site/public/assets/style.css +++ b/site/public/assets/style.css @@ -862,6 +862,18 @@ nav .sub.active a { margin-top: 0; padding-top: 0; } +.all .contactcontent { + width: 100%; + clear: both; + position: relative; + top: 1em; + margin-left: 10px; + padding: 1em 0; + font-size: 0.8em; + line-height: 1.5em; + border-bottom: 1px solid black; + border-top: 1px solid black; +} .desktop .brady > a:hover:after { content: 'SAY HELLO!'; position: absolute; diff --git a/site/templates/about.liquid b/site/templates/about.liquid index 86207cf..5858462 100644 --- a/site/templates/about.liquid +++ b/site/templates/about.liquid @@ -1,6 +1,7 @@
+
{{page.body | newline_to_br}}
diff --git a/site/templates/all.liquid b/site/templates/all.liquid index 5f3009f..34db1fc 100644 --- a/site/templates/all.liquid +++ b/site/templates/all.liquid @@ -20,4 +20,5 @@
{% endfor %}
+
{{page.contact | newline_to_br}}
diff --git a/site/templates/index.liquid b/site/templates/index.liquid index 738cbe7..572cf0a 100644 --- a/site/templates/index.liquid +++ b/site/templates/index.liquid @@ -108,7 +108,7 @@ WEBSITE BY OKFOCUS, http://okfoc.us, Internet Legends.
VIEW ALL PROJECTS
-
ABOUT
+
ABOUT/CONTACT
{{ page.body | newline_to_br }}
-- cgit v1.2.3-70-g09d2