Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

April Fools 2024 #1650

Merged
merged 2 commits into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Ion.egg-info/SOURCES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion intranet/settings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
137 changes: 16 additions & 121 deletions intranet/static/themes/april_fools/april_fools.css
Original file line number Diff line number Diff line change
@@ -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%}
}

74 changes: 55 additions & 19 deletions intranet/static/themes/april_fools/april_fools.js
Original file line number Diff line number Diff line change
@@ -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($(`
<li class="nav-chat">
<a href="/chat">
<i class="chat-nav-icon fas fa-comments"></i>
ChatION
</a>
</li>
`));
$(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 = $(`<div class="hair"><div class="hair-click"></div></div>`)
$("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!<br />&ensp;- 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;
}
});
}
});
Binary file not shown.
4 changes: 2 additions & 2 deletions intranet/utils/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading