diff --git a/index.html b/index.html index 846cf93..7236d43 100644 --- a/index.html +++ b/index.html @@ -6,7 +6,45 @@ - - + +
+ + +
+ + + + + + + + - \ No newline at end of file + diff --git a/index.js b/index.js index dd50919..ba74169 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,34 @@ -/* - Изменить элементу цвет и ширину можно вот так: +const openModal = document.getElementById('openModal'); +const modalOverlay = document.getElementById('modalOverlay'); +const closeModal = document.getElementById('closeModal'); +const progressFill = document.getElementById('progressFill'); +const progressText = document.getElementById('progressText'); - const element = document.querySelector('.myElement'); - element.style.color = 'red'; - element.style.width = '300px'; -*/ \ No newline at end of file +openModal.addEventListener('click', () => { + modalOverlay.style.display = 'flex'; + startProgressBar(); +}); + + +closeModal.addEventListener('click', () => { + modalOverlay.style.display = 'none'; + progressFill.style.width = '0%'; + progressText.textContent = 'Loading...'; +}); + +function startProgressBar() { + let width = 0; + const interval = setInterval(() => { + width++; + progressFill.style.width = `${width}%`; + + progressText.style.setProperty('--progress', `${width}%`); + + progressText.textContent = 'Loading...'; + + if (width >= 100) { + clearInterval(interval); + progressText.textContent = 'Complete!'; + } + }, 30); +} diff --git a/styles.css b/styles.css index e69de29..268632f 100644 --- a/styles.css +++ b/styles.css @@ -0,0 +1,119 @@ +body { + font-family: Arial, sans-serif; + margin: 20px; +} + +.logo-container { + display: flex; + gap: 20px; +} + +.logo { + width: 100px; + height: 100px; + object-fit: contain; + overflow: hidden; + border: 1px solid #ccc; +} + +/* Модальное окно */ +.modal-overlay { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: rgba(0,0,0,0.6); + display: none; + justify-content: center; + align-items: center; +} + +.modal { + background: white; + width: 640px; + padding: 20px; + position: relative; + border-radius: 10px; +} + +.close { + position: absolute; + top: 10px; + right: 15px; + font-size: 24px; + border: none; + background: none; + cursor: pointer; +} + +/* Прогресс бар */ +.progress-wrapper { + margin: 20px 0; +} + +.progress-bar { + position: relative; + width: 100%; + height: 30px; + background: #ccc; + border-radius: 5px; + overflow: hidden; +} + +.progress-fill { + background: red; + height: 100%; + width: 0; +} + +.progress-text { + position: absolute; + width: 100%; + height: 100%; + top: 0; + left: 0; + display: flex; + align-items: center; + justify-content: center; + font-weight: bold; + font-size: 16px; + text-align: center; + + background: linear-gradient( + 90deg, + white 0%, + white var(--progress, 0%), + black var(--progress, 0%), + black 100% + ); + -webkit-background-clip: text; + color: transparent; +} + +/* Аккордеон */ +.accordion input { + display: none; +} + +.accordion label { + display: block; + background: #eee; + padding: 10px; + margin-top: 5px; + cursor: pointer; + font-weight: bold; +} + +.accordion .content { + max-height: 0; + overflow: hidden; + transition: max-height 0.3s ease; + background: #f9f9f9; + padding: 0 10px; +} + +.accordion input:checked + label + .content { + max-height: 100px; + padding: 10px; +}