From 9628bc9666dbd8af3c2df8a9d126bc77c70ec5cb Mon Sep 17 00:00:00 2001 From: Konstantin Kolesnikov Date: Tue, 8 Apr 2025 16:28:23 +0500 Subject: [PATCH] All tasks --- index.html | 90 +++++++++++++++++++++++++++++-- index.js | 53 +++++++++++++++--- styles.css | 154 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 288 insertions(+), 9 deletions(-) diff --git a/index.html b/index.html index 846cf93..fb36269 100644 --- a/index.html +++ b/index.html @@ -6,7 +6,91 @@ - - + + + +
+ +
+ + - \ No newline at end of file + diff --git a/index.js b/index.js index dd50919..e37ec3e 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,48 @@ -/* - Изменить элементу цвет и ширину можно вот так: +document.getElementById("crossButton").addEventListener("click", () => { + document.getElementById("overlay").style.display = "none" +}) + +document.getElementById("closeButton").addEventListener("click", () => { + document.getElementById("overlay").style.display = "none" +}) + +document.getElementById("overlay").addEventListener("click", (e) => { + if (e.target.id === "overlay") { + document.getElementById("overlay").style.display = "none" + } +}) + +document.addEventListener("keydown", (e) => { + if (e.key === "Escape") { + document.getElementById("overlay").style.display = "none" + } +}) + +function animateProgressBar() { + const progressFill = document.querySelector(".progress-fill") + const progressText = document.querySelector(".progress-text") + const duration = 3000 + const startTime = performance.now() + + progressFill.style.width = "0%" + + function updateProgress(currentTime) { + const elapsedTime = currentTime - startTime + + if (elapsedTime < duration) { + const progressPercent = (elapsedTime / duration) * 100 + + progressFill.style.width = `${progressPercent}%` + + requestAnimationFrame(updateProgress) + } else { + progressFill.style.width = "100%" + progressText.textContent = "Loaded✅" + } + } + + requestAnimationFrame(updateProgress) +} + +document.addEventListener("DOMContentLoaded", animateProgressBar) - const element = document.querySelector('.myElement'); - element.style.color = 'red'; - element.style.width = '300px'; -*/ \ No newline at end of file diff --git a/styles.css b/styles.css index e69de29..6aa4ee4 100644 --- a/styles.css +++ b/styles.css @@ -0,0 +1,154 @@ +.logo { + width: 100px; + height: 100px; + overflow: hidden; + margin: 20px; + border: black 5px solid; +} + +.logo img { + width: 100%; + height: auto; +} + +.overlay { + position: fixed; + top: 0; + left: 0; + width: 100vw; + height: 100vh; + background-color: rgba(0, 0, 0, 0.5); + display: flex; + justify-content: center; + align-items: center; + z-index: 1; +} + +.modal { + background: white; + width: 640px; + padding: 20px 30px; + border-radius: 5px; + position: relative; + box-shadow: 0 0 15px rgba(0, 0, 0, 0.3); +} + +.close-button { + position: absolute; + top: 10px; + right: 15px; + background: none; + border: none; + font-size: 24px; + cursor: pointer; +} + +.action-button { + background-color: darkolivegreen; + color: white; + padding: 8px 16px; + border: none; + border-radius: 3px; + cursor: pointer; +} + +.progress-container { + margin: 30px 0; +} + +.progress-bar { + position: relative; + width: 100%; + height: 50px; + background-color: #ccc; + border-radius: 5px; + overflow: hidden; +} + +.progress-fill { + position: absolute; + top: 0; + left: 0; + height: 100%; + background-color: darkslategray; +} + +.progress-text { + position: absolute; + width: 100%; + text-align: center; + top: 50%; + left: 0; + transform: translateY(-50%); + font-size: 24px; + font-weight: bold; + z-index: 2; + mix-blend-mode: difference; + color: white; +} + + + +.accordion { + margin-top: 30px; + width: 100%; +} + +.accordion-item { + margin-bottom: 5px; +} + +.accordion-toggle { + display: none; +} + +.accordion-header { + display: block; + padding: 10px 15px; + background-color: #ccc; + cursor: pointer; + font-weight: bold; + border-radius: 3px; + position: relative; +} + +.accordion-icon { + display: inline-block; + margin-right: 5px; + transition: transform 0.3s; +} + +.accordion-content { + max-height: 0; + overflow: hidden; + transition: max-height 0.3s ease-out; + background-color: #fff; + border: 1px solid #ccc; + border-top: none; + padding: 0 15px; + border-radius: 0 0 3px 3px; +} + +.accordion-toggle:checked ~ .accordion-content { + max-height: 500px; + padding: 15px; +} + +.accordion-toggle:checked ~ .accordion-header .accordion-icon { + transform: rotate(90deg); +} + +.accordion-content p { + margin-top: 0; + line-height: 1.5; +} + +.accordion-content ul { + padding-left: 20px; +} + +.accordion-content li { + margin-bottom: 5px; + color: #333; +} +