forked from Abrar1212/LOTTIEFILES
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHexagon Loader.html
91 lines (88 loc) · 3.79 KB
/
Hexagon Loader.html
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HEXAGON LOADER</title>
<link rel="stylesheet" href="css/bootstrap.min.css">
<style>
.height-100{
height: 100vh;
padding: 1em;
}
.center-align{
display: flex;
justify-content: center;
align-items: center;
gap: 40px;
}
</style>
</head>
<body id="ContainerBody">
<div class="container-fluid">
<h1 class="display-3 text-center pt-3">Hexagon Loader</h1>
<div class="row row-cols-1 row-cols-lg-2 height-100">
<div class="col d-flex justify-content-center flex-column">
<div >
<label for="exampleColorInput" class="form-label">Background color change</label>
<input type="color" class="form-control form-control-color w-100" onchange="test(this)" id="colourPicker" value="#563d7c" title="Choose your color">
</div>
<div>
<label for="customRange2" class="form-label">Playback speed</label>
<div class="input-group">
<button class="btn btn-primary btn-block w-100" onclick="speed()" id="speedInnerText">1x</button>
</div>
</div>
</div>
<div class="col d-flex justify-content-center flex-column" id="animation">
<div class="d-flex justify-content-center" id="animationChild">
<lottie-player src="first loder.json" background="transparent" speed="1" style="width: 450px; height: 450px;" loop autoplay> </lottie-player>
</div>
</div>
</div>
</div>
<script src="js/lottie-player.js"></script>
<script>
const getElementId = (ID)=>{
return document.getElementById(ID);
}
function test(t) {
getElementId('ContainerBody').style.backgroundColor = (t.value);
}
const Playback = (t) =>{
const count = [0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2];
console.log(t.value);
const a = t.value;
const div = document.createElement('div');
div.classList.add('d-flex', 'justify-content-center');
div.innerHTML =
`
<lottie-player src="first loder.json" background="transparent" speed="${a}" style="width: 450px; height: 450px;" loop autoplay> </lottie-player>
`
const RemoveElementId = getElementId('animation');
RemoveElementId.removeChild(RemoveElementId.firstElementChild);
RemoveElementId.appendChild(div)
console.log(a);
}
let i = 0;
const speed = ()=>{
const count = [0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2];
i++;
if (i > 7) i = 0;
console.log(count[i]);
const div = document.createElement('div');
div.classList.add('d-flex', 'justify-content-center');
div.innerHTML =
`
<lottie-player src="first loder.json" background="transparent" speed="${count[i]}" style="width: 450px; height: 450px;" loop autoplay> </lottie-player>
`
const RemoveElementId = getElementId('animation');
RemoveElementId.removeChild(RemoveElementId.firstElementChild);
RemoveElementId.appendChild(div);
getElementId('speedInnerText').innerHTML = `${count[i]}x`;
}
</script>
<script src="js/bootstrap.bundle.min.js"></script>
</body>
</html>