Spaces:
Running
Running
Update index.html
Browse files- index.html +317 -67
index.html
CHANGED
|
@@ -3,121 +3,169 @@
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8" />
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
| 6 |
-
|
| 7 |
<title>Dot Labs</title>
|
| 8 |
-
|
| 9 |
<style>
|
| 10 |
-
* {
|
| 11 |
-
box-sizing: border-box;
|
| 12 |
-
}
|
| 13 |
-
|
| 14 |
body {
|
| 15 |
margin: 0;
|
| 16 |
min-height: 100vh;
|
| 17 |
-
|
| 18 |
display: grid;
|
| 19 |
place-items: center;
|
| 20 |
-
|
| 21 |
padding: 24px;
|
| 22 |
-
|
| 23 |
background: #000;
|
| 24 |
color: #f5f5f7;
|
| 25 |
-
|
| 26 |
-
font-family:
|
| 27 |
-
-apple-system,
|
| 28 |
-
BlinkMacSystemFont,
|
| 29 |
-
"Helvetica Neue",
|
| 30 |
-
sans-serif;
|
| 31 |
-
|
| 32 |
-webkit-font-smoothing: antialiased;
|
| 33 |
}
|
| 34 |
-
|
| 35 |
.card {
|
|
|
|
|
|
|
|
|
|
| 36 |
width: min(100%, 720px);
|
| 37 |
min-height: 480px;
|
| 38 |
-
|
| 39 |
padding: clamp(32px, 7vw, 64px);
|
| 40 |
-
|
| 41 |
display: flex;
|
| 42 |
flex-direction: column;
|
| 43 |
justify-content: space-between;
|
| 44 |
-
|
| 45 |
-
background: #080808;
|
| 46 |
-
|
| 47 |
border: 1px solid #1c1c1e;
|
| 48 |
border-radius: 28px;
|
| 49 |
}
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
max-width: 580px;
|
| 59 |
}
|
| 60 |
-
|
|
|
|
|
|
|
| 61 |
h1 {
|
| 62 |
margin: 0;
|
| 63 |
-
|
| 64 |
font-size: clamp(16px, 5vw, 32px);
|
| 65 |
line-height: 0.98;
|
| 66 |
-
|
| 67 |
font-weight: 550;
|
| 68 |
letter-spacing: -0.06em;
|
| 69 |
}
|
| 70 |
-
|
| 71 |
p, a {
|
| 72 |
margin: 28px 0 0;
|
| 73 |
-
|
| 74 |
max-width: 520px;
|
| 75 |
-
|
| 76 |
color: #8e8e93;
|
| 77 |
-
|
| 78 |
font-size: clamp(17px, 2vw, 20px);
|
| 79 |
line-height: 1.5;
|
| 80 |
-
|
| 81 |
letter-spacing: -0.02em;
|
| 82 |
}
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 89 |
}
|
| 90 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
@media (max-width: 600px) {
|
| 92 |
-
body {
|
| 93 |
-
padding: 14px;
|
| 94 |
-
}
|
| 95 |
-
|
| 96 |
.card {
|
| 97 |
min-height: calc(100vh - 28px);
|
| 98 |
-
|
| 99 |
padding: 28px 24px;
|
| 100 |
-
|
| 101 |
border-radius: 22px;
|
| 102 |
}
|
| 103 |
}
|
| 104 |
</style>
|
| 105 |
</head>
|
| 106 |
-
|
| 107 |
<body>
|
| 108 |
-
|
| 109 |
<section class="card">
|
| 110 |
-
|
| 111 |
-
<div class="logo">
|
| 112 |
-
D●t Labs
|
| 113 |
-
</div>
|
| 114 |
-
|
| 115 |
<main>
|
| 116 |
-
<h1>
|
| 117 |
-
Intelligence<br>
|
| 118 |
-
from the byte up.
|
| 119 |
-
</h1>
|
| 120 |
-
|
| 121 |
<p>
|
| 122 |
Independent AI research exploring multimodal,
|
| 123 |
byte-level intelligence and simpler foundations
|
|
@@ -126,12 +174,214 @@
|
|
| 126 |
<br/>
|
| 127 |
<a style="font-size: 14px" href="https://huggingface.co/spaces/dotlabs/README/discussions/1">Click here to learn on how to join us!</a>
|
| 128 |
</main>
|
| 129 |
-
|
| 130 |
<footer>
|
| 131 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 132 |
</footer>
|
| 133 |
-
|
| 134 |
</section>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 135 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 136 |
</body>
|
| 137 |
</html>
|
|
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8" />
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
|
|
| 6 |
<title>Dot Labs</title>
|
|
|
|
| 7 |
<style>
|
| 8 |
+
* { box-sizing: border-box; }
|
|
|
|
|
|
|
|
|
|
| 9 |
body {
|
| 10 |
margin: 0;
|
| 11 |
min-height: 100vh;
|
|
|
|
| 12 |
display: grid;
|
| 13 |
place-items: center;
|
|
|
|
| 14 |
padding: 24px;
|
|
|
|
| 15 |
background: #000;
|
| 16 |
color: #f5f5f7;
|
| 17 |
+
font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
-webkit-font-smoothing: antialiased;
|
| 19 |
}
|
|
|
|
| 20 |
.card {
|
| 21 |
+
position: relative;
|
| 22 |
+
isolation: isolate;
|
| 23 |
+
overflow: hidden;
|
| 24 |
width: min(100%, 720px);
|
| 25 |
min-height: 480px;
|
|
|
|
| 26 |
padding: clamp(32px, 7vw, 64px);
|
|
|
|
| 27 |
display: flex;
|
| 28 |
flex-direction: column;
|
| 29 |
justify-content: space-between;
|
| 30 |
+
background: #000; /* PURE BLACK — no gradients, overlays or colored fog */
|
|
|
|
|
|
|
| 31 |
border: 1px solid #1c1c1e;
|
| 32 |
border-radius: 28px;
|
| 33 |
}
|
| 34 |
+
canvas.grain {
|
| 35 |
+
position: absolute;
|
| 36 |
+
inset: 0;
|
| 37 |
+
width: 100%;
|
| 38 |
+
height: 100%;
|
| 39 |
+
z-index: 0;
|
| 40 |
+
pointer-events: none;
|
| 41 |
+
display: block;
|
|
|
|
| 42 |
}
|
| 43 |
+
.card > :not(canvas) { position: relative; z-index: 1; }
|
| 44 |
+
.logo { font-size: 15px; font-weight: 600; letter-spacing: -0.02em; }
|
| 45 |
+
main { max-width: 580px; }
|
| 46 |
h1 {
|
| 47 |
margin: 0;
|
|
|
|
| 48 |
font-size: clamp(16px, 5vw, 32px);
|
| 49 |
line-height: 0.98;
|
|
|
|
| 50 |
font-weight: 550;
|
| 51 |
letter-spacing: -0.06em;
|
| 52 |
}
|
|
|
|
| 53 |
p, a {
|
| 54 |
margin: 28px 0 0;
|
|
|
|
| 55 |
max-width: 520px;
|
|
|
|
| 56 |
color: #8e8e93;
|
|
|
|
| 57 |
font-size: clamp(17px, 2vw, 20px);
|
| 58 |
line-height: 1.5;
|
|
|
|
| 59 |
letter-spacing: -0.02em;
|
| 60 |
}
|
| 61 |
+
footer { color: #555; font-size: 11px; letter-spacing: 0.04em; }
|
| 62 |
+
/* Partners: each identity is a single, non-wrapping icon + name row. */
|
| 63 |
+
.partners {
|
| 64 |
+
display: flex;
|
| 65 |
+
flex-direction: column;
|
| 66 |
+
align-items: flex-start;
|
| 67 |
+
gap: 12px;
|
| 68 |
+
margin: 0 0 17px;
|
| 69 |
+
padding-top: 17px;
|
| 70 |
+
border-top: 1px solid rgba(255,255,255,.105);
|
| 71 |
}
|
| 72 |
+
.partners-label {
|
| 73 |
+
margin: 0;
|
| 74 |
+
color: #68686b;
|
| 75 |
+
font-size: 10px;
|
| 76 |
+
font-weight: 600;
|
| 77 |
+
letter-spacing: .16em;
|
| 78 |
+
text-transform: uppercase;
|
| 79 |
+
line-height: 1;
|
| 80 |
+
}
|
| 81 |
+
.partner-list {
|
| 82 |
+
display: flex;
|
| 83 |
+
flex-wrap: wrap;
|
| 84 |
+
gap: 8px;
|
| 85 |
+
width: 100%;
|
| 86 |
+
}
|
| 87 |
+
.partner-link {
|
| 88 |
+
display: inline-flex;
|
| 89 |
+
flex-direction: row;
|
| 90 |
+
align-items: center;
|
| 91 |
+
justify-content: flex-start;
|
| 92 |
+
flex-wrap: nowrap;
|
| 93 |
+
gap: 10px;
|
| 94 |
+
min-width: 153px;
|
| 95 |
+
min-height: 43px;
|
| 96 |
+
padding: 6px 10px 6px 7px;
|
| 97 |
+
margin: 0;
|
| 98 |
+
background: rgba(255,255,255,.026);
|
| 99 |
+
border: 1px solid rgba(255,255,255,.105);
|
| 100 |
+
border-radius: 9px;
|
| 101 |
+
color: #d7d7d9;
|
| 102 |
+
text-decoration: none;
|
| 103 |
+
font-size: 12px;
|
| 104 |
+
font-weight: 550;
|
| 105 |
+
letter-spacing: -.015em;
|
| 106 |
+
line-height: 1;
|
| 107 |
+
transition: border-color .2s ease, background .2s ease, color .2s ease;
|
| 108 |
+
}
|
| 109 |
+
.partner-link:hover,
|
| 110 |
+
.partner-link:focus-visible {
|
| 111 |
+
background: rgba(255,255,255,.055);
|
| 112 |
+
border-color: rgba(255,255,255,.26);
|
| 113 |
+
color: #fff;
|
| 114 |
+
outline-offset: 3px;
|
| 115 |
+
}
|
| 116 |
+
.partner-icon {
|
| 117 |
+
position: relative;
|
| 118 |
+
display: grid;
|
| 119 |
+
place-items: center;
|
| 120 |
+
width: 29px;
|
| 121 |
+
height: 29px;
|
| 122 |
+
min-width: 29px;
|
| 123 |
+
flex: 0 0 29px;
|
| 124 |
+
overflow: hidden;
|
| 125 |
+
background: #1a1a1c;
|
| 126 |
+
border: 1px solid #29292d;
|
| 127 |
+
border-radius: 6px;
|
| 128 |
+
color: #c9c9cc;
|
| 129 |
+
font-size: 13px;
|
| 130 |
+
font-weight: 700;
|
| 131 |
+
line-height: 1;
|
| 132 |
+
letter-spacing: 0;
|
| 133 |
+
}
|
| 134 |
+
.partner-icon img {
|
| 135 |
+
position: absolute;
|
| 136 |
+
width: 100%;
|
| 137 |
+
height: 100%;
|
| 138 |
+
inset: 0;
|
| 139 |
+
border-radius: inherit;
|
| 140 |
+
object-fit: cover;
|
| 141 |
+
}
|
| 142 |
+
.partner-name { white-space: nowrap; }
|
| 143 |
+
.partner-arrow {
|
| 144 |
+
display: inline-block;
|
| 145 |
+
margin-left: auto;
|
| 146 |
+
color: #77777b;
|
| 147 |
+
font-size: 14px;
|
| 148 |
+
line-height: 1;
|
| 149 |
+
transition: transform .2s ease, color .2s ease;
|
| 150 |
+
}
|
| 151 |
+
.partner-link:hover .partner-arrow { color: #cfcfd2; transform: translate(1px,-1px); }
|
| 152 |
+
.disclaimer { color: #555; font-size: 10px; line-height: 1.6; letter-spacing: .018em; }
|
| 153 |
@media (max-width: 600px) {
|
| 154 |
+
body { padding: 14px; }
|
|
|
|
|
|
|
|
|
|
| 155 |
.card {
|
| 156 |
min-height: calc(100vh - 28px);
|
|
|
|
| 157 |
padding: 28px 24px;
|
|
|
|
| 158 |
border-radius: 22px;
|
| 159 |
}
|
| 160 |
}
|
| 161 |
</style>
|
| 162 |
</head>
|
|
|
|
| 163 |
<body>
|
|
|
|
| 164 |
<section class="card">
|
| 165 |
+
<canvas class="grain" aria-hidden="true"></canvas>
|
| 166 |
+
<div class="logo">D●t Labs</div>
|
|
|
|
|
|
|
|
|
|
| 167 |
<main>
|
| 168 |
+
<h1>Intelligence<br>from the byte up.</h1>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 169 |
<p>
|
| 170 |
Independent AI research exploring multimodal,
|
| 171 |
byte-level intelligence and simpler foundations
|
|
|
|
| 174 |
<br/>
|
| 175 |
<a style="font-size: 14px" href="https://huggingface.co/spaces/dotlabs/README/discussions/1">Click here to learn on how to join us!</a>
|
| 176 |
</main>
|
|
|
|
| 177 |
<footer>
|
| 178 |
+
<div class="partners" aria-label="Partners">
|
| 179 |
+
<div class="partners-label">Partners</div>
|
| 180 |
+
<div class="partner-list">
|
| 181 |
+
<a class="partner-link" href="https://huggingface.co/SurjoLabs" target="_blank" rel="noopener noreferrer" aria-label="Visit SurjoLabs on Hugging Face">
|
| 182 |
+
<span class="partner-icon" aria-hidden="true">
|
| 183 |
+
<span>S</span>
|
| 184 |
+
<img src="https://huggingface.co/api/organizations/SurjoLabs/avatar?redirect=true" alt="" loading="lazy" referrerpolicy="no-referrer" onerror="this.style.display='none'">
|
| 185 |
+
</span>
|
| 186 |
+
<span class="partner-name">SurjoLabs</span>
|
| 187 |
+
<span class="partner-arrow" aria-hidden="true">↗</span>
|
| 188 |
+
</a>
|
| 189 |
+
<a class="partner-link" href="https://huggingface.co/BananaMind" target="_blank" rel="noopener noreferrer" aria-label="Visit BananaMind on Hugging Face">
|
| 190 |
+
<span class="partner-icon" aria-hidden="true">
|
| 191 |
+
<span>B</span>
|
| 192 |
+
<img src="https://huggingface.co/api/organizations/BananaMind/avatar?redirect=true" alt="" loading="lazy" referrerpolicy="no-referrer" onerror="this.style.display='none'">
|
| 193 |
+
</span>
|
| 194 |
+
<span class="partner-name">BananaMind</span>
|
| 195 |
+
<span class="partner-arrow" aria-hidden="true">↗</span>
|
| 196 |
+
</a>
|
| 197 |
+
</div>
|
| 198 |
+
</div>
|
| 199 |
+
<div class="disclaimer">Dot Labs™ is not related in any way to OpenAI's Dot product nor SpaceXAI web domain.</div>
|
| 200 |
</footer>
|
|
|
|
| 201 |
</section>
|
| 202 |
+
<script>
|
| 203 |
+
(() => {
|
| 204 |
+
// Feel free to tune these; everything is native Canvas, no dependencies.
|
| 205 |
+
const SETTINGS = {
|
| 206 |
+
style: 'drift',
|
| 207 |
+
seed: 137,
|
| 208 |
+
opacity: 1.0, // Grain visibility
|
| 209 |
+
size: 1.0, // Overall dot size
|
| 210 |
+
speed: 1.0 // Animation speed; 0 = frozen
|
| 211 |
+
};
|
| 212 |
+
const card = document.querySelector('.card');
|
| 213 |
+
const canvas = document.querySelector('canvas.grain');
|
| 214 |
+
const ctx = canvas.getContext('2d', { alpha: true });
|
| 215 |
+
if (!ctx) return;
|
| 216 |
+
const reducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)');
|
| 217 |
+
const PI2 = Math.PI * 2;
|
| 218 |
+
const gaussian = (x) => Math.exp(-x*x * .5);
|
| 219 |
+
const clamp = (x, a=0, b=1) => Math.max(a, Math.min(b, x));
|
| 220 |
+
const fract = x => x - Math.floor(x);
|
| 221 |
+
let particles = [], width=0, height=0, dpr=1, frame=0, then=0, elapsed=0, active=true;
|
| 222 |
+
|
| 223 |
+
function rng(seed) {
|
| 224 |
+
return () => {
|
| 225 |
+
let t = seed += 0x6D2B79F5;
|
| 226 |
+
t = Math.imul(t ^ t >>> 15, t | 1);
|
| 227 |
+
t ^= t + Math.imul(t ^ t >>> 7, t | 61);
|
| 228 |
+
return ((t ^ t >>> 14) >>> 0) / 4294967296;
|
| 229 |
+
};
|
| 230 |
+
}
|
| 231 |
|
| 232 |
+
function concentration(x, y) {
|
| 233 |
+
if (SETTINGS.style === 'drift') {
|
| 234 |
+
return clamp(.28 + .34*x + .22*gaussian((x-.78)/.28)*gaussian((y-.43)/.47));
|
| 235 |
+
}
|
| 236 |
+
if (SETTINGS.style === 'nebula') {
|
| 237 |
+
const cloud = gaussian((x-.72)/.23)*gaussian((y-.41-.09*Math.sin(x*7))/.21);
|
| 238 |
+
const plume = gaussian((x-.53)/.29)*gaussian((y-.72)/.16);
|
| 239 |
+
return clamp(.055 + .88*cloud + .34*plume);
|
| 240 |
+
}
|
| 241 |
+
if (SETTINGS.style === 'eclipse') {
|
| 242 |
+
const r = Math.hypot((x-.72)/.43, (y-.48)/.60);
|
| 243 |
+
return clamp(.045 + .88*gaussian((r-.77)/.19));
|
| 244 |
+
}
|
| 245 |
+
const path = .80 - .53*x + .046*Math.sin(9*x);
|
| 246 |
+
return clamp(.07 + .89*gaussian((y-path)/.125) * (.35+.65*x));
|
| 247 |
+
}
|
| 248 |
+
|
| 249 |
+
// Larger dots progressively emerge across each pattern, without any
|
| 250 |
+
// solid gray gradient. Only individual particles carry color.
|
| 251 |
+
function sizeProgress(x, y) {
|
| 252 |
+
if (SETTINGS.style === 'eclipse') {
|
| 253 |
+
return clamp(.07 + .93*x);
|
| 254 |
+
}
|
| 255 |
+
if (SETTINGS.style === 'nebula') {
|
| 256 |
+
return clamp(.06 + .78*x + .17*y);
|
| 257 |
+
}
|
| 258 |
+
return clamp(.04 + .96*x);
|
| 259 |
+
}
|
| 260 |
+
|
| 261 |
+
function rebuild() {
|
| 262 |
+
const rect = card.getBoundingClientRect();
|
| 263 |
+
width = rect.width;
|
| 264 |
+
height = rect.height;
|
| 265 |
+
if (!width || !height) return;
|
| 266 |
+
dpr = Math.min(window.devicePixelRatio || 1, 2);
|
| 267 |
+
canvas.width = Math.round(width*dpr);
|
| 268 |
+
canvas.height = Math.round(height*dpr);
|
| 269 |
+
ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
|
| 270 |
+
const random = rng(SETTINGS.seed);
|
| 271 |
+
const area = width*height;
|
| 272 |
+
particles = [];
|
| 273 |
+
const count = Math.floor(area / (SETTINGS.style === 'nebula' ? 13 : 15));
|
| 274 |
+
for (let i=0; i<count; i++) {
|
| 275 |
+
const x=random(), y=random();
|
| 276 |
+
const c = concentration(x,y);
|
| 277 |
+
if (random()>c) continue;
|
| 278 |
+
const growth = sizeProgress(x,y);
|
| 279 |
+
const isFine = random() < .76;
|
| 280 |
+
let radius;
|
| 281 |
+
let alpha;
|
| 282 |
+
if (isFine) {
|
| 283 |
+
radius=(.13 + .15*random() + .12*growth)*SETTINGS.size;
|
| 284 |
+
alpha=(.17 + .34*random()) * (.71+.29*c);
|
| 285 |
+
} else {
|
| 286 |
+
// A few larger grains emerge gently, but all remain subpixel-to-1px dust.
|
| 287 |
+
radius=(.19 + .66*Math.pow(growth,1.9)) * (.47+.53*random())*SETTINGS.size;
|
| 288 |
+
alpha=(.18 + .42*random())*(.70+.30*c);
|
| 289 |
+
}
|
| 290 |
+
// Occasional slightly larger isolated grains in the denser region.
|
| 291 |
+
if (random()<.008 && growth>.60) radius*=1.18;
|
| 292 |
+
const shade = Math.floor(139 + random()*75);
|
| 293 |
+
particles.push({x,y,radius,alpha,shade,phase:random()*PI2,
|
| 294 |
+
velocity:.42+random()*1.25,depth:random(),offset:0});
|
| 295 |
+
}
|
| 296 |
+
// The quiet microdust layer fills dark negative space at tiny sizes.
|
| 297 |
+
const fineCount = Math.floor(area / 21);
|
| 298 |
+
for (let i=0; i<fineCount; i++) {
|
| 299 |
+
const x=random(), y=random();
|
| 300 |
+
const density = concentration(x,y);
|
| 301 |
+
if (random() > .42+.36*density) continue;
|
| 302 |
+
const shade=Math.floor(140+random()*73);
|
| 303 |
+
particles.push({x,y,radius:(.12+.16*random())*SETTINGS.size,
|
| 304 |
+
alpha:(.16+.19*random())* (.67+.33*density),
|
| 305 |
+
shade,phase:random()*PI2,velocity:.24+random()*.75,
|
| 306 |
+
depth:random(),offset:0});
|
| 307 |
+
}
|
| 308 |
+
draw(0);
|
| 309 |
+
}
|
| 310 |
+
|
| 311 |
+
function position(p, t) {
|
| 312 |
+
const x=p.x, y=p.y;
|
| 313 |
+
if (SETTINGS.style === 'drift') {
|
| 314 |
+
// Low, steady breeze; different velocity at every dust depth.
|
| 315 |
+
return [fract(x+t*(3.5+4.2*p.velocity)/width),
|
| 316 |
+
y + 1.6*Math.sin(t*.49+p.phase)/height];
|
| 317 |
+
}
|
| 318 |
+
if (SETTINGS.style === 'nebula') {
|
| 319 |
+
// A barely rotating, breathing cloud of gray points.
|
| 320 |
+
const dx=(x-.68)*width, dy=(y-.48)*height;
|
| 321 |
+
const theta=t*(.003+.006*p.velocity);
|
| 322 |
+
const cos=Math.cos(theta), sin=Math.sin(theta);
|
| 323 |
+
return [.68 + (dx*cos-dy*sin+2.1*Math.sin(t*.31+p.phase))/width,
|
| 324 |
+
.48 + (dx*sin+dy*cos+2.0*Math.cos(t*.33+p.phase))/height];
|
| 325 |
+
}
|
| 326 |
+
if (SETTINGS.style === 'eclipse') {
|
| 327 |
+
// Subtle orbital travel around the ring; no fog or glow.
|
| 328 |
+
const dx=(x-.72)*width, dy=(y-.48)*height;
|
| 329 |
+
const angle=t*(.009+.006*p.velocity);
|
| 330 |
+
const rx=Math.cos(angle)*dx-Math.sin(angle)*dy*.78;
|
| 331 |
+
const ry=Math.sin(angle)*dx/ .78+Math.cos(angle)*dy;
|
| 332 |
+
return [.72+rx/width,.48+ry/height];
|
| 333 |
+
}
|
| 334 |
+
// Stream moves diagonally upward along a curved path.
|
| 335 |
+
const nx=fract(x+t*(4.0+5.5*p.velocity)/width);
|
| 336 |
+
const oldPath=.80-.53*x+.046*Math.sin(9*x);
|
| 337 |
+
const newPath=.80-.53*nx+.046*Math.sin(9*nx);
|
| 338 |
+
return [nx, newPath + (y-oldPath) + 1.8*Math.sin(t*.50+p.phase)/height];
|
| 339 |
+
}
|
| 340 |
+
|
| 341 |
+
function draw(t) {
|
| 342 |
+
ctx.clearRect(0,0,width,height);
|
| 343 |
+
for (const p of particles) {
|
| 344 |
+
const [nx,ny]=position(p,t);
|
| 345 |
+
if (nx<0 || nx>1 || ny<0 || ny>1) continue;
|
| 346 |
+
const shimmer=.91+.09*Math.sin(t*.67+p.phase);
|
| 347 |
+
const a=clamp(p.alpha*shimmer*SETTINGS.opacity);
|
| 348 |
+
ctx.fillStyle=`rgba(${p.shade},${p.shade},${p.shade},${a})`;
|
| 349 |
+
ctx.beginPath();
|
| 350 |
+
ctx.arc(nx*width,ny*height,p.radius,0,PI2);
|
| 351 |
+
ctx.fill();
|
| 352 |
+
}
|
| 353 |
+
}
|
| 354 |
+
|
| 355 |
+
function stop() {
|
| 356 |
+
cancelAnimationFrame(frame);
|
| 357 |
+
frame=0;
|
| 358 |
+
then=0;
|
| 359 |
+
}
|
| 360 |
+
function tick(now) {
|
| 361 |
+
if (!active || reducedMotion.matches) { stop(); return; }
|
| 362 |
+
if (then) elapsed+=Math.min((now-then)/1000,.05)*SETTINGS.speed;
|
| 363 |
+
then=now;
|
| 364 |
+
// Max ~25fps to keep the denser microdust field lightweight.
|
| 365 |
+
if (!tick.drawn || now-tick.drawn>=40) {
|
| 366 |
+
draw(elapsed);
|
| 367 |
+
tick.drawn=now;
|
| 368 |
+
}
|
| 369 |
+
frame=requestAnimationFrame(tick);
|
| 370 |
+
}
|
| 371 |
+
function updateRunning() {
|
| 372 |
+
stop();
|
| 373 |
+
if (active && !reducedMotion.matches) frame=requestAnimationFrame(tick);
|
| 374 |
+
else draw(elapsed);
|
| 375 |
+
}
|
| 376 |
+
document.addEventListener('visibilitychange',()=> {
|
| 377 |
+
active=!document.hidden;
|
| 378 |
+
updateRunning();
|
| 379 |
+
});
|
| 380 |
+
reducedMotion.addEventListener('change', updateRunning);
|
| 381 |
+
new ResizeObserver(rebuild).observe(card);
|
| 382 |
+
rebuild();
|
| 383 |
+
updateRunning();
|
| 384 |
+
})();
|
| 385 |
+
</script>
|
| 386 |
</body>
|
| 387 |
</html>
|