Files
Personal-Website/script.js
Erik Fehér b6c5c42ef3
All checks were successful
Deploy new version of the application / Deploy Application (push) Successful in 2s
Under construction
2025-10-23 01:53:12 +02:00

36 lines
1.3 KiB
JavaScript

function init() {
const cards = document.getElementsByClassName('card-wrapper');
console.log(cards[0]); // Logs the first card-wrapper elementű
for (let i = 0; i < cards.length; i++) {
cards[i].addEventListener('click', function() {
for (let j = 0; j < cards.length; j++) {
if (j === i) {
cards[j].classList.remove('hidden');
cards[j].classList.add('active');
cards[j].getElementsByClassName('content-wrapper')[0].classList.add('visible');
continue;
}
cards[j].getElementsByClassName('content-wrapper')[0].classList.remove('visible');
cards[j].classList.add('hidden');
cards[j].classList.remove('active');
}
});
}
}
function addInProgress() {
if (window.location.href.indexOf('127.0.0.1') === -1) {
const warning = document.createElement('div');
warning.id = 'under-construction';
warning.innerHTML = "This website is currently under development. Nothing will work as expected. Click anywhere to dismiss this message.";
warning.onclick = function() {
this.style.display = 'none';
};
document.body.appendChild(warning);
}
}
addInProgress();
init();