Skip to content

Commit

Permalink
stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
iamawatermelo committed Jan 22, 2025
1 parent 517e88b commit 486afc6
Show file tree
Hide file tree
Showing 18 changed files with 1,511 additions and 426 deletions.
1,600 changes: 1,294 additions & 306 deletions package-lock.json

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
},
"devDependencies": {
"@poppanator/sveltekit-svg": "^5.0.0-svelte5.5",
"@sveltejs/adapter-auto": "^3.0.0",
"@sveltejs/adapter-cloudflare": "^4.7.2",
"@sveltejs/kit": "^2.0.0",
"@sveltejs/adapter-auto": "^3.3.1",
"@sveltejs/adapter-cloudflare": "^4.9.0",
"@sveltejs/enhanced-img": "^0.4.4",
"@sveltejs/kit": "^2.16.1",
"@sveltejs/vite-plugin-svelte": "^4.0.0-next.6",
"eslint": "^8.28.0",
"eslint-config-prettier": "^9.1.0",
Expand Down
32 changes: 10 additions & 22 deletions src/hooks.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ const PRELOADED_FONTS = [TextFontURL];

export const handle: Handle = async ({ event, resolve }) => {
const response = await resolve(event);

// To be silly, send 2 gigabytes of <div>
if (response.status === 404 && event.url.pathname.includes("wp-")) {
if (response.status === 404 && event.url.pathname.includes('wp-')) {
return new Response(Bomb, {
status: 200,
headers: {
'Content-Encoding': 'zstd',
'Content-Type': 'text/html'
}
})
});
}

// Disable JS preloading. This took hours to find.
Expand All @@ -29,35 +29,23 @@ export const handle: Handle = async ({ event, resolve }) => {
for (const asset of PRELOADED_FONTS) {
link.push(`<${asset}>; rel="preload"; as="font"; crossorigin="anonymous"`);
}

link.push(`</api/background.svg>; rel="preload"; as="image";`);

response.headers.set('link', link.join(','));
response.headers.set(
'Accept-CH',
'Width, Viewport-Width, Sec-CH-Width, Sec-CH-Viewport-Width, Sec-CH-Viewport-Height, Sec-CH-UA-Mobile'
);
response.headers.set(
'Referer',
'no-referrer'
)
response.headers.set('Referer', 'no-referrer');
response.headers.set(
'Strict-Transport-Security',
// STS for 1 decade on all subdomains
'max-age=315360000; includeSubDomains; preload'
)
response.headers.set(
'X-Content-Type-Options',
'nosniff'
)
response.headers.set(
'X-Frame-Options',
'DENY'
)
response.headers.set(
'Cross-Origin-Resource-Policy',
'same-origin'
)
);
response.headers.set('X-Content-Type-Options', 'nosniff');
response.headers.set('X-Frame-Options', 'DENY');
response.headers.set('Cross-Origin-Resource-Policy', 'same-origin');

return response;
};
8 changes: 4 additions & 4 deletions src/lib/components/EmailLanding.svelte
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<script>
import Page from '$lib/components/Page.svelte';
import { onMount } from 'svelte';
let { title, noscriptBody, scriptBody, buttonText } = $props();
let form = $state();
onMount(() => {
form.submit();
})
});
</script>

<Page {title}>
Expand Down
13 changes: 7 additions & 6 deletions src/lib/components/Page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
<title>{title} | Revolution</title>
</svelte:head>

<main class:inverted={inverted}>
<main class:inverted>
<div class="content">
{@render children?.()}
</div>
</main>

<style lang="scss">
@use 'src/lib/style';
.content {
margin: auto;
padding: 4em 2em;
Expand All @@ -24,12 +24,13 @@
flex-direction: column;
gap: 0.5em;
}
.inverted {
filter: #{"grayscale(50%) invert()"};
filter: #{'grayscale(50%) invert()'};
}
main :global(button), main :global(.style-button) {
main :global(button),
main :global(.style-button) {
display: block;
text-decoration: none;
font-weight: bold;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/emails/email.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export async function sendEmail<T extends Record<string, any>>(
host: URL
) {
const { html, plain } = renderEmail(component, props, host);

if (dev) {
console.log(`Sent email to ${recipient}: ${plain}`);
return;
Expand Down
8 changes: 8 additions & 0 deletions src/lib/images/arrow-right.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/lib/images/hc-apocalypse.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/lib/images/hc-hackathon.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions src/lib/images/play-button.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/lib/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ $size_lg: 64rem;
box-shadow 100ms,
transform 100ms,
filter 100ms;

@media (prefers-reduced-motion) {
transition: none;
}
Expand Down
8 changes: 4 additions & 4 deletions src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
@media (min-width: style.$size_md) {
--transform: translate(calc(50% - 8em), calc(50% - 2em));
}
@media (prefers-reduced-motion) {
animation: none;
transform: var(--transform);
Expand All @@ -153,10 +153,10 @@
@include style.brick-texture();
}
:global(.bricks) {
display: none;
@media (min-width: style.$size_sm) {
pointer-events: none;
display: block;
Expand Down Expand Up @@ -188,7 +188,7 @@
width: 3em;
height: 3em;
align-self: center;
stroke: rgb(var(--fg));
}
Expand Down
Loading

0 comments on commit 486afc6

Please sign in to comment.