Frontend: add on-brand SVG favicon
Dark tile with white "R" + pink underscore (the RADICAL_SEARCH logo mark). Served at /favicon.svg and /favicon.ico; linked from every page head. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
dda197bd83
commit
d74af763b7
1 changed files with 17 additions and 0 deletions
|
|
@ -129,10 +129,18 @@ const THEME_JS = `
|
||||||
});
|
});
|
||||||
`
|
`
|
||||||
|
|
||||||
|
// On-brand favicon: dark tile, white "R", accent-pink underscore (the logo mark).
|
||||||
|
const FAVICON = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
|
||||||
|
<rect width="32" height="32" rx="6" fill="#0a0a0a"/>
|
||||||
|
<text x="16" y="21.5" font-family="'Roboto Mono',ui-monospace,monospace" font-size="20" font-weight="700" fill="#ffffff" text-anchor="middle">R</text>
|
||||||
|
<rect x="9" y="24" width="14" height="3" rx="1" fill="#ff0099"/>
|
||||||
|
</svg>`
|
||||||
|
|
||||||
function layout(title: string, body: string) {
|
function layout(title: string, body: string) {
|
||||||
return `<!DOCTYPE html><html lang="en"><head>
|
return `<!DOCTYPE html><html lang="en"><head>
|
||||||
<meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1">
|
<meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1">
|
||||||
<title>${title}</title>
|
<title>${title}</title>
|
||||||
|
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
|
||||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||||
<style>${CSS}</style>
|
<style>${CSS}</style>
|
||||||
|
|
@ -241,6 +249,15 @@ export default {
|
||||||
async fetch(req: Request, env: { API_URL: string }) {
|
async fetch(req: Request, env: { API_URL: string }) {
|
||||||
const url = new URL(req.url)
|
const url = new URL(req.url)
|
||||||
|
|
||||||
|
if (url.pathname === '/favicon.svg' || url.pathname === '/favicon.ico') {
|
||||||
|
return new Response(FAVICON, {
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'image/svg+xml',
|
||||||
|
'Cache-Control': 'public, max-age=86400',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
if (url.pathname === '/') {
|
if (url.pathname === '/') {
|
||||||
// Accept a query on the root too (e.g. /?q=what) — redirect to the
|
// Accept a query on the root too (e.g. /?q=what) — redirect to the
|
||||||
// canonical results URL so the search actually runs.
|
// canonical results URL so the search actually runs.
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue