Compare commits

...

3 Commits

Author SHA1 Message Date
Jeroen De Meerleer d6b87569a6
Update PHP version requirement to 8.3 in composer.json
The PHP version requirement in composer.json has been updated from 8.2 to 8.3. This change ensures compatibility with the latest version of PHP.

Update ca-bundle package to version 1.4.0

The ca-bundle package has been updated from version 1.3.7 to version 1.4.0. This update includes bug fixes and improvements.

Update parsedown package to latest version

The parsedown package has been updated to the latest available version, which is not specified in the code changes.

Update nelmio/security-bundle package to version v3.1.1

The nelmio/security-bundle package has been updated from version v3.1.0 to v3.1.1,
2024-02-07 12:49:46 +01:00
Jeroen De Meerleer 1c38432467
Add Easter Egg functionality to the page.js file
This commit adds an Easter Egg feature to the page.js file. When the document is fully loaded, the initEasterEgg() function is called, which listens for clicks on the body element. If the clicked element is not an interactive element or does not trigger an event, a random hue shift filter is applied to the body and a random string from a predefined list of strings is displayed in a designated HTML element with class "easter-egg". The commit also includes a helper function, isInteractiveElement(), which checks if an element is interactive or triggers an event.
2024-02-07 12:42:38 +01:00
Jeroen De Meerleer c7b7285403
Refactor HTML and SCSS for improved structure and styling
- Removed unnecessary CSS properties from `base.scss`
- Added `class="h-100"` to the `<html>` tag in `base.html.twig` for full height
- Added `class="d-flex flex-column h-100"` to the `<body>` tag in `base.html.twig` for flexbox layout
- Updated footer styling in `base.html.twig` with additional classes
- Added `class="flex-shrink-0"` to the `<main>` tag in `page.html.twig`
2024-02-07 12:40:26 +01:00
8 changed files with 767 additions and 726 deletions

View File

@ -3,6 +3,7 @@ import '/assets/scss/page.scss';
document.addEventListener("readystatechange", event => {
if(event.target.readyState === 'complete') {
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) => {
if(url.startsWith('/')) return false;
return new URL(url).origin !== location.origin;

View File

@ -7,22 +7,10 @@ $orange: #d6972a;
$white: #f0f0f0;
$font: 'Fira Code', monospace;
html {
position: relative;
min-height: 100%;
}
body {
margin-bottom: 60px; /* Margin bottom by footer height */
font-family: 'Mukta', sans-serif;
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 {
background-color: $black;

View File

@ -4,7 +4,7 @@
"minimum-stability": "stable",
"prefer-stable": true,
"require": {
"php": ">=8.2",
"php": ">=8.3",
"ext-ctype": "*",
"ext-iconv": "*",
"erusev/parsedown": "^1.7",

473
composer.lock generated

File diff suppressed because it is too large Load Diff

944
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -14,12 +14,12 @@
"@babel/core": "^7.23",
"@babel/preset-env": "^7.23",
"@babel/plugin-proposal-class-properties": "^7.18",
"@symfony/webpack-encore": "^4.5",
"core-js": "^3.34",
"@symfony/webpack-encore": "^4.6",
"core-js": "^3.35",
"regenerator-runtime": "^0.14",
"sass": "^1.69",
"sass-loader": "^13.3",
"webpack": "^5.89",
"sass": "^1.70",
"sass-loader": "^14.1",
"webpack": "^5.90",
"webpack-cli": "^5.1",
"webpack-notifier": "^1.15"
},

View File

@ -1,5 +1,5 @@
<!DOCTYPE html>
<html>
<html class="h-100">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
@ -11,10 +11,10 @@
</head>
<body>
<body class="d-flex flex-column h-100">
{% block content %}{% endblock %}
{% block extrahtml %}{% endblock %}
<footer class="footer">
<footer class="footer mt-auto py-2">
{% block footer %}{% endblock %}
</footer>
</body>

View File

@ -11,7 +11,7 @@
{{ header | raw }}
</div>
</header>
<main>
<main class="flex-shrink-0">
<div class="container py-4">
{{ content | raw }}
</div>