Dmtlant commited on
Commit
5315a8d
·
verified ·
1 Parent(s): 8bb606b

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +109 -18
index.html CHANGED
@@ -1,19 +1,110 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  </html>
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <title>NeuroFractal Vision</title>
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <style>
8
+ html, body {
9
+ margin: 0; padding: 0;
10
+ background: black;
11
+ overflow: hidden;
12
+ font-family: monospace;
13
+ }
14
+ #hydra-canvas {
15
+ position: absolute;
16
+ top: 0; left: 0;
17
+ width: 100vw;
18
+ height: 100vh;
19
+ image-rendering: pixelated;
20
+ z-index: 0;
21
+ }
22
+ #terminal {
23
+ position: absolute;
24
+ bottom: 0;
25
+ width: 100%;
26
+ height: 200px;
27
+ background: rgba(0,0,0,0.75);
28
+ color: white;
29
+ border: none;
30
+ padding: 10px;
31
+ resize: none;
32
+ font-size: 14px;
33
+ line-height: 1.4;
34
+ z-index: 2;
35
+ }
36
+ #btns {
37
+ position: absolute;
38
+ top: 10px;
39
+ left: 10px;
40
+ z-index: 3;
41
+ }
42
+ button {
43
+ background: #222;
44
+ color: white;
45
+ border: 1px solid #555;
46
+ padding: 6px 10px;
47
+ margin-right: 5px;
48
+ font-size: 12px;
49
+ cursor: pointer;
50
+ }
51
+ </style>
52
+ </head>
53
+ <body>
54
+ <canvas id="hydra-canvas"></canvas>
55
+
56
+ <div id="btns">
57
+ <button onclick="terminal.style.display = terminal.style.display === 'none' ? 'block' : 'none'">🧠 Открыть терминал</button>
58
+ <button onclick="eval(terminal.value)">▶️ Запуск кода</button>
59
+ <button onclick="insertDream()">💤 Нейросон</button>
60
+ </div>
61
+
62
+ <textarea id="terminal" spellcheck="false" style="display:none"></textarea>
63
+
64
+ <script src="https://unpkg.com/hydra-synth"></script>
65
+ <script>
66
+ const canvas = document.getElementById("hydra-canvas");
67
+ canvas.width = window.innerWidth * window.devicePixelRatio;
68
+ canvas.height = window.innerHeight * window.devicePixelRatio;
69
+
70
+ const hydra = new Hydra({
71
+ detectAudio: false,
72
+ canvas: canvas,
73
+ width: canvas.width,
74
+ height: canvas.height,
75
+ pixelRatio: window.devicePixelRatio
76
+ });
77
+
78
+ // Запрашиваем видео и аудио
79
+ navigator.mediaDevices.getUserMedia({ video: true, audio: true })
80
+ .then(stream => {
81
+ const video = document.createElement("video");
82
+ video.srcObject = stream;
83
+ video.autoplay = true;
84
+ video.muted = true;
85
+ video.onloadedmetadata = () => {
86
+ s0.init({ src: video });
87
+ };
88
+ });
89
+
90
+ // Основной нейро-фрактальный сон
91
+ function insertDream() {
92
+ terminal.value = `src(s0)
93
+ .modulate(voronoi(9, 0.2, 0.8).scale(1.4), 0.1)
94
+ .add(
95
+ osc(4, 0.1, 0.3)
96
+ .color(0.2, 0.7, 1)
97
+ .modulate(noise(3), 0.05)
98
+ .scale(() => 0.9 + 0.1 * Math.sin(time * 0.5))
99
+ )
100
+ .blend(src(o0), 0.5)
101
+ .out()`;
102
+ eval(terminal.value);
103
+ terminal.style.display = 'block';
104
+ }
105
+
106
+ insertDream();
107
+ </script>
108
+ </body>
109
  </html>
110
+