Compare commits

...

5 Commits

Author SHA1 Message Date
Fries 7fb384451e use p instead of h2 for the webring text
and unbreak up the paragraphs in the a tags as this makes it act as
seperate links.
2023-07-07 23:02:04 -07:00
Fries 3b954de4b8 add aria-hidden to the new seperator 2023-07-07 22:41:21 -07:00
Fries 19cd838544 Merge branch 'main' into webring 2023-07-07 22:40:58 -07:00
Fries 1f23a0658b remove flexbox
looks like the way my box works doesn't need a flexbox at all so i
turned it off.
2023-07-06 22:15:38 -07:00
Fries cfa234d723 add a webring component to the site
this is for the solarpunk.moe webring.
2023-07-05 02:11:14 -07:00
10 changed files with 1155 additions and 619 deletions

View File

@ -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()]
});

View File

@ -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"
}
}

File diff suppressed because it is too large Load Diff

View File

@ -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>

View 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>

View File

@ -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>

View File

@ -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
View 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
View File

@ -0,0 +1,5 @@
import { vitePreprocess } from '@astrojs/svelte';
export default {
preprocess: vitePreprocess(),
};

View File

@ -1,3 +1,6 @@
{
"extends": "astro/tsconfigs/strict"
"extends": "astro/tsconfigs/strict",
"compilerOptions": {
"lib": ["DOM", "DOM.Iterable"]
}
}