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
10 changes: 10 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/indexLayout.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/projectSettingsUpdater.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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

<div class="logo4">
<div class="outer-circle">
<div class="inner-white-part">
<div class="center-circle"></div>
</div>
</div>
</div>
<button id="ModalOpenBtn">Открыть модальное окно</button>

<div id="blur" class="blur">
<div id="modal1" class="modal_window">
<button class="cross" id="modal1_cross">×</button>
<p>Контееент, чувааааааак 💀👻</p>

<div class="progress-bar">
<div class="progress-fill" id="fill"></div>
<div class="progress-text">
<div class="text-black">Loading...</div>
<div class="text-white" id="whiteText">Loading...</div>
</div>
</div>

<div class="accordion">
<div class="accordion-item">
<input type="radio" name="accordion-radio" id="item-1" class="accordion-input">
<label for="item-1" class="accordion-header">Раздел 1</label>
<div class="accordion-content">
<p>Содержимое первого раскрывающегося блока. Здесь может быть любой текст, который должен появляться при клике.</p>
</div>
</div>
<div class="accordion-item">
<input type="radio" name="accordion-radio" id="item-2" class="accordion-input">
<label for="item-2" class="accordion-header">Раздел 2</label>
<div class="accordion-content">
<p>Текст для второго раздела. CSS-свойство :checked позволяет отслеживать выбор этого элемента и применять стили к соседним элементам.</p>
</div>
</div>
<div class="accordion-item">
<input type="radio" name="accordion-radio" id="item-3" class="accordion-input">
<label for="item-3" class="accordion-header">Раздел 3</label>
<div class="accordion-content">
<p>Третий блок с контентом. Использование radio-кнопок с одинаковым именем позволяет открывать только один блок за раз.</p>
</div>
</div>
</div>
</div>
</div>
<div class="logo5">
<div class="block1"></div>
<div class="block2"></div>
<div class="block3"></div>
<div class="block4"></div>
</div>

<script src="index.js"></script>
</body>
</html>
</html>
49 changes: 43 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,44 @@
/*
Изменить элементу цвет и ширину можно вот так:
const btnClk = document.getElementById("ModalOpenBtn");
btnClk.addEventListener("click", () => {
startLoading();
const bluer = document.getElementById("blur");
bluer.style.display = "block";
})

const element = document.querySelector('.myElement');
element.style.color = 'red';
element.style.width = '300px';
*/
const btnCross = document.getElementById("modal1_cross");
btnCross.addEventListener("click", () => {
const bluer = document.getElementById("blur");
bluer.style.display = "none";
})
const blocks = document.querySelectorAll('.logo5 .block');
document.querySelector('.logo5 .block1').style.backgroundColor = 'red';
document.querySelector('.logo5 .block2').style.backgroundColor = 'greenyellow';
document.querySelector('.logo5 .block3').style.backgroundColor = 'deepskyblue';
document.querySelector('.logo5 .block4').style.backgroundColor = 'yellow';


function startLoading() {
const fill = document.getElementById("fill");
const whiteText = document.getElementById("whiteText");
const duration = 3000;
const frames = 100;
const intervalTime = duration / frames;

let progress = 0;

function setProgress(value) {
fill.style.width = value + "%";
const clipValue = 100 - value;
whiteText.style.clipPath = `inset(0 ${clipValue}% 0 0)`;
}

const interval = setInterval(() => {
progress++;
if (progress <= 100) {
setProgress(progress);
}
if (progress >= 100) {
clearInterval(interval);
}
}, intervalTime);
}
194 changes: 194 additions & 0 deletions styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
.logo4 {
display: flex;
justify-content: center;
box-sizing: border-box;
position: absolute;
top: 50px;
left: 300px;
}

.logo4 .outer-circle {
display: flex;
justify-content: center;
height: 100px;
width: 100px;
background-color: crimson;
border-radius: 50%;
align-items: center;
}

.logo4 .inner-white-part {
display: flex;
justify-content: center;
height: 70px;
width: 70px;
background-color: whitesmoke;
border-radius: 50%;
align-items: center;
}

.logo4 .center-circle {
height: 40px;
width: 40px;
background-color: crimson;
border-radius: 50%;
align-items: center;
}

.modal_window {
display: flex;
flex-direction: column;
position: fixed;
z-index: 100000;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
border: 2px solid black;
background-color: white;
width: 640px;
height: min-content;
padding: 20px;
}
.modal_window p {
font-size: 25px;
}
.cross{
position: absolute;
border: none;
padding: 0;
background-color: transparent;
top: 1px;
right: 1px;
width: 1em;
font-size: 15px;
}
.blur {
display: none;
position: fixed;
top: 0;
left: 0;
z-index: 99999;
box-sizing: border-box;
width: 100vw;
min-height: 100vh;
background-color: rgba(0, 0, 0, 0.5);
backdrop-filter: blur(10px);
}
.logo5 {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 2px;
width: 100px;
position: absolute;
top: 50px;
left: 150px;
}

.logo5 .block1,
.logo5 .block2,
.logo5 .block3,
.logo5 .block4 {
height: 48px;
}

.modal {
position: fixed;
inset: 0;
background: rgba(0,0,0,0.5);
display: flex;
justify-content: center;
align-items: center;
padding: 20px;
}

.modal-content-wrapper {
background-color: white;
padding: 30px;
border-radius: 10px;
width: 100%;
max-width: 500px;
}

.progress-bar {
position: relative;
width: 100%;
height: 40px;
background: #ccc;
border-radius: 20px;
overflow: hidden;
margin-bottom: 20px;
}

.progress-fill {
position: absolute;
height: 100%;
width: 0;
background: #e31837;
transition: width 0.1s linear;
}

.progress-text {
position: absolute;
inset: 0;
display: flex;
justify-content: center;
align-items: center;
font-weight: bold;
}

.text-black {
color: black;
position: absolute;
}

.text-white {
color: white;
position: absolute;
clip-path: inset(0 100% 0 0);
transition: clip-path 0.1s linear;
}


.accordion {
width: 100%;
font-family: Arial, sans-serif;
border-top: 1px solid #ccc;
}

.accordion-item {
border-bottom: 1px solid #ccc;
}

.accordion-input {
display: none;
}

.accordion-header {
display: block;
padding: 15px;
background-color: #f0f0f0;
cursor: pointer;
font-weight: bold;
transition: background-color 0.3s ease;
}

.accordion-header:hover {
background-color: #e0e0e0;
}

.accordion-content {
max-height: 0;
overflow: hidden;
background-color: #fafafa;
padding: 0 15px;
transition: max-height 0.4s ease-out, padding 0.4s ease-out;
}

.accordion-input:checked + .accordion-header {
background-color: #ddd;
}

.accordion-input:checked ~ .accordion-content {
max-height: 200px;
padding: 15px;
}