Spaces:
Running
Running
Promote version 9d89cba to main
Browse filesPromoted commit 9d89cba4b3a4f5b1220451d131ad4ad5b52d4eb5 to main branch
- index.html +325 -3
index.html
CHANGED
|
@@ -1638,7 +1638,105 @@
|
|
| 1638 |
</button>
|
| 1639 |
</div>
|
| 1640 |
</div>
|
| 1641 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1642 |
|
| 1643 |
<section class="section container" id="features">
|
| 1644 |
<div class="section-header">
|
|
@@ -1879,11 +1977,19 @@
|
|
| 1879 |
burger.classList.toggle('open');
|
| 1880 |
mobileNav.classList.toggle('open');
|
| 1881 |
});
|
|
|
|
| 1882 |
document.querySelectorAll('#nav-start,#mobile-start,#hero-start,#bottom-start').forEach(btn => {
|
| 1883 |
btn.addEventListener('click', () => {
|
| 1884 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1885 |
});
|
| 1886 |
});
|
|
|
|
| 1887 |
const yearEl = document.getElementById('year');
|
| 1888 |
if (yearEl) yearEl.textContent = new Date().getFullYear();
|
| 1889 |
|
|
@@ -1896,7 +2002,223 @@
|
|
| 1896 |
sessionCountEl.textContent = base.toLocaleString('en-US');
|
| 1897 |
}, 1800);
|
| 1898 |
}
|
| 1899 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1900 |
<script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
|
| 1901 |
</body>
|
| 1902 |
</html>
|
|
|
|
| 1638 |
</button>
|
| 1639 |
</div>
|
| 1640 |
</div>
|
| 1641 |
+
|
| 1642 |
+
<div class="hero-right">
|
| 1643 |
+
<div class="hero-card">
|
| 1644 |
+
<div class="hero-card-inner">
|
| 1645 |
+
<div class="hero-card-header">
|
| 1646 |
+
<div class="window-dots">
|
| 1647 |
+
<span class="window-dot red"></span>
|
| 1648 |
+
<span class="window-dot yellow"></span>
|
| 1649 |
+
<span class="window-dot green"></span>
|
| 1650 |
+
</div>
|
| 1651 |
+
<div class="hero-card-title">
|
| 1652 |
+
flashcode-session.js
|
| 1653 |
+
<span class="status">LIVE</span>
|
| 1654 |
+
</div>
|
| 1655 |
+
</div>
|
| 1656 |
+
<div class="hero-card-tabs">
|
| 1657 |
+
<button class="hero-tab active" type="button" data-tab="frontend">
|
| 1658 |
+
<span class="dot"></span> Frontend
|
| 1659 |
+
</button>
|
| 1660 |
+
<button class="hero-tab" type="button" data-tab="backend">
|
| 1661 |
+
<span class="dot"></span> Backend
|
| 1662 |
+
</button>
|
| 1663 |
+
<button class="hero-tab" type="button" data-tab="fix">
|
| 1664 |
+
<span class="dot"></span> Bug Fix
|
| 1665 |
+
</button>
|
| 1666 |
+
</div>
|
| 1667 |
+
<div class="hero-card-body">
|
| 1668 |
+
<div class="hero-prompt">
|
| 1669 |
+
<div class="prompt-label">Prompt</div>
|
| 1670 |
+
<div class="prompt-input-wrap">
|
| 1671 |
+
<textarea class="prompt-textarea" id="prompt-input" spellcheck="false">Create a responsive Tailwind navbar with a logo on the left and a "Deploy" button on the right.</textarea>
|
| 1672 |
+
<div class="prompt-footer">
|
| 1673 |
+
<div class="prompt-shortcuts">
|
| 1674 |
+
<span class="kbd">β</span><span>+ Enter to run</span>
|
| 1675 |
+
</div>
|
| 1676 |
+
<span style="font-variant-numeric: tabular-nums;">Tokens: <span id="token-count">37</span></span>
|
| 1677 |
+
</div>
|
| 1678 |
+
</div>
|
| 1679 |
+
<div class="hero-run-row">
|
| 1680 |
+
<span class="badge-speed">
|
| 1681 |
+
<span class="spark">β‘</span>
|
| 1682 |
+
Under 500ms average
|
| 1683 |
+
</span>
|
| 1684 |
+
<small>Ultraβlow latency in 190+ regions.</small>
|
| 1685 |
+
<button class="run-button" type="button" id="run-button">
|
| 1686 |
+
Build code
|
| 1687 |
+
<span class="icon">β΅</span>
|
| 1688 |
+
</button>
|
| 1689 |
+
</div>
|
| 1690 |
+
<div class="sidebar-ad">
|
| 1691 |
+
<div class="sidebar-ad-title">
|
| 1692 |
+
<strong>Boost your PR reviews</strong>
|
| 1693 |
+
<span class="ad-tag">Sponsored</span>
|
| 1694 |
+
</div>
|
| 1695 |
+
<div class="sidebar-ad-body">
|
| 1696 |
+
<span>Ship clean code faster with MergeLens β AI summaries for every pull request.</span>
|
| 1697 |
+
</div>
|
| 1698 |
+
<button class="sidebar-ad-cta" type="button">
|
| 1699 |
+
Add to GitHub
|
| 1700 |
+
<span style="font-size:11px;">β</span>
|
| 1701 |
+
</button>
|
| 1702 |
+
</div>
|
| 1703 |
+
</div>
|
| 1704 |
+
<div class="hero-output">
|
| 1705 |
+
<div class="output-header">
|
| 1706 |
+
<span>Output preview</span>
|
| 1707 |
+
<span class="status-badge" id="output-status">
|
| 1708 |
+
<span class="status-dot"></span>
|
| 1709 |
+
Ready in ~0.4s
|
| 1710 |
+
</span>
|
| 1711 |
+
</div>
|
| 1712 |
+
<div class="output-console" id="output-console">
|
| 1713 |
+
<pre id="output-text">
|
| 1714 |
+
// Your Tailwind navbar is ready π§
|
| 1715 |
+
<nav class="w-full border-b bg-slate-950/70 backdrop-blur">
|
| 1716 |
+
<div class="mx-auto flex max-w-6xl items-center justify-between px-4 py-3">
|
| 1717 |
+
<a href="/" class="flex items-center gap-2">
|
| 1718 |
+
<span class="flex h-7 w-7 items-center justify-center rounded-xl bg-gradient-to-tr from-sky-500 to-emerald-400 text-xs font-semibold text-slate-950 shadow-lg">
|
| 1719 |
+
FC
|
| 1720 |
+
</span>
|
| 1721 |
+
<span class="text-sm font-semibold tracking-wide text-slate-100">FlashCode</span>
|
| 1722 |
+
</a>
|
| 1723 |
+
<button class="rounded-full bg-sky-500 px-4 py-1.5 text-xs font-semibold text-slate-950 shadow-md transition hover:bg-sky-400">
|
| 1724 |
+
Deploy
|
| 1725 |
+
</button>
|
| 1726 |
+
</div>
|
| 1727 |
+
</nav><span class="caret"></span></pre>
|
| 1728 |
+
</div>
|
| 1729 |
+
<div class="output-stats">
|
| 1730 |
+
<span class="time" id="time-stat">0.41s</span>
|
| 1731 |
+
<span class="tokens" id="tokens-stat">104 tokens</span>
|
| 1732 |
+
<span class="speed" id="speed-stat">238 LOC / sec</span>
|
| 1733 |
+
</div>
|
| 1734 |
+
</div>
|
| 1735 |
+
</div>
|
| 1736 |
+
</div>
|
| 1737 |
+
</div>
|
| 1738 |
+
</div>
|
| 1739 |
+
</section>
|
| 1740 |
|
| 1741 |
<section class="section container" id="features">
|
| 1742 |
<div class="section-header">
|
|
|
|
| 1977 |
burger.classList.toggle('open');
|
| 1978 |
mobileNav.classList.toggle('open');
|
| 1979 |
});
|
| 1980 |
+
|
| 1981 |
document.querySelectorAll('#nav-start,#mobile-start,#hero-start,#bottom-start').forEach(btn => {
|
| 1982 |
btn.addEventListener('click', () => {
|
| 1983 |
+
const promptInput = document.getElementById('prompt-input');
|
| 1984 |
+
if (promptInput) {
|
| 1985 |
+
promptInput.focus();
|
| 1986 |
+
promptInput.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
| 1987 |
+
} else {
|
| 1988 |
+
window.location.hash = '#top';
|
| 1989 |
+
}
|
| 1990 |
});
|
| 1991 |
});
|
| 1992 |
+
|
| 1993 |
const yearEl = document.getElementById('year');
|
| 1994 |
if (yearEl) yearEl.textContent = new Date().getFullYear();
|
| 1995 |
|
|
|
|
| 2002 |
sessionCountEl.textContent = base.toLocaleString('en-US');
|
| 2003 |
}, 1800);
|
| 2004 |
}
|
| 2005 |
+
|
| 2006 |
+
const promptInput = document.getElementById('prompt-input');
|
| 2007 |
+
const tokenCountEl = document.getElementById('token-count');
|
| 2008 |
+
if (promptInput && tokenCountEl) {
|
| 2009 |
+
const updateTokens = () => {
|
| 2010 |
+
const text = promptInput.value.trim();
|
| 2011 |
+
const tokens = text ? text.split(/\s+/).length : 0;
|
| 2012 |
+
tokenCountEl.textContent = tokens;
|
| 2013 |
+
};
|
| 2014 |
+
promptInput.addEventListener('input', updateTokens);
|
| 2015 |
+
updateTokens();
|
| 2016 |
+
}
|
| 2017 |
+
|
| 2018 |
+
const runButton = document.getElementById('run-button');
|
| 2019 |
+
const outputConsole = document.getElementById('output-console');
|
| 2020 |
+
const outputText = document.getElementById('output-text');
|
| 2021 |
+
const outputStatus = document.getElementById('output-status');
|
| 2022 |
+
const timeStat = document.getElementById('time-stat');
|
| 2023 |
+
const tokensStat = document.getElementById('tokens-stat');
|
| 2024 |
+
const speedStat = document.getElementById('speed-stat');
|
| 2025 |
+
|
| 2026 |
+
const snippets = {
|
| 2027 |
+
frontend: {
|
| 2028 |
+
prompt: 'Create a responsive Tailwind navbar with a logo on the left and a "Deploy" button on the right.',
|
| 2029 |
+
code: `// Generated React + Tailwind header component π
|
| 2030 |
+
export function AppHeader() {
|
| 2031 |
+
return (
|
| 2032 |
+
<header className="border-b border-slate-800 bg-slate-950/70 backdrop-blur">
|
| 2033 |
+
<div className="mx-auto flex max-w-5xl items-center justify-between px-4 py-3">
|
| 2034 |
+
<a href="/" className="flex items-center gap-2">
|
| 2035 |
+
<span className="flex h-8 w-8 items-center justify-center rounded-2xl bg-gradient-to-tr from-sky-500 via-emerald-400 to-violet-500 text-xs font-semibold text-slate-950 shadow-lg">
|
| 2036 |
+
FC
|
| 2037 |
+
</span>
|
| 2038 |
+
<span className="text-sm font-semibold tracking-wide text-slate-100">
|
| 2039 |
+
FlashCode
|
| 2040 |
+
</span>
|
| 2041 |
+
</a>
|
| 2042 |
+
|
| 2043 |
+
<nav className="hidden items-center gap-6 text-xs text-slate-300 sm:flex">
|
| 2044 |
+
<a href="#features" className="hover:text-white">Features</a>
|
| 2045 |
+
<a href="#how-it-works" className="hover:text-white">Workflow</a>
|
| 2046 |
+
<a href="#pricing" className="hover:text-white">Pricing</a>
|
| 2047 |
+
</nav>
|
| 2048 |
+
|
| 2049 |
+
<button className="inline-flex items-center gap-1.5 rounded-full bg-sky-500 px-4 py-1.5 text-xs font-semibold text-slate-950 shadow-md shadow-sky-500/40 transition hover:bg-sky-400">
|
| 2050 |
+
<span>Deploy</span>
|
| 2051 |
+
<span className="text-[11px]">β‘</span>
|
| 2052 |
+
</button>
|
| 2053 |
+
</div>
|
| 2054 |
+
</header>
|
| 2055 |
+
);
|
| 2056 |
+
}`,
|
| 2057 |
+
time: '0.42s',
|
| 2058 |
+
tokens: '118 tokens',
|
| 2059 |
+
speed: '244 LOC / sec'
|
| 2060 |
+
},
|
| 2061 |
+
backend: {
|
| 2062 |
+
prompt: 'Generate an Express.js endpoint that returns the latest 10 build logs as JSON.',
|
| 2063 |
+
code: `// Minimal Express.js endpoint for latest build logs βοΈ
|
| 2064 |
+
import express from "express";
|
| 2065 |
+
|
| 2066 |
+
const app = express();
|
| 2067 |
+
|
| 2068 |
+
// In-memory demo data β swap with your DB client.
|
| 2069 |
+
let logs = [
|
| 2070 |
+
{ id: "bld_01", status: "success", durationMs: 384, createdAt: new Date().toISOString() },
|
| 2071 |
+
{ id: "bld_02", status: "failed", durationMs: 1021, createdAt: new Date().toISOString() },
|
| 2072 |
+
// ...
|
| 2073 |
+
];
|
| 2074 |
+
|
| 2075 |
+
// GET /api/builds/latest
|
| 2076 |
+
app.get("/api/builds/latest", (req, res) => {
|
| 2077 |
+
const limit = Number(req.query.limit ?? 10);
|
| 2078 |
+
const latest = logs
|
| 2079 |
+
.slice()
|
| 2080 |
+
.sort((a, b) => new Date(b.createdAt) - new Date(a.createdAt))
|
| 2081 |
+
.slice(0, limit);
|
| 2082 |
+
|
| 2083 |
+
res.json({
|
| 2084 |
+
count: latest.length,
|
| 2085 |
+
builds: latest,
|
| 2086 |
+
});
|
| 2087 |
+
});
|
| 2088 |
+
|
| 2089 |
+
// Start server
|
| 2090 |
+
const port = process.env.PORT ?? 3000;
|
| 2091 |
+
app.listen(port, () => {
|
| 2092 |
+
console.log(\`FlashCode build API listening on :\${port}\`);
|
| 2093 |
+
});`,
|
| 2094 |
+
time: '0.39s',
|
| 2095 |
+
tokens: '152 tokens',
|
| 2096 |
+
speed: '267 LOC / sec'
|
| 2097 |
+
},
|
| 2098 |
+
fix: {
|
| 2099 |
+
prompt: 'Fix this React useEffect that runs on every render instead of only once.',
|
| 2100 |
+
code: `// Fixed: run effect only once on mount β
|
| 2101 |
+
import { useEffect } from "react";
|
| 2102 |
+
|
| 2103 |
+
export function FlashCounter({ start = 0 }) {
|
| 2104 |
+
useEffect(() => {
|
| 2105 |
+
let frame;
|
| 2106 |
+
let count = start;
|
| 2107 |
+
|
| 2108 |
+
const tick = () => {
|
| 2109 |
+
count += 1;
|
| 2110 |
+
console.log("Tick:", count);
|
| 2111 |
+
frame = requestAnimationFrame(tick);
|
| 2112 |
+
};
|
| 2113 |
+
|
| 2114 |
+
// Start once on mount
|
| 2115 |
+
frame = requestAnimationFrame(tick);
|
| 2116 |
+
|
| 2117 |
+
// Cleanup on unmount
|
| 2118 |
+
return () => {
|
| 2119 |
+
if (frame) cancelAnimationFrame(frame);
|
| 2120 |
+
};
|
| 2121 |
+
}, [start]); // β
Only re-run if "start" changes
|
| 2122 |
+
|
| 2123 |
+
return null;
|
| 2124 |
+
}`,
|
| 2125 |
+
time: '0.34s',
|
| 2126 |
+
tokens: '96 tokens',
|
| 2127 |
+
speed: '221 LOC / sec'
|
| 2128 |
+
}
|
| 2129 |
+
};
|
| 2130 |
+
|
| 2131 |
+
const tabs = document.querySelectorAll('.hero-tab');
|
| 2132 |
+
tabs.forEach(tab => {
|
| 2133 |
+
tab.addEventListener('click', () => {
|
| 2134 |
+
tabs.forEach(t => t.classList.remove('active'));
|
| 2135 |
+
tab.classList.add('active');
|
| 2136 |
+
const key = tab.getAttribute('data-tab');
|
| 2137 |
+
const data = snippets[key];
|
| 2138 |
+
if (!data || !promptInput || !outputText) return;
|
| 2139 |
+
promptInput.value = data.prompt;
|
| 2140 |
+
outputText.innerHTML = data.code.replace(/</g, '<').replace(/>/g, '>') + '<span class="caret"></span>';
|
| 2141 |
+
if (tokenCountEl) {
|
| 2142 |
+
const tokens = data.prompt.split(/\s+/).length;
|
| 2143 |
+
tokenCountEl.textContent = tokens;
|
| 2144 |
+
}
|
| 2145 |
+
if (timeStat) timeStat.textContent = data.time;
|
| 2146 |
+
if (tokensStat) tokensStat.textContent = data.tokens;
|
| 2147 |
+
if (speedStat) speedStat.textContent = data.speed;
|
| 2148 |
+
if (outputStatus) {
|
| 2149 |
+
outputStatus.innerHTML = '<span class="status-dot"></span>Ready in ~' + data.time;
|
| 2150 |
+
}
|
| 2151 |
+
});
|
| 2152 |
+
});
|
| 2153 |
+
|
| 2154 |
+
if (runButton && promptInput && outputText) {
|
| 2155 |
+
const run = () => {
|
| 2156 |
+
if (runButton.disabled) return;
|
| 2157 |
+
runButton.disabled = true;
|
| 2158 |
+
const originalLabel = runButton.innerHTML;
|
| 2159 |
+
runButton.innerHTML = '<span class="icon">β‘</span>Building...';
|
| 2160 |
+
|
| 2161 |
+
if (outputStatus) {
|
| 2162 |
+
outputStatus.innerHTML = '<span class="status-dot" style="background:#facc15;box-shadow:0 0 8px rgba(250,204,21,0.9);"></span>Generating...';
|
| 2163 |
+
}
|
| 2164 |
+
|
| 2165 |
+
const text = promptInput.value.trim();
|
| 2166 |
+
const pseudoTokens = text ? text.split(/\s+/).length : 0;
|
| 2167 |
+
const simulatedTime = Math.max(0.24, Math.min(0.85, 0.15 + pseudoTokens * 0.012));
|
| 2168 |
+
const timeDisplay = simulatedTime.toFixed(2) + 's';
|
| 2169 |
+
if (timeStat) timeStat.textContent = timeDisplay;
|
| 2170 |
+
if (tokensStat) tokensStat.textContent = pseudoTokens + ' tokens';
|
| 2171 |
+
if (speedStat) speedStat.textContent = (180 + Math.floor(Math.random() * 160)) + ' LOC / sec';
|
| 2172 |
+
|
| 2173 |
+
if (outputText && outputConsole) {
|
| 2174 |
+
const baseCode = `// FlashCode result for:
|
| 2175 |
+
// "${text || 'your latest prompt'}"
|
| 2176 |
+
`;
|
| 2177 |
+
outputText.textContent = baseCode;
|
| 2178 |
+
}
|
| 2179 |
+
|
| 2180 |
+
let progress = 0;
|
| 2181 |
+
const interval = 22;
|
| 2182 |
+
const totalSteps = Math.ceil((simulatedTime * 1000) / interval);
|
| 2183 |
+
const lines = [
|
| 2184 |
+
'function flashCode() {',
|
| 2185 |
+
' console.log("β‘ Blazing fast AI code builder.");',
|
| 2186 |
+
' return "Production-ready in milliseconds";',
|
| 2187 |
+
'}',
|
| 2188 |
+
'',
|
| 2189 |
+
'export default flashCode;'
|
| 2190 |
+
];
|
| 2191 |
+
const joined = lines.join('\n');
|
| 2192 |
+
const charsPerStep = joined.length / totalSteps;
|
| 2193 |
+
|
| 2194 |
+
const streamInterval = setInterval(() => {
|
| 2195 |
+
progress += charsPerStep;
|
| 2196 |
+
const slice = joined.slice(0, progress);
|
| 2197 |
+
outputText.textContent = `// FlashCode result for:
|
| 2198 |
+
// "${text || 'your latest prompt'}"
|
| 2199 |
+
|
| 2200 |
+
${slice}`;
|
| 2201 |
+
if (progress >= joined.length) {
|
| 2202 |
+
clearInterval(streamInterval);
|
| 2203 |
+
outputText.innerHTML = outputText.textContent.replace(/</g, '<').replace(/>/g, '>') + '<span class="caret"></span>';
|
| 2204 |
+
if (outputStatus) {
|
| 2205 |
+
outputStatus.innerHTML = '<span class="status-dot"></span>Ready in ~' + timeDisplay;
|
| 2206 |
+
}
|
| 2207 |
+
runButton.disabled = false;
|
| 2208 |
+
runButton.innerHTML = originalLabel;
|
| 2209 |
+
}
|
| 2210 |
+
}, interval);
|
| 2211 |
+
};
|
| 2212 |
+
|
| 2213 |
+
runButton.addEventListener('click', run);
|
| 2214 |
+
promptInput.addEventListener('keydown', (e) => {
|
| 2215 |
+
if ((e.metaKey || e.ctrlKey) && e.key === 'Enter') {
|
| 2216 |
+
e.preventDefault();
|
| 2217 |
+
run();
|
| 2218 |
+
}
|
| 2219 |
+
});
|
| 2220 |
+
}
|
| 2221 |
+
</script>
|
| 2222 |
<script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
|
| 2223 |
</body>
|
| 2224 |
</html>
|