Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ФТ202 Атучин Афанасьев #139

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
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
5 changes: 5 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.

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

18 changes: 18 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,24 @@
</head>
<body>
<!--Верстать тут-->
<div class="content">
<div class="modal" id="myModal">
<div class="modal-content">
<span class="close">&times;</span>
<p>Модальное окно...</p>

<div class="bar">
<div class="progress"></div>
</div>

</div>
</div>
</div>
<div class="logo"><img src="designs/logo2.png" alt="bbc" ></div>
<div class="logo"><img src="designs/logo1.png" alt="bbc" ></div>



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


const modal = document.getElementById("myModal");
const closeBtn = document.querySelector(".close");

closeBtn.onclick = function() {
modal.style.display = "none";
}

const progressBar = document.querySelector('.progress');

function fillProgressBar(duration) {
let startTime = null;

function animate(timestamp) {
if (!startTime) {
startTime = timestamp;
}
const progress = timestamp - startTime;
const percentage = Math.min(progress / duration * 100, 100);
progressBar.style.width = percentage + '%';

if (progress < duration) {
requestAnimationFrame(animate);
}
}
requestAnimationFrame(animate);
}

fillProgressBar(3000);
77 changes: 77 additions & 0 deletions styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
.modal {
display: flex;
justify-content: center;
align-items: center;
position: fixed;
z-index: 1;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(0,0,0,0.5);

}

.modal-content {
background-color: #fefefe;
margin: 15% auto;
padding: 20px;
border: 1px solid #888;
width: 640px;
height: auto;
}

.close {
color: #aaa;
float: right;
font-size: 28px;
font-weight: bold;
}

.close:hover,
.close:focus {
color: black;
cursor: pointer;
}.logo {
width: 100px;
height: 100px;
overflow: hidden;
margin: 10px;
border: blue 5px solid;
}

.logo img {
width: 100%;
height: auto;
}



.bar {
background-color: gray;
width: 100%;
height: 30px;
position: relative;
}

.bar::before, .progress::before {
content: "Loading...";
font-size: 25px;
color: white;
position: absolute;
left: 325px;
top: 15px;
transform: translate(-50%, -50%);
}

.bar::before {
color: black;
}

.progress {
position: absolute;
font-size: 24px;
background-color: red;
height: 100%;
overflow: hidden;
}