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.

39 changes: 38 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,44 @@
<link rel="stylesheet" href="styles.css">
</head>
<body>
<!--Верстать тут-->

<!--#3-->
<div class="modal-overlay">
<div class="progress-wrapper">
<div class="progress-layer progress-bg">
Loading...
</div>
<div class="progress-layer progress-fill">
<div class="text-white-container">
Loading...
</div>
</div>
</div>
</div>

<div class="logo-microsoft">
<div class="ms-red"></div>
<div class="ms-green"></div>
<div class="ms-blue"></div>
<div class="ms-yellow"></div>
</div>
<div class="jp-flag">
<div class="red-circle"></div>
</div>
<button id="open-modal">
Открыть модальное окно
</button>
<div id="overlay"></div>
<div id="window">
<button class="close">
&#x2715;
</button>
<p class="content">
dasdasdasdasdasdasdasdasdasdasdasdasdasdasdasdasdasdasdasdasdasdasdasdasdasdasdas
dasdasdasdasdasdasdsdasdasdasdasdasdasdasdasdasdasdasdasdasdasdasdasdasdasdasdasdas

</p>
</div>
<script src="index.js"></script>
</body>
</html>
39 changes: 38 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,41 @@
const element = document.querySelector('.myElement');
element.style.color = 'red';
element.style.width = '300px';
*/
*/
const progressFill = document.querySelector('.progress-fill');

let currentProgress = 0;
const duration = 3000;
const updateTime = 20;
const steps = duration / updateTime;
const incProcent = 100 / steps;

const timer = setInterval(() => {
currentProgress += incProcent;
progressFill.style.width = `${currentProgress}%`;

if (currentProgress >= 100) {
progressFill.style.width = `100%`;
clearInterval(timer);
}
}, updateTime);

const modal = document.getElementById('window');
const overlay = document.getElementById('overlay');
const btn = document.getElementById('open-modal');
const close = document.querySelector('.close');

btn.onclick = function() {
modal.style.display = 'block';
overlay.style.display = 'block';
};

close.onclick = function() {
modal.style.display = 'none';
overlay.style.display = 'none';
};

overlay.onclick = function() {
modal.style.display = 'none';
overlay.style.display = 'none';
};
119 changes: 119 additions & 0 deletions styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
/*#3*/
.modal-overlay {
display: flex;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: white;
}

.progress-wrapper {
position: relative;
width: 500px;
height: 50px;
font-family: Arial, sans-serif;
font-size: 24px;
}

.progress-layer {
position: absolute;
top: 0;
left: 0;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}

.progress-bg {
width: 100%;
background-color: #434343;
color: #000000;
}

.logo-microsoft {
width: 100px;
height: 100px;
display: grid;
grid-template-columns: 1fr 1fr;
gap: 4px;
padding: 4px;
box-sizing: border-box;
}

.jp-flag {
width: 100px;
height: 100px;
}

.red-circle {
position: relative;
background-color: red;
border-radius: 50%;
width: 30%;
height: 30%;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}

.ms-red {
background-color: #F25022;
}
.ms-green {
background-color: #7FBA00;
}
.ms-blue {
background-color: #00A4EF;
}
.ms-yellow {
background-color: #FFB900;
}

#window {
display: none;
z-index: 1;
width: 640px;
background-color: white;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
border: 1px solid;
}

.close {
display: block;
margin: 5px;
}

.content {
margin: 10px;
}

#overlay {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
z-index: 0;
}

.progress-fill {
width: 70%;
z-index: 2;
background-color: #df0000;
overflow: hidden;
justify-content: flex-start;
}

.text-white-container {
color: white;
width: 500px;
text-align: center;
flex-shrink: 0;
}