-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.html
118 lines (118 loc) · 3.66 KB
/
test.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SCADA Data Stream Animation</title>
<style>
body {
margin: 0;
padding: 0;
height: 100vh;
background: #2F4F4F;
overflow: hidden;
display: flex;
justify-content: center;
align-items: center;
font-family: Arial, sans-serif;
color: #fff;
}
.stream {
position: absolute;
width: 100%;
height: 100%;
overflow: hidden;
}
.line {
position: absolute;
width: 2px;
height: 100%;
background: linear-gradient(to bottom, rgba(0, 255, 0, 0), #0f0);
opacity: 0;
animation: moveStreamUp 5s linear infinite, fadeIn 1s forwards;
}
.line.down {
background: linear-gradient(to top, rgba(255, 0, 0, 0), rgb(12, 208, 222));
animation: moveStreamDown 5s linear infinite, fadeIn 1s forwards;
}
@keyframes moveStreamUp {
0% {
transform: translateY(100%);
}
100% {
transform: translateY(-100%);
}
}
@keyframes moveStreamDown {
0% {
transform: translateY(-100%);
}
100% {
transform: translateY(100%);
}
}
@keyframes fadeIn {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
.line:nth-child(1) {
animation-delay: 0s;
}
.line:nth-child(2) {
animation-delay: 6s;
}
.line:nth-child(3) {
animation-delay: 2s;
}
.line:nth-child(4) {
animation-delay: 1s;
}
.line:nth-child(5) {
animation-delay: 4s;
}
.line:nth-child(6) {
animation-delay: 3.5s;
}
.line:nth-child(7) {
animation-delay: 2.5s;
}
.line:nth-child(8) {
animation-delay: 1.5s;
}
.line:nth-child(9) {
animation-delay: 0.3s;
}
</style>
</head>
<body>
<div class="stream">
<div class="line" style="left: 10%;"></div>
<div class="line down" style="left: 20%;"></div>
<div class="line" style="left: 30%;"></div>
<div class="line down" style="left: 40%;"></div>
<div class="line" style="left: 50%;"></div>
<div class="line down" style="left: 60%;"></div>
<div class="line" style="left: 70%;"></div>
<div class="line down" style="left: 80%;"></div>
<div class="line" style="left: 90%;"></div>
</div>
<h1>SCADA Data Stream</h1>
<script>
document.addEventListener('DOMContentLoaded', function () {
const lines = document.querySelectorAll('.line');
lines.forEach((line, index) => {
const randomDuration = Math.random() * 2 +2 ; // Random duration between 5s and 10s
const direction = line.classList.contains('down') ? 'moveStreamDown' : 'moveStreamUp';
const randomLeft = Math.random() * 100; // Random left position between 0% and 100%
line.style.left = `${randomLeft}%`;
line.style.animation = `${direction} ${randomDuration}s linear infinite, fadeIn 1s forwards`;
line.style.animationDelay = `${index}s`; // Staggered start times
});
});
</script>
</body>
</html>