From 1e006b7df774ac9966ba2105e68cebf5e395e98d Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 18 Aug 2017 23:39:59 +0200 Subject: folkestone --- public/site.js | 71 ---------------------------------------------------------- 1 file changed, 71 deletions(-) delete mode 100644 public/site.js (limited to 'public/site.js') diff --git a/public/site.js b/public/site.js deleted file mode 100644 index a604c15..0000000 --- a/public/site.js +++ /dev/null @@ -1,71 +0,0 @@ -var site = {} - -$(function(){ - $.getJSON('/db.json', function(data){ - site = data - site.entry.forEach(function(entry){ - entry.tags = entry.tags.split('#').map(function(tag){ - return tag.trim() - }) - }) - ready() - }) -}) - -function ready() { - bind() - build() -} -function bind(){ - $('.cell').click( function(){ - var id = $(this).data().id - var entry = site.entry[id] - show_entry(entry) - }) - $('.close').click( function(){ - close_modals() - }) - $('.tag').click( function(){ - var tag = $(this).html() - filter_by_tag(tag) - }) -} -function build(){ - $('.cell').each( function(){ - var id = $(this).data().id - var entry = site.entry[id] - if (entry.media && entry.media.length) { - var media = entry.media[0] - switch (media.type) { - case 'youtube': - bg = media.thumb - break - case 'image': - bg = media.uri - break - } - $(this).css('background-image', 'url(' + bg + ')') - } - }) -} - -function show_entry(entry){ - $('#entry h1').html(entry.title) - $('#entry .content').html(entry.body) - $('#entry .media').empty() - if (media.gallery) { - - } - else { - - } - $('body').addClass('entry') -} -function hide_entry(){ - setTimeout(clear_entry, 500) -} -function clear_entry(){ -} -function close_modals(){ - $('body').removeClass('entry').removeClass('about') -} \ No newline at end of file -- cgit v1.2.3-70-g09d2