Compare commits
5 commits
Author | SHA1 | Date | |
---|---|---|---|
7fb384451e | |||
3b954de4b8 | |||
19cd838544 | |||
1f23a0658b | |||
cfa234d723 |
10 changed files with 1155 additions and 619 deletions
|
@ -1,4 +1,8 @@
|
|||
import { defineConfig } from 'astro/config';
|
||||
|
||||
import svelte from "@astrojs/svelte";
|
||||
|
||||
// https://astro.build/config
|
||||
export default defineConfig({});
|
||||
export default defineConfig({
|
||||
integrations: [svelte()]
|
||||
});
|
|
@ -10,7 +10,9 @@
|
|||
"astro": "astro"
|
||||
},
|
||||
"dependencies": {
|
||||
"@astrojs/svelte": "^3.1.0",
|
||||
"@fontsource/atkinson-hyperlegible": "^4.5.11",
|
||||
"astro": "^2.1.0"
|
||||
"astro": "^2.7.3",
|
||||
"svelte": "^4.0.0"
|
||||
}
|
||||
}
|
||||
|
|
1696
pnpm-lock.yaml
1696
pnpm-lock.yaml
File diff suppressed because it is too large
Load diff
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
import Webring from "./Webring.svelte";
|
||||
---
|
||||
|
||||
<footer aria-label="my websites footer">
|
||||
<a href="https://git.solarpunk.moe/fries/fries-website">Source Code</a>
|
||||
</footer>
|
||||
|
|
31
src/components/Webring.svelte
Normal file
31
src/components/Webring.svelte
Normal file
|
@ -0,0 +1,31 @@
|
|||
<section class="webring-box" aria-label="the solarpunk.moe webring">
|
||||
<a id="previous" href={`${api_url}/previous?source_url=${site_url}`}>
|
||||
<p class="no-margin">←<br><span id="previous-text">Previous</span></p>
|
||||
</a>
|
||||
<p class="no-margin bigger-font">solarpunk.moe<br>webring</p>
|
||||
<a id="next" href={`${api_url}/next?source_url=${site_url}`}>
|
||||
<p class="no-margin"><span id="next-text">Next</span><br>→</p>
|
||||
</a>
|
||||
</section>
|
||||
|
||||
<style>
|
||||
.webring-box {
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.no-margin {
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
.bigger-font {
|
||||
font-size: 2.825rem;
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script lang="ts">
|
||||
import {main} from '../scripts/Webring';
|
||||
let api_url = import.meta.env.PUBLIC_API_URL;
|
||||
let site_url = import.meta.env.PUBLIC_SITE_URL;
|
||||
main();
|
||||
</script>
|
|
@ -8,6 +8,7 @@ import '@fontsource/atkinson-hyperlegible';
|
|||
import Footer from "../components/Footer.astro";
|
||||
import Navigation from "../components/Navigation.astro";
|
||||
import "../styles/global.css";
|
||||
import Webring from '../components/Webring.svelte';
|
||||
---
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
@ -23,6 +24,8 @@ import "../styles/global.css";
|
|||
<hr aria-hidden="true">
|
||||
<slot />
|
||||
<hr aria-hidden="true">
|
||||
<Webring client:load />
|
||||
<hr aria-hidden="true">
|
||||
<Footer />
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -3,6 +3,7 @@ import Layout from "../layouts/Layout.astro";
|
|||
import Header from "../components/Header.astro";
|
||||
import Introduction from "../components/Introduction.astro";
|
||||
import Links from "../components/Links.astro";
|
||||
import Webring from "../components/Webring.svelte";
|
||||
---
|
||||
|
||||
<Layout title="fries gay place">
|
||||
|
|
19
src/scripts/Webring.ts
Normal file
19
src/scripts/Webring.ts
Normal file
|
@ -0,0 +1,19 @@
|
|||
type Names = {
|
||||
previous_site_name: string
|
||||
next_site_name: string
|
||||
};
|
||||
|
||||
export async function main() {
|
||||
if (import.meta.env.SSR) return;
|
||||
|
||||
let api_url = import.meta.env.PUBLIC_API_URL;
|
||||
let site_url = import.meta.env.PUBLIC_SITE_URL;
|
||||
let previous_text = document.getElementById("previous-text") as HTMLParagraphElement;
|
||||
let next_text = document.getElementById("next-text") as HTMLParagraphElement;
|
||||
|
||||
const request = await fetch(`${api_url}/name?source_url=${site_url}`);
|
||||
const names: Names = await request.json();
|
||||
|
||||
previous_text.textContent = names.previous_site_name;
|
||||
next_text.textContent = names.next_site_name;
|
||||
}
|
5
svelte.config.js
Normal file
5
svelte.config.js
Normal file
|
@ -0,0 +1,5 @@
|
|||
import { vitePreprocess } from '@astrojs/svelte';
|
||||
|
||||
export default {
|
||||
preprocess: vitePreprocess(),
|
||||
};
|
|
@ -1,3 +1,6 @@
|
|||
{
|
||||
"extends": "astro/tsconfigs/strict"
|
||||
"extends": "astro/tsconfigs/strict",
|
||||
"compilerOptions": {
|
||||
"lib": ["DOM", "DOM.Iterable"]
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue