Skip to content

Commit

Permalink
feat(themes): april fools 2024
Browse files Browse the repository at this point in the history
  • Loading branch information
krishnans2006 committed Apr 1, 2024
1 parent a983e1d commit 7b96563
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
9 changes: 9 additions & 0 deletions intranet/static/themes/april_fools/april_fools.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.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;
}
22 changes: 22 additions & 0 deletions intranet/static/themes/april_fools/april_fools.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
$(function() {
// One in 10 chance of a hair appearing on the page
if (Math.random() < 0.1) {
$("body").append($(`
<div class="hair"></div>
`));

// 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;
$(".hair").css({
width: `${width}vw`,
height: `${height}vh`,
top: `${top}vh`,
left: `${left}vw`,
transform: `rotate(${angle}deg)`,
});
}
});

0 comments on commit 7b96563

Please sign in to comment.