Skip to content

Instantly share code, notes, and snippets.

@JasonCole1980
Created September 24, 2013 21:56
Show Gist options
  • Save JasonCole1980/6691853 to your computer and use it in GitHub Desktop.
Save JasonCole1980/6691853 to your computer and use it in GitHub Desktop.
JasonPCole.com - UI and settings stuff. JSON parsing function for reading site content from separate file, needs testing.
$(function () {
var s;
var theSequence = {
settings: {
/* "Cached" variables/information,
frequently/widely used information for sub-functions */
logoButton: $('#logo'),
header: $('header'),
navigation: $('nav'),
about: $('#about'),
projectsTrigger: $('nav a[title="Projects"]'),
projectsWrapper: $('#projects-outer-wrap div.row-fluid'),
contactTrigger: $('nav a[title="Contact"]'),
close: $('a.close'),
toggleSideBar: $('a.toggleSideBar')
},
init: function() {
// init The Sequence settings vars
s = this.settings;
// init UIActions function
this.bindUIActions();
// init Flickr API function
//this.initFlickr();
},
bindUIActions: function() {
/* Bind header element to
mouseover/out to toggle
open area to display portfolio */
s.projectsTrigger.on('click', function(){
theSequence.openProjects();
s.close.show();
});
s.close.on('click', function(){
theSequence.closeProjects();
s.close.hide();
});
},
openProjects: function() {
theSequence.animateDOM(s.header, -50);
theSequence.animateDOM(s.navigation, -50);
theSequence.animateDOM(s.about, +200);
// Test first
$.getJSON('js/projects.json', function(data) {
/*var items = [];
$.each(data, function(key, val) {
items.push('<h3 class="' + key.projectTitle + '">' + val.projectTitle + '</h3>');
items.push('<p class="' + key.projectDescription + '">' + val.projectDescription + '</p>');
$.each(data(val.projectImageURLs), function(keyM, valM) {
items.push('<img src="' + valM + '" />');
});*/
var tableValues = $.parseJSON(data);
$.each(tableValues, function() {
console.log(this.projectImageURLs);
});
/*$('<div>', {
'class': 'projectJSON',
html: items.join('')
}).appendTo(s.projectsWrapper);*/
});
},
closeProjects: function() {
theSequence.animateDOM(s.header, 0);
theSequence.animateDOM(s.navigation, 0);
theSequence.animateDOM(s.about, 0);
},
animateDOM: function(element, topVal) {
$(element).animate({
top: topVal,
}, 800);
}
// initFlickr: {
// vars:,
// auth:,
// postAuth:
// console.log("flickr auth");
// }
};
theSequence.init();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment