-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathindex.html
209 lines (173 loc) · 5.17 KB
/
index.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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
<html>
<head>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-77BX2SWDKP"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-PVQYGC47G4');
</script>
<style type="text/css">
html,
body {
margin: 0;
padding: 0;
background: black;
overflow: hidden;
height: 100%;
}
@import url(https://fonts.googleapis.com/css?family=Numans);
.button {
background-color:#d01212;
color:#fff;
font-family: 'Numans', sans-serif;
position: absolute;
top:50%;
left:50%;
transform:translate(-50%,-50%);
padding:20px 40px;
border-radius:1000px;
cursor: pointer;
z-index:1000;
}
.button .w1,.button .w2,.button .w3 {
position: absolute;
top:50%;
transform:translate(-50%,-50%);
width:100%;
height:100%;
background-color:#d01212;
opacity:0;
z-index:-1000;
border-radius:1000px;
transition:opacity 1s;
}
.button .w1 {
transform:translate(-50%,-50%) scale(1);
}
.button .w2 {
transform:translate(-50%,-50%) scale(1.1);
}
.button .w3 {
transform:translate(-50%,-50%) scale(1.2);
transition:opacity 2s;
}
.button .w1, .button .w2, .button .w3 {
opacity:0.4;
}
.button:hover .w1, .button:hover .w2, .button:hover .w3 {
opacity:0.5;
}
.button .w1 {
animation:wave1 1.5s linear infinite;
left: 108px;
}
.button .w2 {
animation:wave2 1.5s linear infinite;
left: 108px;
}
.button .w3 {
animation:wave3 1.5s linear infinite;
left: 108px;
}
@keyframes wave1 {
0% {transform:translate(-50%,-50%) scale(1);}
100% {transform:translate(-50%,-50%) scale(1.1);}
}
@keyframes wave2 {
0% {transform:translate(-50%,-50%) scale(1.1);}
100% {transform:translate(-50%,-50%) scale(1.2);}
}
@keyframes wave3 {
0% {transform:translate(-50%,-50%) scale(1.2);}
100% {transform:translate(-50%,-50%) scale(1.3);opacity:0;}
}
</style>
</head>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r124/three.min.js"></script>
<canvas></canvas>
<a href="https://book.redteamguides.com">
<div style="
position: absolute;
color: white;
top: 41%;
text-align: center;
margin-left: 0px;
" class="button">Red Team Guides<div class="w1"></div><div class="w2"></div><div class="w3"></div></div>
</a>
<script type="text/javascript">
//===================================================== Create a WebGL renderer
var renderer = new THREE.WebGLRenderer({
canvas: document.querySelector("canvas"),
powerPreference: "high-performance"
});
renderer.setSize(window.innerWidth, window.innerHeight);
//===================================================== Create an empty scene
var scene = new THREE.Scene();
//===================================================== Create a perpsective camera
var camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.001, 1000);
camera.position.z = 400;
//===================================================== resize
window.addEventListener("resize", function() {
renderer.setSize(window.innerWidth, window.innerHeight);
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
});
//===================================================== Array of points
var points = [
[68.5,185.5],
[1,262.5],
[270.9,281.9],
[345.5,212.8],
[178,155.7],
[240.3,72.3],
[153.4,0.6],
[52.6,53.3],
[68.5,185.5]
];
//===================================================== Convert the array of points into vertices
for (var i = 0; i < points.length; i++) {
var x = points[i][0];
var y = 0;
var z = points[i][1];
points[i] = new THREE.Vector3(x, y, z);
}
//===================================================== Create a path from the points
var path = new THREE.CatmullRomCurve3(points);
//===================================================== Create the tube geometry from the path
var sides = 3;
var geometry = new THREE.TubeGeometry( path, 300, 4, sides, true );
//===================================================== Basic material
var material = new THREE.MeshBasicMaterial({
side : THREE.BackSide,
map: new THREE.TextureLoader().load('https://raw.githubusercontent.com/redteamguides/redteamguides.github.io/main/map6.png')
});
material.map.wrapS = THREE.RepeatWrapping;
material.map.wrapT= THREE.RepeatWrapping;
material.map.repeat.set(10, 1)
//===================================================== Create a mesh
var tube = new THREE.Mesh( geometry, material );
tube.matrixAutoUpdate = false;//wont be moving so no need to update
scene.add( tube );
//===================================================== Create a point light in our scene
var light = new THREE.PointLight(new THREE.Color("white"),1, 100);
scene.add(light);
//===================================================== Animate
var percentage = 0;
function animate() {
percentage += 0.0005;
var p1 = path.getPointAt(percentage%1);
var p2 = path.getPointAt((percentage + 0.03)%1);
camera.position.set(p1.x,p1.y,p1.z);
camera.lookAt(p2);
light.position.set(p2.x, p2.y, p2.z);
//Render the scene
renderer.render(scene, camera);
requestAnimationFrame(animate);
}
animate();
</script>
</body>
</html>