-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsharp.html
More file actions
351 lines (304 loc) · 11.5 KB
/
sharp.html
File metadata and controls
351 lines (304 loc) · 11.5 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
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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="manifest" href="manifest.json">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover">
<title>Liquid Zen</title>
<style>
* {
-webkit-tap-highlight-color: transparent;
touch-action: pan-y !important;
user-select: none !important;
-webkit-user-select: none;
}
body, html {
margin: 0; padding: 0; width: 100%;
min-height: 100%;
background: #000;
overflow-x: hidden;
overflow-y: auto !important;
}
canvas {
display: block; width: 100%; height: 100%;
position: fixed; top: 0; left: 0; z-index: 0;
}
.ui-wrapper {
position: relative;
z-index: 10;
display: flex;
flex-direction: column;
align-items: center;
min-height: 100vh;
pointer-events: none;
}
.ui-wrapper > div,
.ui-wrapper > footer,
.ui-wrapper > header {
pointer-events: auto;
}
header {
width: 100%;
text-align: center;
padding-top: 20px;
background: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, transparent 100%);
}
.bottom-ui {
margin-top: auto;
padding: 50px 0 30px 0;
display: flex;
flex-direction: column;
align-items: center;
gap: 30px;
width: 100%;
}
.menu-links {
display: flex;
gap: 20px;
font-family: sans-serif;
}
.menu-links a {
color: #fff;
text-decoration: none;
transition: opacity 0.3s;
}
footer {
width: 100%;
display: flex;
justify-content: center;
}
.donate-box {
display: flex;
flex-direction: column;
align-items: center;
}
.donate-btn {
color: #fff;
border: 1px solid #fff;
padding: 5px 15px;
background: transparent;
cursor: pointer;
font-family: sans-serif;
font-size: 12px;
transition: 0.3s;
}
.donate-btn:hover {
background: #fff;
color: #000;
}
.crypto-info {
display: none;
flex-direction: column;
align-items: center;
gap: 5px;
margin-top: 15px;
background: rgba(0,0,0,0.85);
padding: 10px;
border-radius: 5px;
box-shadow: 0 0 15px rgba(0,0,0,0.5);
}
.crypto-address-display {
font-size: 8px;
color: #fff;
background: #111;
padding: 8px 12px;
border: 1px dashed #fff;
cursor: copy;
word-break: break-all;
max-width: 240px;
font-family: monospace;
}
</style>
</head>
<body oncontextmenu="return false;">
<script src="pwa-init.js"></script>
<script src="https://unpkg.com/three@0.128.0/build/three.min.js"></script>
<div class="ui-wrapper">
<div style="width: 100%; text-align: center; padding-top: 20px; background: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, transparent 100%);">
<a href="index.html" style="display: inline-block; width: 48px; margin-bottom: 10px;">
<img src="logo.png" alt="Logo" style="width: 100%; height: auto;">
</a>
<h1 style="color: #fff; font-family: sans-serif; margin: 0; font-size: 24px; letter-spacing: 1px;">Liquid Zen</h1>
<p style="color: rgba(255,255,255,0.6); font-family: sans-serif; margin: 5px 0 0 0; font-size: 10px; text-transform: uppercase; letter-spacing: 4px;">Droplet Lab</p>
</div>
<div class="bottom-ui">
<div style="display: flex; gap: 20px; font-family: sans-serif;">
<a href="drop.html" style="color: #fff; text-decoration: none; opacity: 0.6;">Drop</a>
<a href="blob.html" style="color: #fff; text-decoration: none; opacity: 0.6;">Blob</a>
<a href="sharp.html" style="color: #fff; text-decoration: none; font-weight: bold; opacity: 1;">Sharp</a>
<a href="wave.html" style="color: #fff; text-decoration: none; opacity: 0.6;">Wave</a>
<a href="ray.html" style="color: #fff; text-decoration: none; opacity: 0.6;">Ray</a>
</div>
<footer>
<div class="donate-box">
<button class="donate-btn" onclick="toggleDonate()">Support</button>
<div id="cryptoInfo" class="crypto-info">
<span style="font-size: 10px; color: #fff; margin-bottom: 4px;">USDT BSC (BEP20)</span>
<div id="cryptoAddr" class="crypto-address-display" onclick="copyToClipboard()">0x769192cea8fbb7207f086d95fd653ebc3adb0c72</div>
<span id="copyHint" style="font-size: 9px; color: #fff; margin-top: 4px;">Click address to copy</span>
</div>
</div>
</footer>
</div>
</div>
<script src="https://unpkg.com/three@0.128.0/build/three.min.js"></script>
<script>
let scene, camera, renderer, mainGroup, droplets = [];
let isDragging = false, prevTouchDist = null, lastMousePos = { x: 0, y: 0 };
const raycaster = new THREE.Raycaster();
const mouse = new THREE.Vector2();
const v = new THREE.Vector3();
const ballCenter = new THREE.Vector3();
const tempV = new THREE.Vector3();
const geo = new THREE.IcosahedronGeometry(0.8, 64);
const originalPos = geo.attributes.position.array.slice();
const mat = new THREE.MeshPhysicalMaterial({
color: 0x3399ff,
metalness: 0.2,
roughness: 0.1,
transmission: 0.7,
transparent: true
});
function createDroplet(x, y, z) {
const g = geo.clone();
const drop = new THREE.Mesh(g, mat);
drop.position.set(x, y, z);
drop.userData = { hits: [], base: originalPos.slice() };
mainGroup.add(drop);
droplets.push(drop);
}
function init() {
scene = new THREE.Scene();
camera = new THREE.PerspectiveCamera(75, window.innerWidth/window.innerHeight, 0.1, 1000);
camera.position.z = 4;
renderer = new THREE.WebGLRenderer({ antialias: true, alpha: true });
renderer.setSize(window.innerWidth, window.innerHeight);
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
document.body.appendChild(renderer.domElement);
mainGroup = new THREE.Group();
scene.add(mainGroup);
scene.add(new THREE.AmbientLight(0xffffff, 0.8));
const p1 = new THREE.PointLight(0xff0000, 10); p1.position.set(5, 5, 5); scene.add(p1);
const p2 = new THREE.PointLight(0x00ff00, 10); p2.position.set(-5, 5, 5); scene.add(p2);
createDroplet(0, 0, 0);
const handleInput = (x, y) => {
mouse.x = (x / window.innerWidth) * 2 - 1;
mouse.y = -(y / window.innerHeight) * 2 + 1;
raycaster.setFromCamera(mouse, camera);
const intersects = raycaster.intersectObjects(droplets);
if (intersects.length > 0) {
const hit = intersects[0];
const ud = hit.object.userData;
const localPoint = hit.object.worldToLocal(hit.point.clone());
ud.hits.push({
pos: localPoint,
strength: 1.5,
active: true
});
}
};
const canvas = renderer.domElement;
canvas.addEventListener('touchstart', (e) => {
e.preventDefault(); isDragging = true;
const t = e.touches[0]; lastMousePos = { x: t.clientX, y: t.clientY };
handleInput(t.clientX, t.clientY);
}, { passive: false });
canvas.addEventListener('touchmove', (e) => {
e.preventDefault();
if (!isDragging) return;
if (e.touches.length === 1) {
const t = e.touches[0];
mainGroup.rotation.y += (t.clientX - lastMousePos.x) * 0.005;
mainGroup.rotation.x += (t.clientY - lastMousePos.y) * 0.005;
lastMousePos = { x: t.clientX, y: t.clientY };
} else if (e.touches.length === 2) {
const d = Math.hypot(e.touches[0].clientX - e.touches[1].clientX, e.touches[0].clientY - e.touches[1].clientY);
if (prevTouchDist) camera.position.z = Math.max(1.5, Math.min(10, camera.position.z - (d - prevTouchDist) * 0.01));
prevTouchDist = d;
}
}, { passive: false });
canvas.addEventListener('touchend', () => { isDragging = false; prevTouchDist = null; });
// Мышь
canvas.addEventListener('mousedown', (e) => {
isDragging = true;
lastMousePos = { x: e.clientX, y: e.clientY };
handleInput(e.clientX, e.clientY);
});
window.addEventListener('mousemove', (e) => {
if (!isDragging) return;
mainGroup.rotation.y += (e.clientX - lastMousePos.x) * 0.005;
mainGroup.rotation.x += (e.clientY - lastMousePos.y) * 0.005;
lastMousePos = { x: e.clientX, y: e.clientY };
});
window.addEventListener('mouseup', () => { isDragging = false; });
canvas.addEventListener('wheel', (e) => {
camera.position.z = Math.max(1.5, Math.min(10, camera.position.z + e.deltaY * 0.005));
}, { passive: true });
window.addEventListener('resize', () => {
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
renderer.setSize(window.innerWidth, window.innerHeight);
});
animate();
}
function animate() {
requestAnimationFrame(animate);
const time = performance.now() * 0.0005;
droplets.forEach(drop => {
const pos = drop.geometry.getAttribute('position');
const ud = drop.userData;
ud.hits = ud.hits.filter(h => h.strength > 0.001);
for (let i = 0; i < pos.count; i++) {
v.set(ud.base[i*3], ud.base[i*3+1], ud.base[i*3+2]);
ud.hits.forEach(hit => {
const r = 0.22;
ballCenter.copy(hit.pos).normalize().multiplyScalar(0.8 + hit.strength);
const distToBall = v.distanceTo(ballCenter);
if (distToBall < r) {
tempV.copy(v).sub(ballCenter).normalize().multiplyScalar(r);
v.copy(ballCenter).add(tempV);
} else {
const distToRoot = v.distanceTo(hit.pos);
const influenceRadius = 0.4;
if (distToRoot < influenceRadius) {
const pull = Math.pow(1 - (distToRoot / influenceRadius), 2);
v.lerp(ballCenter, pull * 0.8);
}
}
});
v.multiplyScalar(1 + Math.sin(v.x * 8 + time) * 0.005);
pos.setXYZ(i, v.x, v.y, v.z);
}
ud.hits.forEach(h => { h.strength *= 0.985; });
pos.needsUpdate = true;
drop.geometry.computeVertexNormals();
});
renderer.render(scene, camera);
}
init();
function toggleDonate() {
const info = document.getElementById("cryptoInfo");
const isOpening = info.style.display !== "flex";
info.style.display = isOpening ? "flex" : "none";
if (isOpening) {
setTimeout(() => info.scrollIntoView({ behavior: 'smooth', block: 'nearest' }), 50);
}
}
function copyToClipboard() {
const addr = document.getElementById("cryptoAddr");
const hint = document.getElementById("copyHint");
const text = addr.innerText;
navigator.clipboard.writeText(text).then(() => {
addr.innerText = "Copied!";
addr.style.color = "#00ff00";
if (hint) hint.innerText = "Address saved to clipboard";
setTimeout(() => {
addr.innerText = text;
addr.style.color = "#fff";
if (hint) hint.innerText = "Click address to copy";
}, 1500);
});
}
</script>
</body>
</html>