add theme color

This commit is contained in:
Nicholas Jitkoff 2022-06-18 19:07:47 -07:00
parent 6bf1c470cc
commit 3cb70dc14c
3 changed files with 19 additions and 3 deletions

View file

@ -2,7 +2,11 @@ body {
font-family: sans-serif;
}
@media(prefers-color-scheme: dark){body{color:white;background-color:#111;}}
@media(prefers-color-scheme: dark){
body{
color:white;
background-color:#121212;
}}
#iframe {
border: none;

View file

@ -4,9 +4,10 @@
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, viewport-fit=cover">
<meta name="description" content="itty bitty things can be conveyed in a link.">
<meta id="themeColor" name="theme-color">
<link id="favicon" rel="icon" href='/favicon.svg'>
<link rel="stylesheet" href="/index.css">
<meta id="themeColor" name="theme-color" content="white" media="(prefers-color-scheme: light)">
<meta id="themeColorDark" name="theme-color" content="#121212" media="(prefers-color-scheme: dark)">
<link rel="manifest" href="/manifest.json">
<script src="/js/lzma/lzma-d-min.js"></script>
<script src="/js/lzma/lzma_worker-min.js"></script>
@ -16,5 +17,5 @@
<script nomodule> location.href = "/v1/" + location.hash </script>
<noscript>itty.bitty requires JavaScript.</noscript>
</head>
<iframe id="iframe" sandbox="allow-downloads allow-scripts allow-forms allow-top-navigation allow-popups allow-modals allow-popups-to-escape-sandbox"></iframe>
<iframe id="iframe" sandbox="allow-same-origin allow-downloads allow-scripts allow-forms allow-top-navigation allow-popups allow-modals allow-popups-to-escape-sandbox"></iframe>
</html>

View file

@ -0,0 +1,11 @@
export default async (request, context) => {
let url = new URL(request.url);
let durl = url.search.substring(1);
let components = durl.split(",");
let data = components.pop();
components = components.shift().split(":");
let type = components.pop();
return new Response(data, {
headers: { "content-type": type},
});
}