Remove more traces of turbo

This commit is contained in:
DrMint 2023-09-28 14:36:12 +02:00
parent 8234208102
commit 5227380d7e
9 changed files with 23 additions and 35 deletions

BIN
bun.lockb

Binary file not shown.

View File

@ -12,15 +12,12 @@
}, },
"dependencies": { "dependencies": {
"@astrojs/node": "^6.0.0", "@astrojs/node": "^6.0.0",
"@hotwired/turbo": "^7.3.0",
"accept-language": "^3.0.18", "accept-language": "^3.0.18",
"astro": "^3.0.3", "astro": "^3.0.3",
"astro-icon": "next", "astro-icon": "next",
"hono": "^3.5.7", "hono": "^3.5.7",
"htmx.org": "^1.9.5",
"js-cookie": "^3.0.5", "js-cookie": "^3.0.5",
"node-cache": "^5.1.2", "node-cache": "^5.1.2",
"sanitize.css": "^13.0.0",
"tippy.js": "^6.3.7" "tippy.js": "^6.3.7"
}, },
"devDependencies": { "devDependencies": {

View File

@ -1,8 +1,7 @@
--- ---
import Html from "pages/_components/Html.astro"; import Html from "pages/_components/Html.astro";
import Navbar from "./components/Navbar.astro"; import Navbar from "./components/Navbar.astro";
import { parseCookie } from "utils/astro"; import { CookieNames, parseCookie } from "utils/cookies";
import { CookieNames } from "utils/cookies";
import MenuPanel from "./components/MenuPanel.astro"; import MenuPanel from "./components/MenuPanel.astro";
interface Props { interface Props {

View File

@ -18,11 +18,7 @@ const { isReduced = false } = Astro.props;
/* ------------------------------------------- HTML ------------------------------------------- */ /* ------------------------------------------- HTML ------------------------------------------- */
} }
<a <a id="accords-logo" href={getLocalizedUrl("/", locale)}>
id="accords-logo"
data-turbo-confirm="Do you want to leave this page?"
href={getLocalizedUrl("/", locale)}
>
<Icon name="accords" /> <Icon name="accords" />
</a> </a>
@ -122,9 +118,11 @@ const { isReduced = false } = Astro.props;
</p> </p>
<div id="social-links"> <div id="social-links">
<Icon name="github-brands" /> <a href="https://github.com/accords-Library"
<Icon name="x-brands" /> ><Icon name="github-brands" /></a
<Icon name="discord-brands" /> >
<a href="https://twitter.com/AccordsLibrary"><Icon name="x-brands" /></a>
<a href="/discord"><Icon name="discord-brands" /></a>
</div> </div>
</div> </div>
@ -194,7 +192,7 @@ const { isReduced = false } = Astro.props;
place-items: center; place-items: center;
gap: 2rem; gap: 2rem;
& > svg { & > a > svg {
width: 40px; width: 40px;
height: 40px; height: 40px;
} }

View File

@ -1,7 +1,6 @@
--- ---
import { Icon } from "astro-icon/components"; import { Icon } from "astro-icon/components";
import { parseCookie } from "utils/astro"; import { CookieNames, parseCookie } from "utils/cookies";
import { CookieNames } from "utils/cookies";
const themeColors = parseCookie<string>( const themeColors = parseCookie<string>(
Astro.cookies.get(CookieNames.THEME_COLOR), Astro.cookies.get(CookieNames.THEME_COLOR),

View File

@ -1,6 +1,5 @@
--- ---
import { parseCookie } from "utils/astro"; import { CookieNames, parseCookie } from "utils/cookies";
import { CookieNames } from "utils/cookies";
interface Props { interface Props {
title: string; title: string;
@ -242,7 +241,7 @@ const themeColors = parseCookie(
@font-face { @font-face {
font-family: "Vollkorn"; font-family: "Vollkorn";
src: url("/fonts/Vollkorn-Bold.woff2") format("woff2"); src: url("/fonts/Vollkorn-Bold.woff2") format("woff2");
font-weight: bold; font-weight: 700;
font-style: normal; font-style: normal;
font-display: swap; font-display: swap;
} }
@ -250,7 +249,7 @@ const themeColors = parseCookie(
@font-face { @font-face {
font-family: "Noto Sans"; font-family: "Noto Sans";
src: url("/fonts/NotoSans-Medium.woff2") format("woff2"); src: url("/fonts/NotoSans-Medium.woff2") format("woff2");
font-weight: medium; font-weight: 600;
font-style: normal; font-style: normal;
font-display: swap; font-display: swap;
} }
@ -258,7 +257,7 @@ const themeColors = parseCookie(
@font-face { @font-face {
font-family: "Noto Sans"; font-family: "Noto Sans";
src: url("/fonts/NotoSans-Bold.woff2") format("woff2"); src: url("/fonts/NotoSans-Bold.woff2") format("woff2");
font-weight: bold; font-weight: 700;
font-style: normal; font-style: normal;
font-display: swap; font-display: swap;
} }
@ -266,7 +265,7 @@ const themeColors = parseCookie(
@font-face { @font-face {
font-family: "Angelic Agrippa"; font-family: "Angelic Agrippa";
src: url("/fonts/AngelicAgrippa-Regular.woff2") format("woff2"); src: url("/fonts/AngelicAgrippa-Regular.woff2") format("woff2");
font-weight: normal; font-weight: 500;
font-style: normal; font-style: normal;
font-display: swap; font-display: swap;
} }

View File

@ -1,8 +0,0 @@
import { type AstroCookies } from "astro";
type AstroCookie = ReturnType<AstroCookies["get"]>;
export const parseCookie = <T>(cookies: AstroCookie, defaultValue: T): T => {
const value: T | null = JSON.parse(cookies?.value ?? "null");
return value ?? defaultValue;
};

View File

@ -1,3 +1,12 @@
import { type AstroCookies } from "astro";
type AstroCookie = ReturnType<AstroCookies["get"]>;
export const parseCookie = <T>(cookies: AstroCookie, defaultValue: T): T => {
const value: T | null = JSON.parse(cookies?.value ?? "null");
return value ?? defaultValue;
};
export enum CookieNames { export enum CookieNames {
MENU_PANEL_REDUCED = "menuPanelReduced", MENU_PANEL_REDUCED = "menuPanelReduced",
THEME_COLOR = "themeColor", THEME_COLOR = "themeColor",

View File

@ -1,5 +0,0 @@
export const customEvents = {
mainPanel: {
reduce: { toggle: "mainPanel.reduce.toggle" },
},
};