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.

8 changes: 8 additions & 0 deletions .idea/modules.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/positioning.iml

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.

25 changes: 24 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,30 @@
<link rel="stylesheet" href="styles.css">
</head>
<body>
<!--Верстать тут-->
<div class="logos">
<div class="logo microsoft">
<div class="square red"></div>
<div class="square green"></div>
<div class="square blue"></div>
<div class="square yellow"></div>
</div>
<div class="logo target">
<div class="circle1"></div>
<div class="circle2"></div>
<div class="circle3"></div>
</div>
</div>
<button class="open-button">Открыть модальное окно</button>
<div class="modal">
<div class="modal-content">
<span class="close-icon">&times;</span>
<p>Это модальное окно!</p>
<div class="progress-bar">
<div class="layer layer-bg">Loading...</div>
<div class="layer layer-fill">
<div class="fill-text">Loading...</div>
</div>
</div>
<script src="index.js"></script>
</body>
</html>
29 changes: 28 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,31 @@
const element = document.querySelector('.myElement');
element.style.color = 'red';
element.style.width = '300px';
*/
*/

const modal = document.querySelector('.modal');
const openButton = document.querySelector('.open-button');
const closeButton = document.querySelector('.close-icon');

openButton.onclick = () => {
modal.style.display = 'flex';
}

closeButton.onclick = () => {
modal.style.display = 'none';
}

const fill = document.querySelector('.layer-fill');
const duration = 3000;
const frames = 100;
const step = duration / frames;
let currentWidth = 0;

const timer = setInterval(() => {
currentWidth++;
fill.style.width = currentWidth + '%';

if (currentWidth >= 100) {
clearInterval(timer);
}
}, step);
128 changes: 128 additions & 0 deletions styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
.logos {
display: flex;
gap: 50px;
margin-bottom: 30px;
}

.logo {
width: 100px;
height: 100px;
}

.microsoft {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 10px;
}

.red { background: #f25022; }
.green { background: #7fba00; }
.blue { background: #00a4ef; }
.yellow { background: #ffb900; }

.target {
position: relative;
display: block;
}

.target div {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
border-radius: 50%;
}

.circle1 {
width: 100px;
height: 100px;
background-color: #e80012;
z-index: 1;
}

.circle2 {
width: 66px;
height: 66px;
background-color: #ffffff;
z-index: 2;
}

.circle3 {
width: 33px;
height: 33px;
background-color: #e80012;
z-index: 3;
}

.modal {
display: none;
position: fixed;
z-index: 1000;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.4);
justify-content: center;
align-items: center;
}

.modal-content {
position: relative;
padding: 20px;
width: 640px;
border: 1px solid #888888;
background-color: #fefefe;
}

.close-icon {
position: absolute;
top: 10px;
right: 15px;
font-size: 28px;
font-weight: bold;
cursor: pointer;
color: #888888;
}

.close-icon:hover, .close-icon:focus {
color: black;
text-decoration: none;
cursor: pointer;
}

.progress-bar {
position: relative;
width: 400px;
height: 40px;
font-family: sans-serif;
font-size: 15px;
line-height: 40px;
text-align: center;
}

.layer {
position: absolute;
top: 0;
left: 0;
height: 100%;
white-space: nowrap;
}

.layer-bg {
width: 100%;
background: #c0c0c0;
color: #000000;
}

.layer-fill {
background: #e80012;
overflow: hidden;
z-index: 1;
}

.fill-text {
width: 400px;
color: #ffffff;
}