From 6db0460ed01e27eec72b70d4907736ac5942fc42 Mon Sep 17 00:00:00 2001 From: Benjamin Southall Date: Thu, 4 May 2017 14:04:22 +0900 Subject: Add support for floating balloons used in the birthday celebrations --- js/loadballoons.js | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 js/loadballoons.js (limited to 'js/loadballoons.js') diff --git a/js/loadballoons.js b/js/loadballoons.js new file mode 100644 index 00000000..c4cfdb4f --- /dev/null +++ b/js/loadballoons.js @@ -0,0 +1,48 @@ +if (active_page === "catalog" || active_page === "thread" || active_page === "index" || active_page === "ukko") { + +$(document).on("ready", function() { +if (window.Options && Options.get_tab('general')) { + Options.extend_tab("general", + "
Special Event Effects " + + ("") + + "
"); +} + +$('.event-effect').on('change', function(){ + var setting = $(this).attr('id'); + + localStorage[setting] = $(this).children('input').is(':checked'); + location.reload(); +}); + +if (!localStorage.eventeffect) { + localStorage.eventeffect = 'true'; +} + +function getSetting(key) { + return (localStorage[key] == 'true'); +} + +if (getSetting('eventeffect')) $('#eventeffect>input').prop('checked', 'checked'); + +function initBalloons() { //Pashe, influenced by tux, et al, WTFPL + if (!getSetting("eventeffect")) {return;} + +floatingLove({ + 'minSpeed': 1.5, //Minimum vertical speed + 'maxSpeed': 2, //Maximum vertical speed + 'minAmplitude': 0.5, //Minimum amplitude (>0) + 'maxAmplitude': 1.5, //Maximum amplitude (>0) + 'minFrequency': 0.08, //Maximum Frequency (>0) + 'maxFrequency': 0.1, //Maximum Frequency (>0) + 'minAlpha': 0.7, //Minimum opacity (0-1) + 'maxAlpha': 0.8, //Maximum opacity (0-1) + 'minScale': 0.2, //Minimum size multiplier (0-1) + 'maxScale': 0.8, //Maximum size multiplier (0-1) + 'interval': 1000, //Time gap between each heart + 'delay': 1000 //Starting delay from initialization + }).init(); +} +initBalloons(); +}); +} -- cgit v1.3