Compare commits
3 Commits
766622f0fc
...
d6b87569a6
Author | SHA1 | Date | |
---|---|---|---|
d6b87569a6 | |||
1c38432467 | |||
c7b7285403 |
@ -3,6 +3,7 @@ import '/assets/scss/page.scss';
|
|||||||
document.addEventListener("readystatechange", event => {
|
document.addEventListener("readystatechange", event => {
|
||||||
if(event.target.readyState === 'complete') {
|
if(event.target.readyState === 'complete') {
|
||||||
initExternalLinks();
|
initExternalLinks();
|
||||||
|
initEasterEgg();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -15,6 +16,49 @@ function initExternalLinks() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function initEasterEgg() {
|
||||||
|
document.body.addEventListener('click', function(event) {
|
||||||
|
// Check if the clicked element is an interactive element or triggers an event
|
||||||
|
if (!isInteractiveElement(event.target)) {
|
||||||
|
let randomhue = Math.floor(Math.random() * 360)
|
||||||
|
let randomstring = Math.floor(Math.random() * eastereggstrings.length);
|
||||||
|
// Apply the color shift filter to the body
|
||||||
|
document.body.style.filter = 'hue-rotate(' + randomhue + 'deg)';
|
||||||
|
document.querySelector('.easter-egg').innerHTML = eastereggstrings[randomstring];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
let eastereggstrings = [
|
||||||
|
"No",
|
||||||
|
"Stop it",
|
||||||
|
"It not funny anymore",
|
||||||
|
"Odette does not like this",
|
||||||
|
"Garry has asked to stop scaring the birds",
|
||||||
|
"Seriously?",
|
||||||
|
"I'm out of here",
|
||||||
|
"Stop poking me. I' thinking",
|
||||||
|
"Oh boy"
|
||||||
|
]
|
||||||
|
|
||||||
|
function isInteractiveElement(element) {
|
||||||
|
// Check if the element is an interactive element or triggers an event
|
||||||
|
return (
|
||||||
|
element.tagName === 'A' ||
|
||||||
|
element.tagName === 'BUTTON' ||
|
||||||
|
element.tagName === 'INPUT' ||
|
||||||
|
element.tagName === 'SELECT' ||
|
||||||
|
element.tagName === 'TEXTAREA' ||
|
||||||
|
element.getAttribute('onclick') !== null ||
|
||||||
|
element.getAttribute('onmousedown') !== null ||
|
||||||
|
element.getAttribute('onmouseup') !== null ||
|
||||||
|
element.getAttribute('onmouseover') !== null ||
|
||||||
|
element.getAttribute('onmouseout') !== null ||
|
||||||
|
element.getAttribute('onmousemove') !== null ||
|
||||||
|
element.getAttribute('oncontextmenu') !== null
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
const isExternalURL = (url) => {
|
const isExternalURL = (url) => {
|
||||||
if(url.startsWith('/')) return false;
|
if(url.startsWith('/')) return false;
|
||||||
return new URL(url).origin !== location.origin;
|
return new URL(url).origin !== location.origin;
|
||||||
|
@ -7,22 +7,10 @@ $orange: #d6972a;
|
|||||||
$white: #f0f0f0;
|
$white: #f0f0f0;
|
||||||
$font: 'Fira Code', monospace;
|
$font: 'Fira Code', monospace;
|
||||||
|
|
||||||
html {
|
|
||||||
position: relative;
|
|
||||||
min-height: 100%;
|
|
||||||
}
|
|
||||||
body {
|
body {
|
||||||
margin-bottom: 60px; /* Margin bottom by footer height */
|
|
||||||
font-family: 'Mukta', sans-serif;
|
font-family: 'Mukta', sans-serif;
|
||||||
background-color: $white;
|
background-color: $white;
|
||||||
}
|
}
|
||||||
.footer {
|
|
||||||
position: absolute;
|
|
||||||
bottom: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 60px; /* Set the fixed height of the footer here */
|
|
||||||
line-height: 60px; /* Vertically center the text there */
|
|
||||||
}
|
|
||||||
|
|
||||||
nav {
|
nav {
|
||||||
background-color: $black;
|
background-color: $black;
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
"minimum-stability": "stable",
|
"minimum-stability": "stable",
|
||||||
"prefer-stable": true,
|
"prefer-stable": true,
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=8.2",
|
"php": ">=8.3",
|
||||||
"ext-ctype": "*",
|
"ext-ctype": "*",
|
||||||
"ext-iconv": "*",
|
"ext-iconv": "*",
|
||||||
"erusev/parsedown": "^1.7",
|
"erusev/parsedown": "^1.7",
|
||||||
|
473
composer.lock
generated
473
composer.lock
generated
File diff suppressed because it is too large
Load Diff
944
package-lock.json
generated
944
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
10
package.json
10
package.json
@ -14,12 +14,12 @@
|
|||||||
"@babel/core": "^7.23",
|
"@babel/core": "^7.23",
|
||||||
"@babel/preset-env": "^7.23",
|
"@babel/preset-env": "^7.23",
|
||||||
"@babel/plugin-proposal-class-properties": "^7.18",
|
"@babel/plugin-proposal-class-properties": "^7.18",
|
||||||
"@symfony/webpack-encore": "^4.5",
|
"@symfony/webpack-encore": "^4.6",
|
||||||
"core-js": "^3.34",
|
"core-js": "^3.35",
|
||||||
"regenerator-runtime": "^0.14",
|
"regenerator-runtime": "^0.14",
|
||||||
"sass": "^1.69",
|
"sass": "^1.70",
|
||||||
"sass-loader": "^13.3",
|
"sass-loader": "^14.1",
|
||||||
"webpack": "^5.89",
|
"webpack": "^5.90",
|
||||||
"webpack-cli": "^5.1",
|
"webpack-cli": "^5.1",
|
||||||
"webpack-notifier": "^1.15"
|
"webpack-notifier": "^1.15"
|
||||||
},
|
},
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html class="h-100">
|
||||||
<head>
|
<head>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
|
||||||
@ -11,10 +11,10 @@
|
|||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body class="d-flex flex-column h-100">
|
||||||
{% block content %}{% endblock %}
|
{% block content %}{% endblock %}
|
||||||
{% block extrahtml %}{% endblock %}
|
{% block extrahtml %}{% endblock %}
|
||||||
<footer class="footer">
|
<footer class="footer mt-auto py-2">
|
||||||
{% block footer %}{% endblock %}
|
{% block footer %}{% endblock %}
|
||||||
</footer>
|
</footer>
|
||||||
</body>
|
</body>
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
{{ header | raw }}
|
{{ header | raw }}
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
<main>
|
<main class="flex-shrink-0">
|
||||||
<div class="container py-4">
|
<div class="container py-4">
|
||||||
{{ content | raw }}
|
{{ content | raw }}
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user