diff options
| author | pepperpepperpepper <pepper@scannerjammer.com> | 2015-11-16 16:35:11 -0800 |
|---|---|---|
| committer | pepperpepperpepper <pepper@scannerjammer.com> | 2015-11-16 16:35:11 -0800 |
| commit | 24e05a0b065b7d01417efeabb07523b3cc8c0bf0 (patch) | |
| tree | ce3b20a1ff239d2e10986806b0df6a34620bcf78 /gallery/js/titleScrambler.js | |
| parent | 288c39d3b67064c8e7f5dbea8dc5bbb15a19828d (diff) | |
gallery first draft
Diffstat (limited to 'gallery/js/titleScrambler.js')
| -rw-r--r-- | gallery/js/titleScrambler.js | 56 |
1 files changed, 0 insertions, 56 deletions
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); - |
