Skip to content

armgit / kokon

Public Imported from GitHub
0

Edit photos by describing the change, on your own GPU. A free, open-source alternative to Nano Banana and ChatGPT image editing: photos stay on your computer, no daily limit. One installer for Windows, Mac and Linux sets up the best open model (Qwen-Image 2.1). MCP server for AI agents.

Site: after a download starts, ask once for a GitHub star

Gabriele Lozuponefe8ec389d296
diff --git a/site/404.html b/site/404.html
index 04f4eae..60dd1a5 100644
--- a/site/404.html
+++ b/site/404.html
@@ -9,7 +9,7 @@
<link rel="icon" href="/assets/favicon.ico" sizes="any">
<link rel="apple-touch-icon" href="/assets/apple-touch-icon.png">
<link href="https://fonts.googleapis.com/css2?family=Inter:opsz,[email protected],400..700&display=swap" rel="stylesheet">
-<link rel="stylesheet" href="/assets/style.css?v=4">
+<link rel="stylesheet" href="/assets/style.css?v=5">
</head>
<body>
<main class="final" style="min-height:100vh;display:grid;place-items:center;padding:40px 0">
diff --git a/site/assets/style.css b/site/assets/style.css
index 5c9c374..8e3d948 100644
--- a/site/assets/style.css
+++ b/site/assets/style.css
@@ -209,6 +209,18 @@ footer nav { display: flex; gap: 22px; flex-wrap: wrap; }
footer a:hover { color: var(--text); }
.legal { width: 100%; font-size: 12.5px; color: var(--text-3); opacity: 0.8; }
+/* Star request, shown once after a download starts */
+.star-ask { width: min(440px, calc(100% - 32px)); padding: 0; border: 0; border-radius: var(--radius); background: var(--bg-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-hi), 0 30px 90px rgba(0,0,0,0.6); text-align: center; }
+.star-ask[open] { animation: star-ask-in 0.35s cubic-bezier(0.16, 1, 0.3, 1); }
+.star-ask::backdrop { background: rgba(0,0,0,0.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
+.star-ask > div { padding: 34px 26px 28px; }
+.star-ask .mark { width: 34px; height: 34px; margin: 0 auto 18px; }
+.star-ask h2 { font-size: 23px; line-height: 1.2; letter-spacing: -0.025em; max-width: none; margin-bottom: 10px; }
+.star-ask p { margin: 0; font-size: 15.5px; color: var(--text-2); }
+.star-ask .ctas { margin-top: 26px; gap: 10px; }
+@keyframes star-ask-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } }
+@media (prefers-reduced-motion: reduce) { .star-ask[open] { animation: none; } }
+
/* Reveal */
.rv { opacity: 0; transform: translateY(28px); transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1), transform 0.9s cubic-bezier(0.16, 1, 0.3, 1); }
.rv.in { opacity: 1; transform: none; }
diff --git a/site/download.js b/site/download.js
index 2593011..b4c0a21 100644
--- a/site/download.js
+++ b/site/download.js
@@ -13,4 +13,21 @@
}),
)
.catch(() => {});
+
+ // Once the installer starts downloading, ask (once per browser) for a GitHub star.
+ // Not when the button fell back to the release page: that visitor is on GitHub already.
+ const ask = document.getElementById("star-ask");
+ if (!ask?.showModal) return;
+ const KEY = "kokon-star-asked";
+ const asked = () => { try { return localStorage.getItem(KEY); } catch { return null; } };
+ links.forEach((a) =>
+ a.addEventListener("click", () => {
+ if (asked() || !a.href.includes("/releases/download/")) return;
+ try { localStorage.setItem(KEY, "1"); } catch {}
+ // Let the browser show its download first.
+ setTimeout(() => ask.showModal(), 700);
+ }),
+ );
+ document.getElementById("star-ask-go").addEventListener("click", () => ask.close());
+ ask.addEventListener("click", (e) => { if (e.target === ask) ask.close(); });
})();
diff --git a/site/index.html b/site/index.html
index 017ee70..fd45885 100644
--- a/site/index.html
+++ b/site/index.html
@@ -90,7 +90,7 @@
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:opsz,[email protected],400..700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
-<link rel="stylesheet" href="assets/style.css?v=4">
+<link rel="stylesheet" href="assets/style.css?v=5">
<script type="application/ld+json">
{
"@context": "https://schema.org",
@@ -587,6 +587,17 @@
});
})();
</script>
+<dialog class="star-ask" id="star-ask" aria-labelledby="star-ask-title">
+ <div>
+ <svg class="mark"><use href="#mark"/></svg>
+ <h2 id="star-ask-title">Your download has started</h2>
+ <p>Kokon is free and open source, made by one person. If you like it, a star on GitHub helps other people find it and keeps the project going.</p>
+ <form method="dialog" class="ctas">
+ <a class="btn primary" id="star-ask-go" href="https://github.com/GabrieleLozupone/kokon" target="_blank" rel="noopener"><svg fill="currentColor"><use href="#github"/></svg>Star on GitHub</a>
+ <button class="btn ghost">Maybe later</button>
+ </form>
+ </div>
+</dialog>
<script src="/download.js" defer></script>
</body>
</html>
diff --git a/site/mcp-image-generation/index.html b/site/mcp-image-generation/index.html
index 3ff2efa..0c17ea7 100644
--- a/site/mcp-image-generation/index.html
+++ b/site/mcp-image-generation/index.html
@@ -22,7 +22,7 @@
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:opsz,[email protected],400..700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
-<link rel="stylesheet" href="../assets/style.css?v=4">
+<link rel="stylesheet" href="../assets/style.css?v=5">
<script type="application/ld+json">
{
"@context": "https://schema.org",
diff --git a/site/qwen-image-2-1-local/index.html b/site/qwen-image-2-1-local/index.html
index 2e5ec04..1c6c0df 100644
--- a/site/qwen-image-2-1-local/index.html
+++ b/site/qwen-image-2-1-local/index.html
@@ -22,7 +22,7 @@
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:opsz,[email protected],400..700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
-<link rel="stylesheet" href="../assets/style.css?v=4">
+<link rel="stylesheet" href="../assets/style.css?v=5">
<script type="application/ld+json">
{
"@context": "https://schema.org",