diff --git a/ev/landing.sune b/ev/landing.sune index 923ce67..4a754e6 100644 --- a/ev/landing.sune +++ b/ev/landing.sune @@ -1 +1 @@ -[{"id":"fsr2nfx","name":"4ev Landing","pinned":false,"avatar":"","url":"gh://multipleof4/.sune/ev/landing.sune","updatedAt":1758951978822,"settings":{"model":"google/gemini-2.5-pro","temperature":"","top_p":"","top_k":"","frequency_penalty":"","repetition_penalty":"","min_p":"","top_a":"","verbosity":"","reasoning_effort":"default","system_prompt":"","html":"\n
$el.querySelector(q);\n const cacheKey = `sune_input_${window.SUNE?.id || 'shortener'}`;\n\n const loadScript = (src, check) => new Promise((res, rej) => {\n if (window[check]) return res();\n const s = document.createElement('script');\n s.src = src;\n s.async = s.defer = true;\n s.onload = res;\n s.onerror = () => rej(`Failed to load ${src}`);\n document.head.appendChild(s);\n });\n\n const f = $('#shorten-form'), i = $('#url-input'), sb = $('#submit-button');\n const m = $('#message-area'), rb = $('#result-container'), ro = $('#result-output');\n const cb = $('#copy-button'), ob = $('#open-link-button');\n\n const norm = s => { try { return new URL((s=s.trim()).includes('://') ? s : 'https://' + s).href } catch { return '' } };\n \n i.value = localStorage.getItem(cacheKey) || '';\n\n loadScript('https://www.google.com/recaptcha/api.js', 'grecaptcha')\n .catch(() => m.textContent = 'Could not load CAPTCHA.');\n\n f.onsubmit = async e => {\n e.preventDefault();\n m.textContent = '';\n const u = norm(i.value);\n if (!u) return m.textContent = 'Please enter a valid URL.';\n \n if (typeof grecaptcha === 'undefined') return m.textContent = 'CAPTCHA not ready. Please refresh.';\n const token = grecaptcha.getResponse();\n if (!token) return m.textContent = 'Please complete the CAPTCHA.';\n \n sb.disabled = true;\n sb.innerHTML = '…';\n \n try {\n const r = await fetch('https://4ev.link/api/create', {\n method: 'POST',\n headers: {'Content-Type': 'application/json'},\n body: JSON.stringify({url: u, token})\n });\n if (!r.ok) throw new Error(await r.text() || `Request failed with status ${r.status}`);\n const d = await r.json();\n rb.hidden = false;\n ro.value = d.shortUrl;\n ob.href = d.shortUrl;\n } catch (err) {\n rb.hidden = true;\n m.textContent = err.message || 'An unknown error occurred.';\n } finally {\n grecaptcha.reset();\n sb.disabled = false;\n sb.innerHTML = 'Shorten';\n }\n };\n\n cb.onclick = async () => {\n ro.select();\n try {\n await navigator.clipboard.writeText(ro.value);\n cb.innerHTML = ``;\n lucide.createIcons();\n setTimeout(() => {\n cb.innerHTML = ``;\n lucide.createIcons();\n }, 1200);\n } catch {}\n };\n\n ro.onclick = () => ro.select();\n i.oninput = () => {\n rb.hidden = true;\n m.textContent = '';\n localStorage.setItem(cacheKey, i.value);\n };\n\" class=\"relative bg-gray-50 dark:bg-neutral-950 text-gray-800 dark:text-gray-300 antialiased w-full rounded-2xl border border-gray-200 dark:border-neutral-800 overflow-hidden\">\n v1.0.3\n
\n

\n Links that last forever.\n

\n

\n A simple, fast, and reliable URL shortener.\n

\n\n
\n
\n \n \n
\n
\n
\n\n \n\n

\n
\n
\n","extension_html":"","hide_composer":false,"include_thoughts":false,"json_output":false,"ignore_master_prompt":false,"json_schema":""},"storage":{}}] \ No newline at end of file +[{"id":"fsr2nfx","name":"4ev Landing","pinned":false,"avatar":"","url":"gh://multipleof4/.sune/ev/landing.sune","updatedAt":1758952370286,"settings":{"model":"google/gemini-2.5-pro","temperature":"","top_p":"","top_k":"","frequency_penalty":"","repetition_penalty":"","min_p":"","top_a":"","verbosity":"","reasoning_effort":"default","system_prompt":"","html":"\n
$el.querySelector(q);\n\n const loadScript = (src, check) => new Promise((res, rej) => {\n if (window[check]) return res();\n const s = document.createElement('script');\n s.src = src;\n s.async = s.defer = true;\n s.onload = res;\n s.onerror = () => rej(`Failed to load ${src}`);\n document.head.appendChild(s);\n });\n\n const f = $('#shorten-form'), i = $('#url-input'), sb = $('#submit-button');\n const m = $('#message-area'), rb = $('#result-container'), ro = $('#result-output');\n const cb = $('#copy-button'), ob = $('#open-link-button');\n\n const norm = s => { try { return new URL((s=s.trim()).includes('://') ? s : 'https://' + s).href } catch { return '' } };\n\n loadScript('https://www.google.com/recaptcha/api.js', 'grecaptcha')\n .catch(() => m.textContent = 'Could not load CAPTCHA.');\n\n f.onsubmit = async e => {\n e.preventDefault();\n m.textContent = '';\n const u = norm(i.value);\n if (!u) return m.textContent = 'Please enter a valid URL.';\n \n if (typeof grecaptcha === 'undefined') return m.textContent = 'CAPTCHA not ready. Please refresh.';\n const token = grecaptcha.getResponse();\n if (!token) return m.textContent = 'Please complete the CAPTCHA.';\n \n sb.disabled = true;\n sb.innerHTML = '…';\n \n try {\n const r = await fetch('https://4ev.link/api/create', {\n method: 'POST',\n headers: {'Content-Type': 'application/json'},\n body: JSON.stringify({url: u, token})\n });\n if (!r.ok) throw new Error(await r.text() || `Request failed with status ${r.status}`);\n const d = await r.json();\n rb.hidden = false;\n ro.value = d.shortUrl;\n ob.href = d.shortUrl;\n } catch (err) {\n rb.hidden = true;\n m.textContent = err.message || 'An unknown error occurred.';\n } finally {\n grecaptcha.reset();\n sb.disabled = false;\n sb.innerHTML = 'Shorten';\n }\n };\n\n cb.onclick = async () => {\n ro.select();\n try {\n await navigator.clipboard.writeText(ro.value);\n cb.innerHTML = ``;\n lucide.createIcons();\n setTimeout(() => {\n cb.innerHTML = ``;\n lucide.createIcons();\n }, 1200);\n } catch {}\n };\n\n ro.onclick = () => ro.select();\n i.oninput = () => {\n rb.hidden = true;\n m.textContent = '';\n };\n\" class=\"relative bg-gray-50 dark:bg-neutral-950 text-gray-800 dark:text-gray-300 antialiased w-full rounded-2xl border border-gray-200 dark:border-neutral-800 overflow-hidden\">\n v1.0.4\n
\n

\n Links that last forever.\n

\n

\n A simple, fast, and reliable URL shortener.\n

\n\n
\n
\n \n \n
\n
\n
\n\n \n\n

\n
\n
\n","extension_html":"","hide_composer":true,"include_thoughts":false,"json_output":false,"ignore_master_prompt":false,"json_schema":""},"storage":{}}] \ No newline at end of file