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
13 changes: 12 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,18 @@
<link rel="stylesheet" href="styles.css">
</head>
<body>
<!--Верстать тут-->
<img src="designs/logo3.jpg">
<img src="designs/logo7.png">
<div class="lightbox">
<div class="lightcontent">
<button class="lightbutton">×</button>
<p>Содержимое модального окна</p>
<div class="progress">
<div class="grey">Loading...</div>
<div class="red">Loading...</div>
</div>
</div>
</div>
<script src="index.js"></script>
</body>
</html>
14 changes: 8 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
/*
Изменить элементу цвет и ширину можно вот так:
const element = document.querySelector('.red');

const element = document.querySelector('.myElement');
element.style.color = 'red';
element.style.width = '300px';
*/
let a = 100;
let fps = 60;
let b = setInterval(() => {
element.style.clipPath = "inset(0 " + Math.min(100, a) + "% 0 0)"
a -= 100 / fps / 3;
}, 1000 / fps);
setTimeout(() => clearInterval(b), 3000);
59 changes: 59 additions & 0 deletions styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
img {
width: 100px;
height: 100px;
}

.lightbox {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
}

.lightcontent {
width: 640px;
background: white;
position: relative;
padding: 20px;
}

.lightbutton {
position: absolute;
top: 10px;
right: 10px;
background: none;
border: none;
font-size: 20px;
cursor: pointer;
}

.progress {
background-color: grey;
width: 640px;
height: 20px;
position: relative;
}

.grey {
position: absolute;
width: 100%;
text-align: center;
z-index: 1;
color: black;
}

.red {
text-align: center;
position: absolute;
background-color: red;
clip-path: inset(0 0% 0 0);;
height: 100%;
z-index: 2;
width: 100%;
color: white;
}