diff --git a/Ion.egg-info/SOURCES.txt b/Ion.egg-info/SOURCES.txt index 31abea891b0..8a8e9dfc873 100644 --- a/Ion.egg-info/SOURCES.txt +++ b/Ion.egg-info/SOURCES.txt @@ -1188,7 +1188,6 @@ intranet/static/svg/optimized_bus_map_v2.svg intranet/static/svg/optimized_bus_map_v2_horizontal.svg intranet/static/themes/april_fools/april_fools.css intranet/static/themes/april_fools/april_fools.js -intranet/static/themes/april_fools/april_fools_logo.png intranet/static/themes/halloween/halloween-button.css intranet/static/themes/halloween/halloween-cookie.js intranet/static/themes/halloween/halloween.css diff --git a/intranet/settings/__init__.py b/intranet/settings/__init__.py index 0b4dc71d522..e8b04c40b41 100644 --- a/intranet/settings/__init__.py +++ b/intranet/settings/__init__.py @@ -639,7 +639,6 @@ def get_month_seconds(): "intranet.apps.auth", "intranet.apps.bus", "intranet.apps.cslapps", - "intranet.apps.customthemes", "intranet.apps.django", "intranet.apps.eighth", "intranet.apps.enrichment", diff --git a/intranet/static/themes/april_fools/april_fools.css b/intranet/static/themes/april_fools/april_fools.css index efa09dc3d76..343ce7a1861 100644 --- a/intranet/static/themes/april_fools/april_fools.css +++ b/intranet/static/themes/april_fools/april_fools.css @@ -1,124 +1,19 @@ -.header .logo { - background-image: url(/static/themes/april_fools/april_fools_logo.png); -} - -.intranet-title h1 { - color: #ECD294; - font-weight: bold; - font-size: 16pt; -} - -.header { - background: linear-gradient(90deg, #001135, #2b1de8, #ff2400, #e8b71d, #e3e81d, #1de840, #1ddde8, #2b1de8, #001135); - background-size: 1800% 1800%; - -webkit-animation: rainbow 60s ease infinite; - -z-animation: rainbow 60s ease infinite; - -o-animation: rainbow 60s ease infinite; - animation: rainbow 60s ease infinite; -} - -.nav .selected { - background-color: #eab63b !important; -} - -.widget, .nav { - border: 2px solid #eab63b; - border-color: #eab63b !important; - box-shadow: 0 0 5px #efc96e; -} - -.widget-title { - border-bottom-color: #eab63b !important; -} - -.nav li { - border-color: #eab63b !important; -} - -.chat-nav-icon { - font-size: 18pt; - position: relative; -} - -.chat-iframe { - width: 90vw; - height: 90vh; - border: 0; -} - -.chat-warning { - position: relative; - top: 25px; - right: 5vw; - float: right; -} - -@-webkit-keyframes animBg { - 0% { - background-position-x: 0; - } - 100% { - background-position-x: 500px; - } -} - -@keyframes animBg { - 0% { - background-position-x: 0; - } - 100% { - background-position-x: 500px; - } -} - -.ion-welcome-icons { - height: 50px; +.hair { + border-style: solid; + border-width: 1px; + border-color: transparent transparent #999 transparent; + border-radius: 0 0 0 50%/50%; + position: fixed; + background: transparent; + z-index: 100; + pointer-events: none; +} + +.hair-click { width: 100%; - background-image: url(https://ion.tjhsst.edu/static/img/icons.png); - background-size: auto 150px; - background-position: center -51px; - background-repeat: repeat-x; - position: absolute; - top: 74%; - margin-top: -25px; - animation: animBg 20s linear infinite; - -webkit-animation: animBg 20s linear infinite; -} - -.ion-welcome-continue { - padding: 10px 20px; + height: 50%; position: absolute; - bottom: 10px; - left: 50%; - margin-left: -60px; - width: 120px; + top: 75%; + left: 0; + pointer-events: auto; } - -@media (max-width: 767px) { - .chat-warning { - position: static; - margin-bottom: 10px - } -} - -@-webkit-keyframes rainbow { - 0%{background-position:0% 82%} - 50%{background-position:100% 19%} - 100%{background-position:0% 82%} -} -@-moz-keyframes rainbow { - 0%{background-position:0% 82%} - 50%{background-position:100% 19%} - 100%{background-position:0% 82%} -} -@-o-keyframes rainbow { - 0%{background-position:0% 82%} - 50%{background-position:100% 19%} - 100%{background-position:0% 82%} -} -@keyframes rainbow { - 0%{background-position:0% 50%} - 50%{background-position:100% 19%} - 100%{background-position:0% 82%} -} - diff --git a/intranet/static/themes/april_fools/april_fools.js b/intranet/static/themes/april_fools/april_fools.js index 4e007b10358..92097fba096 100644 --- a/intranet/static/themes/april_fools/april_fools.js +++ b/intranet/static/themes/april_fools/april_fools.js @@ -1,22 +1,58 @@ $(function() { - $('link[rel="icon"]').attr('href', '/static/themes/april_fools/april_fools_logo.png'); - $(".intranet-title h1").text("Intranet 4"); - let navbar = $("ul.nav"); - $(navbar).append($(` - - `)); - $(navbar).find("li.nav-chat").click(function() { - $(this).addClass("selected"); - }); - if(location.href.endsWith("chat")) { - $(navbar).find("li.nav-chat").addClass("selected"); - } - if(window.innerWidth > 768) { - $("iframe").attr("scrolling", "no"); + // One in 10 chance of a hair appearing on the page + if (Math.random() < 1) { + const hairElem = $(`
`) + $("body").append(hairElem); + + // Randomly position the hair + const width = Math.random() * 8 + 2; + const height = Math.random() * 6 + 2; + const top = Math.min(Math.random() * 100, 80 - height); + const left = Math.min(Math.random() * 100, 80 - width); + const angle = Math.random() * 360; + hairElem.css({ + width: `${width}vw`, + height: `${height}vh`, + "margin-bottom": `${-height}vh`, + top: `${top}vh`, + left: `${left}vw`, + transform: `rotate(${angle}deg)`, + }); + + // Popup configuration + const alertText = "Happy April Fools' Day!
 - Your Friendly Neighborhood Sysadmins"; + const hairClickElem = hairElem.find(".hair-click"); + let hairClickHoverTimer = null; + function sendHairMessage() { + if(window.Messenger) { + const hairMessage = Messenger().info({ + message: alertText, + hideAfter: 5, + showCloseButton: false + }); + } + } + + // Popup on click + hairClickElem.click(() => { + if (hairClickHoverTimer) { + clearTimeout(hairClickHoverTimer); + hairClickHoverTimer = null; + } + sendHairMessage(); + }); + + // Popup on hover for 1.5 seconds + hairClickElem.hover(() => { + hairClickHoverTimer = setTimeout(() => { + hairClickHoverTimer = null; + sendHairMessage(); + }, 1500); + }, () => { + if (hairClickHoverTimer) { + clearTimeout(hairClickHoverTimer); + hairClickHoverTimer = null; + } + }); } }); diff --git a/intranet/static/themes/april_fools/april_fools_logo.png b/intranet/static/themes/april_fools/april_fools_logo.png deleted file mode 100644 index 0ee486606a7..00000000000 Binary files a/intranet/static/themes/april_fools/april_fools_logo.png and /dev/null differ diff --git a/intranet/utils/helpers.py b/intranet/utils/helpers.py index b26f4fdf643..f17ca186a21 100644 --- a/intranet/utils/helpers.py +++ b/intranet/utils/helpers.py @@ -239,8 +239,8 @@ def get_theme_name() -> str: elif (today.month == 10 and 27 <= today.day <= 31) or (today.month == 11 and today.day == 1): return "halloween" # Enable when a new idea for April Fools 2024 comes around - # elif (today.month == 3 and (28 <= today.day <= 31)) or (today.month == 4 and (1 <= today.day <= 3)): - # return "april_fools" + elif (today.month == 3 and (28 <= today.day <= 31)) or (today.month == 4 and (1 <= today.day <= 3)): + return "april_fools" return None