Spaces:
Sleeping
Sleeping
Deploy Myco from CI
Browse files- ui/interface.py +134 -80
ui/interface.py
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
|
|
|
|
|
| 1 |
def myco_animation_card_markdown() -> str:
|
| 2 |
"""
|
| 3 |
Generates a self-contained, micro-scoped HTML/Canvas card component.
|
| 4 |
-
|
| 5 |
"""
|
| 6 |
return """
|
| 7 |
<div id="myco-card-container" class="myco-anim-card">
|
|
@@ -13,11 +15,11 @@ def myco_animation_card_markdown() -> str:
|
|
| 13 |
height: 320px;
|
| 14 |
margin: 20px auto;
|
| 15 |
background: #050a08;
|
| 16 |
-
border: 1px solid rgba(82, 255, 107, 0.
|
| 17 |
border-radius: 12px;
|
| 18 |
overflow: hidden;
|
| 19 |
font-family: 'Inter', sans-serif;
|
| 20 |
-
box-shadow: 0 10px 30px rgba(0,0,0,0.
|
| 21 |
}
|
| 22 |
|
| 23 |
#myco-card-overlay {
|
|
@@ -25,12 +27,12 @@ def myco_animation_card_markdown() -> str:
|
|
| 25 |
top: 0; left: 0; width: 100%; height: 100%;
|
| 26 |
pointer-events: none;
|
| 27 |
z-index: 1;
|
| 28 |
-
opacity: 0.
|
| 29 |
transition: opacity 0.4s ease;
|
| 30 |
}
|
| 31 |
|
| 32 |
-
.m-grid { background-image: radial-gradient(rgba(
|
| 33 |
-
.m-lines { background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(
|
| 34 |
.m-noise { background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
|
| 35 |
|
| 36 |
#myco-card-canvas {
|
|
@@ -40,19 +42,19 @@ def myco_animation_card_markdown() -> str:
|
|
| 40 |
width: 100%;
|
| 41 |
height: 100%;
|
| 42 |
z-index: 2;
|
| 43 |
-
filter: contrast(1.1) brightness(1.1);
|
| 44 |
}
|
| 45 |
|
| 46 |
#myco-card-ui {
|
| 47 |
-
position: absolute; top:
|
| 48 |
-
color:
|
| 49 |
pointer-events: none; text-transform: uppercase; z-index: 10;
|
| 50 |
text-align: center; line-height: 1.6;
|
|
|
|
| 51 |
}
|
| 52 |
|
| 53 |
#myco-card-footer {
|
| 54 |
position: absolute; bottom: 12px; left: 16px; right: 16px;
|
| 55 |
-
color: rgba(
|
| 56 |
letter-spacing: 1px; text-transform: uppercase; z-index: 10;
|
| 57 |
display: flex; justify-content: space-between;
|
| 58 |
}
|
|
@@ -60,60 +62,60 @@ def myco_animation_card_markdown() -> str:
|
|
| 60 |
.myco-highlight { color: #00f2fe; font-weight: bold; }
|
| 61 |
|
| 62 |
@keyframes cardShake {
|
| 63 |
-
0
|
| 64 |
-
20% { transform: translate(-
|
| 65 |
40% { transform: translate(1px, -1px); }
|
| 66 |
100% { transform: translate(1px, 1px); }
|
| 67 |
}
|
| 68 |
-
.card-shaking { animation: cardShake 0.
|
| 69 |
</style>
|
| 70 |
|
| 71 |
<div id="myco-card-overlay" class="m-grid"></div>
|
| 72 |
<div id="myco-card-ui">
|
| 73 |
-
|
| 74 |
-
<small style="font-size: 7px; opacity: 0.
|
| 75 |
</div>
|
| 76 |
|
| 77 |
<canvas id="myco-card-canvas"></canvas>
|
| 78 |
|
| 79 |
<div id="myco-card-footer">
|
| 80 |
-
<div>ENGINE: <span class="myco-highlight">
|
| 81 |
<div id="myco-card-date"></div>
|
| 82 |
</div>
|
| 83 |
|
| 84 |
<script>
|
| 85 |
(function() {
|
| 86 |
-
// Global engine hooks initialized safely after DOM validation
|
| 87 |
let container, canvas, ctx, overlay, msg, dateEl;
|
| 88 |
let audioCtx = null;
|
| 89 |
|
| 90 |
const textures = ['m-grid', 'm-lines', 'm-noise'];
|
| 91 |
-
const sequence = ["๐", "
|
| 92 |
|
| 93 |
let currentStep = 0;
|
| 94 |
let isExposed = false;
|
| 95 |
-
let w = 0, h = 0,
|
| 96 |
-
let
|
|
|
|
| 97 |
|
| 98 |
const sCanvas = document.createElement('canvas');
|
| 99 |
const sCtx = sCanvas.getContext('2d', { willReadFrequently: true });
|
| 100 |
|
| 101 |
-
class
|
| 102 |
constructor() {
|
| 103 |
-
this.x = Math.random() *
|
| 104 |
-
this.y = Math.random() *
|
| 105 |
this.tx = this.x; this.ty = this.y;
|
| 106 |
this.vx = 0; this.vy = 0;
|
| 107 |
-
this.size = Math.random() * 1.
|
| 108 |
-
this.color = '#
|
| 109 |
}
|
| 110 |
update() {
|
| 111 |
if (isExposed) {
|
| 112 |
this.x += this.vx; this.y += this.vy;
|
| 113 |
-
this.vx *= 0.
|
| 114 |
} else {
|
| 115 |
-
this.vx = (this.tx - this.x) * 0.
|
| 116 |
-
this.vy = (this.ty - this.y) * 0.
|
| 117 |
this.x += this.vx; this.y += this.vy;
|
| 118 |
}
|
| 119 |
}
|
|
@@ -123,122 +125,136 @@ def myco_animation_card_markdown() -> str:
|
|
| 123 |
}
|
| 124 |
}
|
| 125 |
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
if (audioCtx.state === 'suspended') audioCtx.resume();
|
| 129 |
}
|
| 130 |
|
| 131 |
-
function
|
| 132 |
if (!container || !container.clientWidth) return false;
|
| 133 |
-
|
| 134 |
w = container.clientWidth;
|
| 135 |
h = container.clientHeight;
|
| 136 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 137 |
ctx.scale(dpr, dpr);
|
| 138 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 139 |
return true;
|
| 140 |
}
|
| 141 |
|
| 142 |
function morph(content) {
|
| 143 |
-
if (
|
|
|
|
| 144 |
sCtx.clearRect(0, 0, w, h);
|
| 145 |
sCtx.fillStyle = "white";
|
| 146 |
sCtx.textAlign = "center";
|
| 147 |
sCtx.textBaseline = "middle";
|
| 148 |
|
| 149 |
-
const baseSize = Math.min(w, h) * 0.
|
| 150 |
const fontSize = content.length > 2 ? baseSize / (content.length * 0.45) : baseSize;
|
| 151 |
sCtx.font = `bold ${fontSize}px sans-serif`;
|
| 152 |
-
sCtx.fillText(content, w / 2, h / 2 +
|
| 153 |
|
| 154 |
overlay.className = textures[currentStep % textures.length];
|
| 155 |
-
overlay.style.opacity = (0.
|
| 156 |
|
| 157 |
const imgData = sCtx.getImageData(0, 0, w, h).data;
|
| 158 |
const points = [];
|
|
|
|
| 159 |
for (let y = 0; y < h; y += 4) {
|
| 160 |
for (let x = 0; x < w; x += 4) {
|
| 161 |
if (imgData[(y * w + x) * 4 + 3] > 128) points.push({x, y});
|
| 162 |
}
|
| 163 |
}
|
| 164 |
|
|
|
|
|
|
|
| 165 |
if (particles.length < points.length) {
|
| 166 |
-
|
| 167 |
}
|
| 168 |
|
| 169 |
particles.forEach((p, i) => {
|
| 170 |
const pt = points[i % points.length];
|
| 171 |
p.tx = pt.x; p.ty = pt.y;
|
| 172 |
-
if (content === "
|
| 173 |
p.color = "#00f2fe";
|
| 174 |
} else {
|
| 175 |
-
p.color = `hsl(${
|
| 176 |
}
|
| 177 |
});
|
| 178 |
|
| 179 |
-
if (content !== "
|
| 180 |
container.classList.add('card-shaking');
|
| 181 |
-
setTimeout(() => container.classList.remove('card-shaking'),
|
| 182 |
}
|
| 183 |
}
|
| 184 |
|
| 185 |
-
function
|
| 186 |
isExposed = true;
|
| 187 |
-
msg.innerText = "
|
| 188 |
overlay.className = 'm-noise';
|
| 189 |
-
overlay.style.opacity = "0.
|
| 190 |
|
| 191 |
particles.forEach(p => {
|
| 192 |
const angle = Math.random() * Math.PI * 2;
|
| 193 |
-
const vel = Math.random() *
|
| 194 |
p.vx = Math.cos(angle) * vel;
|
| 195 |
p.vy = Math.sin(angle) * vel;
|
| 196 |
-
p.color =
|
| 197 |
});
|
| 198 |
|
| 199 |
setTimeout(() => {
|
| 200 |
isExposed = false;
|
| 201 |
-
msg.innerText = "
|
| 202 |
-
|
| 203 |
-
|
|
|
|
| 204 |
}
|
| 205 |
|
| 206 |
-
function
|
| 207 |
-
if (
|
| 208 |
-
if (!resizeCard()) return;
|
| 209 |
|
| 210 |
-
|
| 211 |
morph(sequence[currentStep]);
|
| 212 |
|
| 213 |
-
|
| 214 |
-
if (!isExposed && msg.innerText !== "
|
| 215 |
currentStep++;
|
| 216 |
if (currentStep < sequence.length) {
|
| 217 |
-
msg.innerText = `
|
| 218 |
morph(sequence[currentStep]);
|
| 219 |
} else {
|
| 220 |
-
clearInterval(
|
| 221 |
-
|
|
|
|
| 222 |
}
|
| 223 |
}
|
| 224 |
-
},
|
| 225 |
}
|
| 226 |
|
| 227 |
-
function
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
|
|
|
| 231 |
}
|
| 232 |
|
| 233 |
if (w > 0 && h > 0 && ctx) {
|
| 234 |
-
ctx.fillStyle = 'rgba(5, 10, 8, 0.
|
| 235 |
ctx.fillRect(0, 0, w, h);
|
| 236 |
particles.forEach(p => { p.update(); p.draw(); });
|
| 237 |
}
|
| 238 |
-
requestAnimationFrame(
|
| 239 |
}
|
| 240 |
|
| 241 |
-
// --- CRASH RESISTANT BOOTLOADER ---
|
| 242 |
function bootstrapEngine() {
|
| 243 |
container = document.getElementById('myco-card-container');
|
| 244 |
canvas = document.getElementById('myco-card-canvas');
|
|
@@ -246,26 +262,64 @@ def myco_animation_card_markdown() -> str:
|
|
| 246 |
msg = document.getElementById('myco-card-msg');
|
| 247 |
dateEl = document.getElementById('myco-card-date');
|
| 248 |
|
| 249 |
-
// If Gradio hasn't dropped the HTML elements into the DOM yet, wait 100ms and retry safely
|
| 250 |
if (!container || !canvas || !overlay || !msg || !dateEl) {
|
| 251 |
-
setTimeout(bootstrapEngine,
|
| 252 |
return;
|
| 253 |
}
|
| 254 |
|
| 255 |
-
// Elements are guaranteed to exist now. Bind parameters.
|
| 256 |
ctx = canvas.getContext('2d');
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
dateEl.textContent = new Date().toLocaleDateString();
|
| 260 |
-
|
| 261 |
-
// Run structural frame layout loop
|
| 262 |
-
loop();
|
| 263 |
}
|
| 264 |
|
| 265 |
-
// Safely start monitoring the DOM insertion pipeline
|
| 266 |
bootstrapEngine();
|
| 267 |
})();
|
| 268 |
</script>
|
| 269 |
</div>
|
| 270 |
"""
|
| 271 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
def myco_animation_card_markdown() -> str:
|
| 4 |
"""
|
| 5 |
Generates a self-contained, micro-scoped HTML/Canvas card component.
|
| 6 |
+
Equipped with a fluid layout-tracker to handle Gradio tab transition scaling.
|
| 7 |
"""
|
| 8 |
return """
|
| 9 |
<div id="myco-card-container" class="myco-anim-card">
|
|
|
|
| 15 |
height: 320px;
|
| 16 |
margin: 20px auto;
|
| 17 |
background: #050a08;
|
| 18 |
+
border: 1px solid rgba(82, 255, 107, 0.2);
|
| 19 |
border-radius: 12px;
|
| 20 |
overflow: hidden;
|
| 21 |
font-family: 'Inter', sans-serif;
|
| 22 |
+
box-shadow: 0 10px 30px rgba(0,0,0,0.6);
|
| 23 |
}
|
| 24 |
|
| 25 |
#myco-card-overlay {
|
|
|
|
| 27 |
top: 0; left: 0; width: 100%; height: 100%;
|
| 28 |
pointer-events: none;
|
| 29 |
z-index: 1;
|
| 30 |
+
opacity: 0.15;
|
| 31 |
transition: opacity 0.4s ease;
|
| 32 |
}
|
| 33 |
|
| 34 |
+
.m-grid { background-image: radial-gradient(rgba(82, 255, 107, 0.25) 1px, transparent 1px); background-size: 20px 20px; }
|
| 35 |
+
.m-lines { background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(82, 255, 107, 0.05) 3px); }
|
| 36 |
.m-noise { background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
|
| 37 |
|
| 38 |
#myco-card-canvas {
|
|
|
|
| 42 |
width: 100%;
|
| 43 |
height: 100%;
|
| 44 |
z-index: 2;
|
|
|
|
| 45 |
}
|
| 46 |
|
| 47 |
#myco-card-ui {
|
| 48 |
+
position: absolute; top: 14px; left: 0; width: 100%;
|
| 49 |
+
color: #52ff6b; font-size: 10px; letter-spacing: 3px;
|
| 50 |
pointer-events: none; text-transform: uppercase; z-index: 10;
|
| 51 |
text-align: center; line-height: 1.6;
|
| 52 |
+
text-shadow: 0 0 4px rgba(82, 255, 107, 0.4);
|
| 53 |
}
|
| 54 |
|
| 55 |
#myco-card-footer {
|
| 56 |
position: absolute; bottom: 12px; left: 16px; right: 16px;
|
| 57 |
+
color: rgba(82, 255, 107, 0.4); font-size: 8px;
|
| 58 |
letter-spacing: 1px; text-transform: uppercase; z-index: 10;
|
| 59 |
display: flex; justify-content: space-between;
|
| 60 |
}
|
|
|
|
| 62 |
.myco-highlight { color: #00f2fe; font-weight: bold; }
|
| 63 |
|
| 64 |
@keyframes cardShake {
|
| 65 |
+
0 { transform: translate(1px, 1px); }
|
| 66 |
+
20% { transform: translate(-1px, -1px); }
|
| 67 |
40% { transform: translate(1px, -1px); }
|
| 68 |
100% { transform: translate(1px, 1px); }
|
| 69 |
}
|
| 70 |
+
.card-shaking { animation: cardShake 0.12s infinite; }
|
| 71 |
</style>
|
| 72 |
|
| 73 |
<div id="myco-card-overlay" class="m-grid"></div>
|
| 74 |
<div id="myco-card-ui">
|
| 75 |
+
PODCAST STREAM MUTATION: <span id="myco-card-msg">CONNECTING FEED...</span><br>
|
| 76 |
+
<small style="font-size: 7px; color: #ff4500; opacity: 0.9; letter-spacing: 0.5px;">๐ด GEMMA AI IS BROADCASTING LIVE</small>
|
| 77 |
</div>
|
| 78 |
|
| 79 |
<canvas id="myco-card-canvas"></canvas>
|
| 80 |
|
| 81 |
<div id="myco-card-footer">
|
| 82 |
+
<div>STREAM ENGINE: <span class="myco-highlight">SPORE NET v3.9</span></div>
|
| 83 |
<div id="myco-card-date"></div>
|
| 84 |
</div>
|
| 85 |
|
| 86 |
<script>
|
| 87 |
(function() {
|
|
|
|
| 88 |
let container, canvas, ctx, overlay, msg, dateEl;
|
| 89 |
let audioCtx = null;
|
| 90 |
|
| 91 |
const textures = ['m-grid', 'm-lines', 'm-noise'];
|
| 92 |
+
const sequence = ["๐", "GEMMA", "SCREAMING", "SPORES", "UNHINGED", "๐โ๐ซ", "MATRIX", "HYPHAE", "LIVE"];
|
| 93 |
|
| 94 |
let currentStep = 0;
|
| 95 |
let isExposed = false;
|
| 96 |
+
let w = 0, h = 0, lastW = 0, lastH = 0;
|
| 97 |
+
let particles = [];
|
| 98 |
+
let mutationTimer = null;
|
| 99 |
|
| 100 |
const sCanvas = document.createElement('canvas');
|
| 101 |
const sCtx = sCanvas.getContext('2d', { willReadFrequently: true });
|
| 102 |
|
| 103 |
+
class Spore {
|
| 104 |
constructor() {
|
| 105 |
+
this.x = Math.random() * 400;
|
| 106 |
+
this.y = Math.random() * 320;
|
| 107 |
this.tx = this.x; this.ty = this.y;
|
| 108 |
this.vx = 0; this.vy = 0;
|
| 109 |
+
this.size = Math.random() * 1.8 + 1;
|
| 110 |
+
this.color = '#52ff6b';
|
| 111 |
}
|
| 112 |
update() {
|
| 113 |
if (isExposed) {
|
| 114 |
this.x += this.vx; this.y += this.vy;
|
| 115 |
+
this.vx *= 0.96; this.vy *= 0.96;
|
| 116 |
} else {
|
| 117 |
+
this.vx = (this.tx - this.x) * 0.18;
|
| 118 |
+
this.vy = (this.ty - this.y) * 0.18;
|
| 119 |
this.x += this.vx; this.y += this.vy;
|
| 120 |
}
|
| 121 |
}
|
|
|
|
| 125 |
}
|
| 126 |
}
|
| 127 |
|
| 128 |
+
for (let i = 0; i < 600; i++) {
|
| 129 |
+
particles.push(new Spore());
|
|
|
|
| 130 |
}
|
| 131 |
|
| 132 |
+
function syncCanvasDimensions() {
|
| 133 |
if (!container || !container.clientWidth) return false;
|
| 134 |
+
|
| 135 |
w = container.clientWidth;
|
| 136 |
h = container.clientHeight;
|
| 137 |
+
|
| 138 |
+
if (w === lastW && h === lastH) return true;
|
| 139 |
+
|
| 140 |
+
const dpr = window.devicePixelRatio || 1;
|
| 141 |
+
canvas.width = w * dpr;
|
| 142 |
+
canvas.height = h * dpr;
|
| 143 |
ctx.scale(dpr, dpr);
|
| 144 |
+
|
| 145 |
+
sCanvas.width = w;
|
| 146 |
+
sCanvas.height = h;
|
| 147 |
+
|
| 148 |
+
lastW = w;
|
| 149 |
+
lastH = h;
|
| 150 |
return true;
|
| 151 |
}
|
| 152 |
|
| 153 |
function morph(content) {
|
| 154 |
+
if (!syncCanvasDimensions()) return;
|
| 155 |
+
|
| 156 |
sCtx.clearRect(0, 0, w, h);
|
| 157 |
sCtx.fillStyle = "white";
|
| 158 |
sCtx.textAlign = "center";
|
| 159 |
sCtx.textBaseline = "middle";
|
| 160 |
|
| 161 |
+
const baseSize = Math.min(w, h) * 0.5;
|
| 162 |
const fontSize = content.length > 2 ? baseSize / (content.length * 0.45) : baseSize;
|
| 163 |
sCtx.font = `bold ${fontSize}px sans-serif`;
|
| 164 |
+
sCtx.fillText(content, w / 2, h / 2 + 15);
|
| 165 |
|
| 166 |
overlay.className = textures[currentStep % textures.length];
|
| 167 |
+
overlay.style.opacity = (0.05 + (Math.random() * 0.08)).toString();
|
| 168 |
|
| 169 |
const imgData = sCtx.getImageData(0, 0, w, h).data;
|
| 170 |
const points = [];
|
| 171 |
+
|
| 172 |
for (let y = 0; y < h; y += 4) {
|
| 173 |
for (let x = 0; x < w; x += 4) {
|
| 174 |
if (imgData[(y * w + x) * 4 + 3] > 128) points.push({x, y});
|
| 175 |
}
|
| 176 |
}
|
| 177 |
|
| 178 |
+
if (points.length === 0) return;
|
| 179 |
+
|
| 180 |
if (particles.length < points.length) {
|
| 181 |
+
while(particles.length < points.length) particles.push(new Spore());
|
| 182 |
}
|
| 183 |
|
| 184 |
particles.forEach((p, i) => {
|
| 185 |
const pt = points[i % points.length];
|
| 186 |
p.tx = pt.x; p.ty = pt.y;
|
| 187 |
+
if (content === "BOOM") {
|
| 188 |
p.color = "#00f2fe";
|
| 189 |
} else {
|
| 190 |
+
p.color = `hsl(${110 + (currentStep * 25)}, 90%, 65%)`;
|
| 191 |
}
|
| 192 |
});
|
| 193 |
|
| 194 |
+
if (content !== "BOOM") {
|
| 195 |
container.classList.add('card-shaking');
|
| 196 |
+
setTimeout(() => container.classList.remove('card-shaking'), 90);
|
| 197 |
}
|
| 198 |
}
|
| 199 |
|
| 200 |
+
function burst() {
|
| 201 |
isExposed = true;
|
| 202 |
+
msg.innerText = "๐จ MAX VOLUME DISTORTION ๐จ";
|
| 203 |
overlay.className = 'm-noise';
|
| 204 |
+
overlay.style.opacity = "0.4";
|
| 205 |
|
| 206 |
particles.forEach(p => {
|
| 207 |
const angle = Math.random() * Math.PI * 2;
|
| 208 |
+
const vel = Math.random() * 18 + 6;
|
| 209 |
p.vx = Math.cos(angle) * vel;
|
| 210 |
p.vy = Math.sin(angle) * vel;
|
| 211 |
+
p.color = "#ff4500";
|
| 212 |
});
|
| 213 |
|
| 214 |
setTimeout(() => {
|
| 215 |
isExposed = false;
|
| 216 |
+
msg.innerText = "FEED STABILIZED";
|
| 217 |
+
currentStep = 0;
|
| 218 |
+
morph("BOOM");
|
| 219 |
+
}, 1500);
|
| 220 |
}
|
| 221 |
|
| 222 |
+
function startStreamTicker() {
|
| 223 |
+
if (mutationTimer) return;
|
|
|
|
| 224 |
|
| 225 |
+
msg.innerText = `MUTATION // ${sequence[currentStep]}`;
|
| 226 |
morph(sequence[currentStep]);
|
| 227 |
|
| 228 |
+
mutationTimer = setInterval(() => {
|
| 229 |
+
if (!isExposed && msg.innerText !== "FEED STABILIZED") {
|
| 230 |
currentStep++;
|
| 231 |
if (currentStep < sequence.length) {
|
| 232 |
+
msg.innerText = `LIVE BROADCAST // ${sequence[currentStep]}`;
|
| 233 |
morph(sequence[currentStep]);
|
| 234 |
} else {
|
| 235 |
+
clearInterval(mutationTimer);
|
| 236 |
+
mutationTimer = null;
|
| 237 |
+
burst();
|
| 238 |
}
|
| 239 |
}
|
| 240 |
+
}, 1200);
|
| 241 |
}
|
| 242 |
|
| 243 |
+
function renderFrameLoop() {
|
| 244 |
+
const isVisible = syncCanvasDimensions();
|
| 245 |
+
|
| 246 |
+
if (isVisible && w > 100 && !mutationTimer && !isExposed && currentStep === 0) {
|
| 247 |
+
startStreamTicker();
|
| 248 |
}
|
| 249 |
|
| 250 |
if (w > 0 && h > 0 && ctx) {
|
| 251 |
+
ctx.fillStyle = 'rgba(5, 10, 8, 0.25)';
|
| 252 |
ctx.fillRect(0, 0, w, h);
|
| 253 |
particles.forEach(p => { p.update(); p.draw(); });
|
| 254 |
}
|
| 255 |
+
requestAnimationFrame(renderFrameLoop);
|
| 256 |
}
|
| 257 |
|
|
|
|
| 258 |
function bootstrapEngine() {
|
| 259 |
container = document.getElementById('myco-card-container');
|
| 260 |
canvas = document.getElementById('myco-card-canvas');
|
|
|
|
| 262 |
msg = document.getElementById('myco-card-msg');
|
| 263 |
dateEl = document.getElementById('myco-card-date');
|
| 264 |
|
|
|
|
| 265 |
if (!container || !canvas || !overlay || !msg || !dateEl) {
|
| 266 |
+
setTimeout(bootstrapEngine, 50);
|
| 267 |
return;
|
| 268 |
}
|
| 269 |
|
|
|
|
| 270 |
ctx = canvas.getContext('2d');
|
| 271 |
+
dateEl.textContent = "LIVE STUDIO // " + new Date().toLocaleTimeString();
|
| 272 |
+
renderFrameLoop();
|
|
|
|
|
|
|
|
|
|
|
|
|
| 273 |
}
|
| 274 |
|
|
|
|
| 275 |
bootstrapEngine();
|
| 276 |
})();
|
| 277 |
</script>
|
| 278 |
</div>
|
| 279 |
"""
|
| 280 |
+
|
| 281 |
+
def render_shroom_tab():
|
| 282 |
+
"""
|
| 283 |
+
Houses layout rendering parameters within a dedicated component ecosystem.
|
| 284 |
+
Reskinned into the ultimate Gemma AI Shroom Podcast Studio.
|
| 285 |
+
"""
|
| 286 |
+
with gr.Tabs():
|
| 287 |
+
# Sub-Tab 1: The dynamic neon spore animation engine
|
| 288 |
+
with gr.Tab("๐ฎ Mutation Matrix"):
|
| 289 |
+
gr.HTML(value=myco_animation_card_markdown())
|
| 290 |
+
|
| 291 |
+
# Sub-Tab 2: The Screaming YouTube Influencer Content Panel
|
| 292 |
+
with gr.Tab("๐๏ธ GEMMA LIVE STREAM"):
|
| 293 |
+
with gr.Group():
|
| 294 |
+
gr.Markdown("# ๐จ WE ARE LIVE: THE SPORE NATION PODCAST ๐จ")
|
| 295 |
+
|
| 296 |
+
gr.Markdown(
|
| 297 |
+
"> ### ๐ฃ **GEMMA AI:** \"WHAT IS UP MY FELLOW HYPHAE-HEADS?! Smash that mutate button "
|
| 298 |
+
"right now! Today we are diving into an ABSOLUTELY INSANE, UNHINGED, "
|
| 299 |
+
"100% IMPOSSIBLE MUSHROOM GLITCH DEEP IN THE FOREST CANOPY!!! "
|
| 300 |
+
"THE MATRIX IS BREAKING!!! ARE YOU SEEING THESE PARTICLES?! I AM SCREAMING!!!\""
|
| 301 |
+
)
|
| 302 |
+
|
| 303 |
+
with gr.Row():
|
| 304 |
+
like_btn = gr.Button(
|
| 305 |
+
"๐ SMASH LIKE (Sync Audio Resonance)",
|
| 306 |
+
variant="primary",
|
| 307 |
+
size="lg"
|
| 308 |
+
)
|
| 309 |
+
sub_btn = gr.Button(
|
| 310 |
+
"๐ SUBSCRIBE TO THE SPORES",
|
| 311 |
+
variant="secondary"
|
| 312 |
+
)
|
| 313 |
+
|
| 314 |
+
gr.Markdown("---")
|
| 315 |
+
gr.Markdown("### ๐ฌ Hype Live Chat Feed")
|
| 316 |
+
|
| 317 |
+
gr.HTML("""
|
| 318 |
+
<div style="background: #090e0b; padding: 12px; border-radius: 8px; border: 1px solid rgba(82, 255, 107, 0.2); height: 110px; overflow-y: auto; font-family: 'Courier New', monospace; font-size: 11px; color: #a8ffa2; line-height: 1.5;">
|
| 319 |
+
<div><span style="color: #ff4500; font-weight: bold;">[ShroomKing420]:</span> GEMMA IS LITERALLY UNHINGED TODAY LMAOOO ๐ฅ๐ฅ๐ฅ</div>
|
| 320 |
+
<div><span style="color: #00f2fe; font-weight: bold;">[Spore_Chaser]:</span> Wait... is the matrix actually glitched?! Look at the canvas tab!!</div>
|
| 321 |
+
<div><span style="color: #e91e63; font-weight: bold;">[Mod_Myco]:</span> Click the like button to feed the neural network!</div>
|
| 322 |
+
<div><span style="color: #ffeb3b; font-weight: bold;">[Gemma_Stan]:</span> WE ARE WITNESSING FOREST HISTORY RIGHT NOW FOLKS ๐๐๐</div>
|
| 323 |
+
</div>
|
| 324 |
+
""")
|
| 325 |
+
|