-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
42 lines (37 loc) · 1.14 KB
/
Copy pathindex.html
File metadata and controls
42 lines (37 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<link href="/favicon.ico" rel="icon"/>
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
<title>LES LIVRES DE FOU</title>
</head>
<style>
::-webkit-scrollbar {
display: none;
}
</style>
<body class="bg-gray-900">
<div class="scrollbar__indication">
<div class="scrollbar__container">
<div id="sc" class="scrollbar__progress"></div>
</div>
</div>
<div id="app"></div>
<script src="/src/main.js" type="module"></script>
</body>
<script>
window.onscroll = () => {
let pourcentage;
if (document.documentElement.scrollHeight > document.documentElement.clientHeight) {
//Calcule le % de page parcouru
let winScroll = document.body.scrollTop || document.documentElement.scrollTop;
let height = document.documentElement.scrollHeight - document.documentElement.clientHeight;
pourcentage = (winScroll / height) * 100;
} else {
pourcentage = 0;
}
document.getElementById("sc").style.width = pourcentage + "%";
}
</script>
</html>