added all modified files

This commit is contained in:
freelancer
2024-09-10 01:55:52 +07:00
parent b1afb0f09c
commit 17c7665854
42 changed files with 8437 additions and 218 deletions

View File

38
assets/js/script.js Normal file
View File

@@ -0,0 +1,38 @@
window.addEventListener('load', function () {
const preloader = document.querySelector('#preloader')
preloader.classList.add('hidden')
setTimeout(function () {
preloader.remove()
}, 500)
})
document.addEventListener('DOMContentLoaded', function () {
let modalBg = document.querySelector('#modal__bg')
if (modalBg) {
let modalBtnAll = document.querySelectorAll('.modal__btn')
let modalBtnCloseAll = document.querySelectorAll('.modal__close')
for (const modalBtnItem of modalBtnAll) {
modalBtnItem.addEventListener('click', function (e) {
e.preventDefault()
let modalBtnData = this.dataset.modal
let modalSection = document.querySelector(
'section.modal[data-id=' + modalBtnData + ']'
)
modalBg.classList.add('opened')
modalSection.classList.add('opened')
})
}
modalBg.addEventListener('click', function () {
modalBg.classList.remove('opened')
document.querySelector('section.modal.opened').classList.remove('opened')
})
for (const modalBtnCloseItem of modalBtnCloseAll) {
modalBtnCloseItem.addEventListener('click', function () {
modalBg.classList.remove('opened')
document
.querySelector('section.modal.opened')
.classList.remove('opened')
})
}
}
})