Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 41 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,45 @@
<link rel="stylesheet" href="styles.css">
</head>
<body>
<!--Верстать тут-->
<script src="index.js"></script>
<!-- Логотипы -->
<div class="logo-container">
<img src="designs/logo1.png" class="logo" alt="Logo 1">
<img src="designs/logo5.png" class="logo" alt="Logo 5">
</div>

<!-- Кнопка для открытия модального окна -->
<button id="openModal">Открыть модальное окно</button>

<!-- Модальное окно -->
<div class="modal-overlay" id="modalOverlay">
<div class="modal">
<button class="close" id="closeModal">&times;</button>
<!-- Прогресс бар -->
<div class="progress-wrapper">
<div class="progress-bar">
<div class="progress-fill" id="progressFill"></div>
<div class="progress-text" id="progressText">Loading...</div>
</div>
</div>


<!-- Аккордеон -->
<div class="accordion">
<input type="checkbox" id="acc1">
<label for="acc1">Раздел 1</label>
<div class="content">privet.</div>

<input type="checkbox" id="acc2">
<label for="acc2">Раздел 2</label>
<div class="content">porebrik.</div>

<input type="checkbox" id="acc3">
<label for="acc3">Раздел 3</label>
<div class="content">IDE project settings</div>
</div>
</div>
</div>

<script src="index.js"></script>
</body>
</html>
</html>
39 changes: 33 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
@@ -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';
*/
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);
}
119 changes: 119 additions & 0 deletions styles.css
Original file line number Diff line number Diff line change
@@ -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;
}