-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Stresstest.html
81 lines (75 loc) · 2.4 KB
/
Stresstest.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Browser Challenge</title>
<style>
/* Complex Grid Layout */
body {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
gap: 10px;
margin: 0;
height: 100vh;
overflow: auto;
}
/* Animations and Transitions */
div {
transition: all 0.5s ease;
}
/* 3D Transformations */
canvas {
transform: perspective(600px) rotateY(45deg) rotateX(45deg);
width: 100%;
height: 300px;
}
</style>
</head>
<body>
<div id="dynamic-content"></div>
<canvas id="graphics-canvas"></canvas>
<script>
// Heavy DOM Manipulations
function changeDOM() {
const content = document.getElementById('dynamic-content');
for (let i = 0; i < 100; i++) {
const div = document.createElement('div');
div.innerText = 'New Element ' + i;
content.appendChild(div);
}
}
setInterval(changeDOM, 1000);
// Intensive JavaScript Computations
function heavyComputation() {
function fibonacci(num) {
if (num <= 1) return 1;
return fibonacci(num - 1) + fibonacci(num - 2);
}
console.log(fibonacci(30));
}
setInterval(heavyComputation, 2000);
// High-Quality Graphics Rendering
function renderGraphics() {
const canvas = document.getElementById('graphics-canvas');
if (canvas.getContext) {
const ctx = canvas.getContext('2d');
ctx.clearRect(0, 0, canvas.width, canvas.height); // Clear previous drawing
ctx.beginPath();
ctx.arc(95, 50, 40, 0, 2 * Math.PI);
ctx.stroke();
}
}
setInterval(renderGraphics, 100);
// Network Stress Test
function loadImages() {
for (let i = 0; i < 50; i++) {
const img = new Image();
img.src = 'https://placekitten.com/200/300?image=' + i;
document.body.appendChild(img);
}
}
loadImages();
</script>
</body>
</html>