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
55 changes: 52 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,56 @@
<link rel="stylesheet" href="styles.css">
</head>
<body>
<!--Верстать тут-->
<script src="index.js"></script>

<div class="circle-container">
<div class="circle"></div>
</div>

<div class="logo-container">
<img src="designs/logo1.png" class="logo" alt="Лого1">
<img src="designs/logo2.png" class="logo" alt="Лого2">
</div>

<div class="lightbox-overlay">
<div class="lightbox">
<h1>Ave Maria!</h1>
<p>Deus Vult!</p>

<div class="progress-bar">
<div class="progress-fill"></div>
<div class="progress-text-fill">Loading...</div>
<div class="progress-text">Loading...</div>
</div>


<div class="accordion">
<input type="checkbox" id="acc1">
<label for="acc1">Блок 1</label>
<div class="accordion-content">
<p>Служба Яндекс.Рефераты предназначена для студентов и школьников, дизайнеров и журналистов, создателей научных заявок и отчетов — для всех, кто относится к тексту, как к количеству знаков.
Нажав на кнопку «Написать реферат», вы лично создаете уникальный текст, причем именно от вашего нажатия на кнопку зависит, какой именно текст получится — таким образом, авторские права на реферат принадлежат только вам.
Теперь никто не сможет обвинить вас в плагиате, ибо каждый текст Яндекс.Рефератов неповторим.
Текстами рефератов можно пользоваться совершенно бесплатно, однако при транслировании и предоставлении текстов в массовое пользование ссылка на Яндекс.Рефераты обязательна.</p>
</div>

<input type="checkbox" id="acc2">
<label for="acc2">Блок 2</label>
<div class="accordion-content">
<p>В.</p>
</div>

<input type="checkbox" id="acc3">
<label for="acc3">Блок 3</label>
<div class="accordion-content">
<p>Третий блок!</p>
</div>
</div>

<button class="lightbox-button" onclick=closeModalWindow()>Закрыть</button>
<button class="lightbox-close" onclick=closeModalWindow()>x</button>
</div>
</div>

<script src="index.js"></script>
</body>
</html>
</html>
31 changes: 25 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,26 @@
/*
Изменить элементу цвет и ширину можно вот так:
const progress = document.querySelector('.progress-fill');
const progress_text = document.querySelector('.progress-text-fill');
let width = 0;

const element = document.querySelector('.myElement');
element.style.color = 'red';
element.style.width = '300px';
*/
const interval = setInterval(() => {
width += 1;
progress.style.width = width + '%';
if (width >= 100) {
clearInterval(interval);
}
}, 30);

function modifyModalWindow(visibility){
const window = document.querySelector(".lightbox");
window.style.visibility = visibility;
const overlay = document.querySelector(".lightbox-overlay");
overlay.style.visibility = visibility;
}

function closeModalWindow(){
modifyModalWindow("hidden");
}

function openModalWindow(){
modifyModalWindow("visible");
}
131 changes: 131 additions & 0 deletions styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
body {
margin: 0;
padding: 0;
}

.circle-container {
padding: 30px;
display: inline-block;
}

.circle {
height: 40px;
width: 40px;
border-radius: 50%;
background: red;
}

.logo-container {
display: flex;
gap: 10px;
margin: 20px;
}

.logo {
width: 100px;
height: 100px;
object-fit: contain;
}

.lightbox-overlay {
position: fixed;
top: 0;
height: 100%;
width: 100%;
background: rgba(217, 217, 217, 0.5);
}

.lightbox {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
padding: 30px;
width: 640px;
background: #d9d9d9;
}

.lightbox-close {
position: absolute;
top: 15px;
right: 15px;
background: none;
border: none;
font-size: 18px;
cursor: pointer;
}

.lightbox-button {
margin-top: 20px;
padding: 10px 20px;
background: red;
border: none;
}

.progress-bar {
position: relative;
width: 100%;
height: 30px;
background-color: white;
border-radius: 5px;
margin: 20px 0;
overflow: hidden;
}

.progress-fill {
height: 100%;
width: 0;
background-color: red;
position: absolute;
top: 0;
left: 0;
transition: width 1s linear;
z-index: 1;
}

.progress-text,
.progress-text-fill {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
font-weight: bold;
display: flex;
align-items: center;
justify-content: center;
mix-blend-mode: difference;
}

.progress-text {
color: black;
}

.progress-text-fill {
color: white;
z-index: 2;
}

.accordion input {
display: none;
}

.accordion label {
display: block;
padding: 10px;
background: #aaa;
border-top: 1px solid #888;
}

.accordion-content {
max-height: 0;
overflow: scroll;
transition: max-height 0.3s ease;
background: #eee;
padding: 0 10px;
}

.accordion input:checked + label + .accordion-content {
max-height: 100px;
padding: 10px;
}