From 24e05a0b065b7d01417efeabb07523b3cc8c0bf0 Mon Sep 17 00:00:00 2001 From: pepperpepperpepper Date: Mon, 16 Nov 2015 16:35:11 -0800 Subject: gallery first draft --- gallery/js/main.js | 41 ++++++++++++------------ gallery/js/querystring.js | 13 ++++++++ gallery/js/title.js | 74 ++++++++++++++++++++++++++++++++++++++++++++ gallery/js/titleScrambler.js | 56 --------------------------------- 4 files changed, 108 insertions(+), 76 deletions(-) create mode 100644 gallery/js/querystring.js create mode 100644 gallery/js/title.js delete mode 100644 gallery/js/titleScrambler.js (limited to 'gallery/js') diff --git a/gallery/js/main.js b/gallery/js/main.js index 953e346..d97fab0 100644 --- a/gallery/js/main.js +++ b/gallery/js/main.js @@ -1,10 +1,23 @@ -var title_choices = [ +$(function(){ + $("b").addClass("pulsate_and_grow"); + $(".sorting-options").click(function(){ + + $(".sorting-options").click(function(){ + if ($(this).hasClass("pulsate_opacity")){ + $(this).removeClass("pulsate_opacity"); + } + $(this).addClass("pulsate_opacity"); + + }); + }); +}); + ZeroClipboard.setMoviePath( 'http://asdf.us/swf/ZeroClipboard10.swf' ); var clip = new ZeroClipboard.Client(); clip.glue( 'd_clip_button' ); -var Dump = - { + +var Dump = { pick: function () { Dump.pickUrl( $(this).attr("src") ) @@ -47,7 +60,8 @@ var Dump = { window.location.href = '?"""+back_QS+"""' } - } +} + function applyTag(tagname){ tag_regex = /&tag=[^&]*/; if (document.URL.match(tag_regex)){ @@ -123,22 +137,9 @@ var Main = Dump.clear() } } - 'Keep on pickin\' on..', - 'Pickolaus Pickleby by Charles Pickens!', - 'You pick potato and I pick potahto...', - 'Take your piq!', - 'Show em what you got', - 'I sure know how to pick \'em', - 'Jus pick somethin already!', - 'You can\'t pick your friends...', - 'Select your image my liege', - 'There\'s a time to choose...', - 'gimme a choice! gimme lil\' choice-a-that...', - 'You choose you lose', - 'novels by James CHOICE...', - 'Choose away, chooser-man...', -] -document.title = title_choices[Math.floor(Math.random() * title_choices.length)] + + + $(function(){ var imagedata = [ """ //needs a synchronous call here for (var i=0; i< (imagedata.length - 1); i++){ diff --git a/gallery/js/querystring.js b/gallery/js/querystring.js new file mode 100644 index 0000000..79c2a4d --- /dev/null +++ b/gallery/js/querystring.js @@ -0,0 +1,13 @@ +(function($) { + $.QueryString = (function(a) { + if (a == "") return {}; + var b = {}; + for (var i = 0; i < a.length; ++i) + { + var p=a[i].split('='); + if (p.length != 2) continue; + b[p[0]] = decodeURIComponent(p[1].replace(/\+/g, " ")); + } + return b; + })(window.location.search.substr(1).split('&')) +})(jQuery); diff --git a/gallery/js/title.js b/gallery/js/title.js new file mode 100644 index 0000000..a9ac584 --- /dev/null +++ b/gallery/js/title.js @@ -0,0 +1,74 @@ +var title_choices = [ + 'Keep on pickin\' on..', + 'Pickolaus Pickleby by Charles Pickens!', + 'You pick potato and I pick potahto...', + 'Take your piq!', + 'Show em what you got', + 'I sure know how to pick \'em', + 'Jus pick somethin already!', + 'You can\'t pick your friends...', + 'Select your image my liege', + 'There\'s a time to choose...', + 'gimme a choice! gimme lil\' choice-a-that...', + 'You choose you lose', + 'novels by James CHOICE...', + 'Choose away, chooser-man...' +] +document.title = title_choices[Math.floor(Math.random() * title_choices.length)] + +var titleSwitch = true; +var FillerChars = [ "(",")","|","1","4","\\", "9","_" ]; +var titleArray = document.title.split(""); +var titleArrayCopy = titleArray.slice(0); +var titleLength = titleArray.length + +function marqueeArray(arr){ + var first = arr[0] + arr.shift() +} + +function replaceArray(arr, char){ + arr[randomChoice(arr)] = char +} +var titleUpdateInterval = 300 +function randomChoice(arr){ + var rand = Math.random(); + rand *= arr.length; + rand = Math.floor(rand) + return rand; +} +var titleUpdate = setInterval(function(){ + if (titleSwitch === true){ + marqueeArray(titleArray); + document.title = titleArray.join("") + if (titleArray.length === 1){ + document.title = ""; + titleArray = titleArrayCopy.slice(0); + document.title = titleArray.join(""); + if (titleSwitch){ + titleSwitch = false; + }else{ + titleSwitch = true; + titleUpdateInterval = 100; + } + } + }else{ + + replaceArray(titleArray, FillerChars[randomChoice(FillerChars)]); + document.title = titleArray.join("") + if (titleArray[(titleArray.length-1)] in FillerChars){ + console.log("it's in there"); + titleArray = titleArrayCopy.slice(0); + document.title = titleArray.join(""); + if (titleSwitch){ + titleSwitch = false; + titleUpdateInterval = 300; + }else{ + titleSwitch = true; + } + + } + } + + }, titleUpdateInterval); + diff --git a/gallery/js/titleScrambler.js b/gallery/js/titleScrambler.js deleted file mode 100644 index 6948cbf..0000000 --- a/gallery/js/titleScrambler.js +++ /dev/null @@ -1,56 +0,0 @@ -var titleSwitch = true; -var FillerChars = [ "(",")","|","1","4","\\", "9","_" ]; -var titleArray = document.title.split(""); -var titleArrayCopy = titleArray.slice(0); -var titleLength = titleArray.length - -function marqueeArray(arr){ - var first = arr[0] - arr.shift() -} - -function replaceArray(arr, char){ - arr[randomChoice(arr)] = char -} -var titleUpdateInterval = 300 -function randomChoice(arr){ - var rand = Math.random(); - rand *= arr.length; - rand = Math.floor(rand) - return rand; -} -var titleUpdate = setInterval(function(){ - if (titleSwitch === true){ - marqueeArray(titleArray); - document.title = titleArray.join("") - if (titleArray.length === 1){ - document.title = ""; - titleArray = titleArrayCopy.slice(0); - document.title = titleArray.join(""); - if (titleSwitch){ - titleSwitch = false; - }else{ - titleSwitch = true; - titleUpdateInterval = 100; - } - } - }else{ - - replaceArray(titleArray, FillerChars[randomChoice(FillerChars)]); - document.title = titleArray.join("") - if (titleArray[(titleArray.length-1)] in FillerChars){ - console.log("it's in there"); - titleArray = titleArrayCopy.slice(0); - document.title = titleArray.join(""); - if (titleSwitch){ - titleSwitch = false; - titleUpdateInterval = 300; - }else{ - titleSwitch = true; - } - - } - } - - }, titleUpdateInterval); - -- cgit v1.2.3-70-g09d2