chore: deno fmt

This commit is contained in:
Max Richter
2025-11-02 21:58:02 +01:00
parent 21124dfe00
commit c13420c3ab
41 changed files with 324 additions and 254 deletions

View File

@@ -64,7 +64,8 @@ const Image = (
style={props.style}
srcset={responsiveAttributes.srcset}
sizes={responsiveAttributes.sizes}
src={`/api/images?image=${asset(props.src)}${props.width ? `&width=${props.width}` : ""
src={`/api/images?image=${asset(props.src)}${
props.width ? `&width=${props.width}` : ""
}${props.height ? `&height=${props.height}` : ""}`}
width={props.width}
height={props.height}

View File

@@ -20,7 +20,8 @@ function Wrapper(
) {
return (
<div
class={`flex justify-between flex-col relative w-full ${image ? "min-h-[400px]" : "min-h-[200px]"
class={`flex justify-between flex-col relative w-full ${
image ? "min-h-[400px]" : "min-h-[200px]"
} rounded-3xl overflow-hidden`}
>
<HeroContext.Provider value={{ image }}>
@@ -51,7 +52,8 @@ function Title(
return (
<OuterTag
href={link}
class={`${ctx.image ? "noisy-gradient" : ""
class={`${
ctx.image ? "noisy-gradient" : ""
} after:opacity-90 flex gap-4 items-center ${ctx.image ? "pt-12" : ""}`}
>
<h2
@@ -81,7 +83,8 @@ function EditLink({ href }: { href: string }) {
const ctx = useContext(HeroContext);
return (
<a
class={`px-4 py-2 ${ctx.image ? "bg-gray-300 text-gray-800" : "text-gray-200"
class={`px-4 py-2 ${
ctx.image ? "bg-gray-300 text-gray-800" : "text-gray-200"
} rounded-lg flex gap-1 items-center`}
href={href}
>

View File

@@ -73,4 +73,4 @@ export const IngredientsList: FunctionalComponent<
</tbody>
</table>
);
};
};

View File

@@ -6,7 +6,7 @@ type IconKey = keyof typeof icons;
export type MenuState = {
activeMenu: Signal<string>;
activeState: Signal<"input" | "error" | "normal" | "loading">;
loadingText:Signal<string>;
loadingText: Signal<string>;
commandInput: Signal<string>;
visible: Signal<boolean>;
menus: Record<string, Menu>;

View File

@@ -283,4 +283,3 @@ export default function useDebouncedCallback<
return debounced;
}

View File

@@ -52,4 +52,3 @@ const useThrottledCallback = (
};
export default useThrottledCallback;

View File

@@ -35,7 +35,8 @@ export async function summarize(content: string) {
{
role: "user",
content:
`Please summarize the article in one sentence as short as possible: ${content.slice(0, 2000)
`Please summarize the article in one sentence as short as possible: ${
content.slice(0, 2000)
}`,
},
],
@@ -102,7 +103,8 @@ export async function createGenres(
{
role: "system",
content:
`you create some keywords that can be used in a recommendation system. The keywords are based on a ${type} description or title. If you do not know the title, take into account the description aswell. Create a range of keywords from very specific ones that describe the general vibe. ${title ? `The name of the ${type} is ${title}` : ""
`you create some keywords that can be used in a recommendation system. The keywords are based on a ${type} description or title. If you do not know the title, take into account the description aswell. Create a range of keywords from very specific ones that describe the general vibe. ${
title ? `The name of the ${type} is ${title}` : ""
}. Return a list of around 20 keywords seperated by commas`,
},
{
@@ -166,7 +168,8 @@ export const getMovieRecommendations = async (
${keywords}
The movies should be similar to but not include ${exclude.join(", ")
The movies should be similar to but not include ${
exclude.join(", ")
} or remakes of that.
respond with a plain unordered list each item starting with the year the movie was released and then the title of the movie seperated by a -`,

View File

@@ -48,7 +48,8 @@ export async function endTask(chatId: string): Promise<string | null> {
finalNote += "**[Voice message could not be transcribed]**\n\n";
}
} else if (entry.type === "photo") {
const photoUrl = `${task.noteName.replace(/\.md$/, "")
const photoUrl = `${
task.noteName.replace(/\.md$/, "")
}/photo-${photoIndex++}.jpg`;
finalNote += `**Photo**:\n ${photoUrl}\n\n`;

View File

@@ -62,7 +62,8 @@ function parseParams(reqUrl: URL): ImageParams | string {
// Helper function to generate ETag
async function generateETag(content: ArrayBuffer): Promise<string> {
const hashBuffer = await crypto.subtle.digest("SHA-256", content);
return `"${Array.from(new Uint8Array(hashBuffer))
return `"${
Array.from(new Uint8Array(hashBuffer))
.map((b) => b.toString(16).padStart(2, "0"))
.join("")
}"`;

View File

@@ -70,7 +70,8 @@ async function processCreateRecipeFromUrl(
if (newRecipe?.image && newRecipe.image.length > 5) {
const extension = fileExtension(new URL(newRecipe.image).pathname);
const finalPath = `resources/recipes/images/${safeFileName(id)
const finalPath = `resources/recipes/images/${
safeFileName(id)
}_cover.${extension}`;
streamResponse.enqueue("downloading image");
try {

View File

@@ -42,7 +42,8 @@ async function processUpdateRecommendations(
}
done++;
streamResponse.enqueue(
`${Math.floor((done / total) * 100)}% [${done + 1
`${Math.floor((done / total) * 100)}% [${
done + 1
}/${total}] ${movie.name}`,
);
})).catch((err) => {

View File

@@ -12,7 +12,8 @@ import { MetaTags } from "@components/MetaTags.tsx";
import { fetchResource } from "@lib/marka/index.ts";
import { ArticleResource } from "@lib/marka/schema.ts";
export const handler: Handlers<{ article: ArticleResource; session: unknown }> = {
export const handler: Handlers<{ article: ArticleResource; session: unknown }> =
{
async GET(_, ctx) {
const article = await fetchResource(`articles/${ctx.params.name}.md`);
if (!article) {
@@ -20,7 +21,7 @@ export const handler: Handlers<{ article: ArticleResource; session: unknown }> =
}
return ctx.render({ article, session: ctx.state.session });
},
};
};
export default function Greet(
props: PageProps<{ article: Article; session: Record<string, string> }>,

View File

@@ -22,7 +22,8 @@ export default function Home(props: PageProps) {
<Card
title={`${m.name}`}
backgroundSize={80}
image={`${m.emoji.endsWith(".png")
image={`${
m.emoji.endsWith(".png")
? `/emojis/${encodeURIComponent(m.emoji)}`
: "/placeholder.svg"
}`}

View File

@@ -24,7 +24,7 @@ export default async function Greet(
return ctx.renderNotFound();
}
const { author = "", datePublished = "",reviewBody } = movie.content;
const { author = "", datePublished = "", reviewBody } = movie.content;
const content = renderMarkdown(
removeImage(reviewBody || "", movie.content.image),

View File

@@ -2,7 +2,7 @@
<browserconfig>
<msapplication>
<tile>
<square150x150logo src="/mstile-150x150.png"/>
<square150x150logo src="/mstile-150x150.png" />
<TileColor>#da532c</TileColor>
</tile>
</msapplication>

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,19 @@
<svg width="40" height="40" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M34.092 8.845C38.929 20.652 34.092 27 30 30.5c1 3.5-2.986 4.222-4.5 2.5-4.457 1.537-13.512 1.487-20-5C2 24.5 4.73 16.714 14 11.5c8-4.5 16-7 20.092-2.655Z" fill="#FFDB1E"/>
<path d="M14 11.5c6.848-4.497 15.025-6.38 18.368-3.47C37.5 12.5 21.5 22.612 15.5 25c-6.5 2.587-3 8.5-6.5 8.5-3 0-2.5-4-5.183-7.75C2.232 23.535 6.16 16.648 14 11.5Z" fill="#fff" stroke="#FFDB1E"/>
<path d="M28.535 8.772c4.645 1.25-.365 5.695-4.303 8.536-3.732 2.692-6.606 4.21-7.923 4.83-.366.173-1.617-2.252-1.617-1 0 .417-.7 2.238-.934 2.326-1.365.512-4.223 1.29-5.835 1.29-3.491 0-1.923-4.754 3.014-9.122.892-.789 1.478-.645 2.283-.645-.537-.773-.534-.917.403-1.546C17.79 10.64 23 8.77 25.212 8.42c.366.014.82.35.82.629.41-.14 2.095-.388 2.503-.278Z" fill="#FFE600"/>
<path d="M14.297 16.49c.985-.747 1.644-1.01 2.099-2.526.566.121.841-.08 1.29-.701.324.466 1.657.608 2.453.701-.715.451-1.057.852-1.452 2.106-1.464-.611-3.167-.302-4.39.42Z" fill="#fff"/>
<path
d="M34.092 8.845C38.929 20.652 34.092 27 30 30.5c1 3.5-2.986 4.222-4.5 2.5-4.457 1.537-13.512 1.487-20-5C2 24.5 4.73 16.714 14 11.5c8-4.5 16-7 20.092-2.655Z"
fill="#FFDB1E"
/>
<path
d="M14 11.5c6.848-4.497 15.025-6.38 18.368-3.47C37.5 12.5 21.5 22.612 15.5 25c-6.5 2.587-3 8.5-6.5 8.5-3 0-2.5-4-5.183-7.75C2.232 23.535 6.16 16.648 14 11.5Z"
fill="#fff"
stroke="#FFDB1E"
/>
<path
d="M28.535 8.772c4.645 1.25-.365 5.695-4.303 8.536-3.732 2.692-6.606 4.21-7.923 4.83-.366.173-1.617-2.252-1.617-1 0 .417-.7 2.238-.934 2.326-1.365.512-4.223 1.29-5.835 1.29-3.491 0-1.923-4.754 3.014-9.122.892-.789 1.478-.645 2.283-.645-.537-.773-.534-.917.403-1.546C17.79 10.64 23 8.77 25.212 8.42c.366.014.82.35.82.629.41-.14 2.095-.388 2.503-.278Z"
fill="#FFE600"
/>
<path
d="M14.297 16.49c.985-.747 1.644-1.01 2.099-2.526.566.121.841-.08 1.29-.701.324.466 1.657.608 2.453.701-.715.451-1.057.852-1.452 2.106-1.464-.611-3.167-.302-4.39.42Z"
fill="#fff"
/>
</svg>

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -1,7 +1,35 @@
<svg width="387" height="387" viewBox="0 0 387 387" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="387" height="387" fill="#2B2930"/>
<circle cx="212.471" cy="154.8" r="15.5559" stroke="#39363F" stroke-width="3.03529"/>
<path d="M110.978 249.463L155.261 205.18C161.188 199.253 170.797 199.253 176.724 205.18L221.007 249.463" stroke="#39363F" stroke-width="3.03529"/>
<path d="M192.362 220.628L207.81 205.18C213.737 199.253 223.346 199.253 229.273 205.18L273.556 249.463" stroke="#39363F" stroke-width="3.03529"/>
<rect x="86.1265" y="86.1265" width="214.747" height="214.747" rx="13.6588" stroke="#39363F" stroke-width="3.03529"/>
<svg
width="387"
height="387"
viewBox="0 0 387 387"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<rect width="387" height="387" fill="#2B2930" />
<circle
cx="212.471"
cy="154.8"
r="15.5559"
stroke="#39363F"
stroke-width="3.03529"
/>
<path
d="M110.978 249.463L155.261 205.18C161.188 199.253 170.797 199.253 176.724 205.18L221.007 249.463"
stroke="#39363F"
stroke-width="3.03529"
/>
<path
d="M192.362 220.628L207.81 205.18C213.737 199.253 223.346 199.253 229.273 205.18L273.556 249.463"
stroke="#39363F"
stroke-width="3.03529"
/>
<rect
x="86.1265"
y="86.1265"
width="214.747"
height="214.747"
rx="13.6588"
stroke="#39363F"
stroke-width="3.03529"
/>
</svg>

Before

Width:  |  Height:  |  Size: 652 B

After

Width:  |  Height:  |  Size: 758 B

View File

@@ -7,10 +7,10 @@ code[class*="language-"],
pre[class*="language-"] {
color: white;
background: none;
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace;
font-size: 1em;
text-align: left;
text-shadow: 0 -.1em .2em black;
text-shadow: 0 -0.1em 0.2em black;
white-space: pre;
word-spacing: normal;
word-break: normal;
@@ -34,10 +34,10 @@ pre[class*="language-"],
/* Code blocks */
pre[class*="language-"] {
border-radius: .5em;
border: .3em solid hsl(0, 0%, 33%); /* #282A2B */
box-shadow: 1px 1px .5em black inset;
margin: .5em 0;
border-radius: 0.5em;
border: 0.3em solid hsl(0, 0%, 33%); /* #282A2B */
box-shadow: 1px 1px 0.5em black inset;
margin: 0.5em 0;
overflow: auto;
padding: 1em;
}
@@ -53,24 +53,28 @@ pre[class*="language-"]::selection {
}
/* Text Selection colour */
pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection,
code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection {
pre[class*="language-"]::-moz-selection,
pre[class*="language-"] ::-moz-selection,
code[class*="language-"]::-moz-selection,
code[class*="language-"] ::-moz-selection {
text-shadow: none;
background: hsla(0, 0%, 93%, 0.15); /* #EDEDED */
}
pre[class*="language-"]::selection, pre[class*="language-"] ::selection,
code[class*="language-"]::selection, code[class*="language-"] ::selection {
pre[class*="language-"]::selection,
pre[class*="language-"] ::selection,
code[class*="language-"]::selection,
code[class*="language-"] ::selection {
text-shadow: none;
background: hsla(0, 0%, 93%, 0.15); /* #EDEDED */
}
/* Inline code */
:not(pre) > code[class*="language-"] {
border-radius: .3em;
border: .13em solid hsl(0, 0%, 33%); /* #545454 */
box-shadow: 1px 1px .3em -.1em black inset;
padding: .15em .2em .05em;
border-radius: 0.3em;
border: 0.13em solid hsl(0, 0%, 33%); /* #545454 */
box-shadow: 1px 1px 0.3em -0.1em black inset;
padding: 0.15em 0.2em 0.05em;
white-space: normal;
}
@@ -82,11 +86,11 @@ code[class*="language-"]::selection, code[class*="language-"] ::selection {
}
.token.punctuation {
opacity: .7;
opacity: 0.7;
}
.token.namespace {
opacity: .7;
opacity: 0.7;
}
.token.tag,
@@ -155,7 +159,11 @@ code[class*="language-"]::selection, code[class*="language-"] ::selection {
.line-highlight.line-highlight {
background: hsla(0, 0%, 33%, 0.25); /* #545454 */
background: linear-gradient(to right, hsla(0, 0%, 33%, .1) 70%, hsla(0, 0%, 33%, 0)); /* #545454 */
background: linear-gradient(
to right,
hsla(0, 0%, 33%, 0.1) 70%,
hsla(0, 0%, 33%, 0)
); /* #545454 */
border-bottom: 1px dashed hsl(0, 0%, 33%); /* #545454 */
border-top: 1px dashed hsl(0, 0%, 33%); /* #545454 */
margin-top: 0.75em; /* Same as .prisms padding-top */

View File

@@ -1,15 +1,25 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="256.000000pt" height="256.000000pt" viewBox="0 0 256.000000 256.000000"
preserveAspectRatio="xMidYMid meet">
<metadata>
<svg
version="1.0"
xmlns="http://www.w3.org/2000/svg"
width="256.000000pt"
height="256.000000pt"
viewBox="0 0 256.000000 256.000000"
preserveAspectRatio="xMidYMid meet"
>
<metadata
>
Created by potrace 1.14, written by Peter Selinger 2001-2017
</metadata>
<g transform="translate(0.000000,256.000000) scale(0.100000,-0.100000)"
fill="#000000" stroke="none">
<path d="M1404 2075 c-16 -7 -75 -60 -131 -116 -55 -57 -130 -133 -166 -167
<g
transform="translate(0.000000,256.000000) scale(0.100000,-0.100000)"
fill="#000000"
stroke="none"
>
<path
d="M1404 2075 c-16 -7 -75 -60 -131 -116 -55 -57 -130 -133 -166 -167
l-64 -64 0 122 c0 91 -3 124 -13 130 -19 12 -192 12 -210 0 -11 -7 -15 -34
-16 -117 -1 -59 -3 -110 -3 -113 -1 -3 -20 -11 -43 -17 -67 -18 -126 -76 -164
-160 -33 -72 -34 -73 -108 -108 -41 -19 -87 -50 -102 -68 -64 -76 -82 -169
@@ -19,6 +29,7 @@ l-64 -64 0 122 c0 91 -3 124 -13 130 -19 12 -192 12 -210 0 -11 -7 -15 -34
-59 15 -9 -2 -12 10 -9 45 6 72 -17 145 -62 196 -13 16 -16 60 -16 318 0 164
3 299 6 299 3 0 18 -13 34 -30 39 -41 75 -52 113 -33 36 18 53 57 40 93 -5 14
-82 96 -171 183 -89 87 -282 277 -429 423 -146 145 -270 264 -275 265 -4 0
-15 2 -24 4 -8 1 -29 -3 -45 -10z"/>
</g>
-15 2 -24 4 -8 1 -29 -3 -45 -10z"
/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB