Format all files with prettier: npm run format

This commit is contained in:
prototypa
2024-04-29 17:51:55 -04:00
parent 2b8672612e
commit a606b34a19
47 changed files with 298 additions and 340 deletions

View File

@@ -5,6 +5,9 @@ import { ANALYTICS } from 'astrowind:config';
{
ANALYTICS?.vendors?.googleAnalytics?.id ? (
<GoogleAnalytics id={String(ANALYTICS.vendors.googleAnalytics.id)} partytown={ANALYTICS?.vendors?.googleAnalytics?.partytown} />
<GoogleAnalytics
id={String(ANALYTICS.vendors.googleAnalytics.id)}
partytown={ANALYTICS?.vendors?.googleAnalytics?.partytown}
/>
) : null
}

View File

@@ -1,33 +1,33 @@
---
import { UI } from "astrowind:config";
import { UI } from 'astrowind:config';
// TODO: This code is temporary
---
<script is:inline define:vars={{ defaultTheme: UI.theme || "system" }}>
<script is:inline define:vars={{ defaultTheme: UI.theme || 'system' }}>
function applyTheme(theme) {
if (theme === "dark") {
document.documentElement.classList.add("dark");
if (theme === 'dark') {
document.documentElement.classList.add('dark');
} else {
document.documentElement.classList.remove("dark");
document.documentElement.classList.remove('dark');
}
const matches = document.querySelectorAll("[data-aw-toggle-color-scheme] > input");
const matches = document.querySelectorAll('[data-aw-toggle-color-scheme] > input');
if (matches && matches.length) {
matches.forEach((elem) => {
elem.checked = theme !== "dark";
elem.checked = theme !== 'dark';
});
}
}
if ((defaultTheme && defaultTheme.endsWith(":only")) || (!localStorage.theme && defaultTheme !== "system")) {
applyTheme(defaultTheme.replace(":only", ""));
if ((defaultTheme && defaultTheme.endsWith(':only')) || (!localStorage.theme && defaultTheme !== 'system')) {
applyTheme(defaultTheme.replace(':only', ''));
} else if (
localStorage.theme === "dark" ||
(!("theme" in localStorage) && window.matchMedia("(prefers-color-scheme: dark)").matches)
localStorage.theme === 'dark' ||
(!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)
) {
applyTheme("dark");
applyTheme('dark');
} else {
applyTheme("light");
applyTheme('light');
}
</script>

View File

@@ -5,4 +5,4 @@ import { getAsset } from '~/utils/permalinks';
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="sitemap" href={getAsset('/sitemap-index.xml')} />
<link rel="sitemap" href={getAsset('/sitemap-index.xml')} />

View File

@@ -1,5 +1,5 @@
---
import { SITE } from "astrowind:config";
import { SITE } from 'astrowind:config';
---
{SITE.googleSiteVerificationId && <meta name="google-site-verification" content={SITE.googleSiteVerificationId} />}
{SITE.googleSiteVerificationId && <meta name="google-site-verification" content={SITE.googleSiteVerificationId} />}

View File

@@ -12,7 +12,12 @@ const { text, url, class: className = 'inline-block' } = Astro.props;
<div class={className}>
<span class="align-super font-bold text-slate-500 dark:text-slate-400">Share:</span>
<button class="ml-2 rtl:ml-0 rtl:mr-2" title="Twitter Share" data-aw-social-share="twitter" data-aw-url={url} data-aw-text={text}
<button
class="ml-2 rtl:ml-0 rtl:mr-2"
title="Twitter Share"
data-aw-social-share="twitter"
data-aw-url={url}
data-aw-text={text}
><Icon
name="tabler:brand-x"
class="w-6 h-6 text-gray-400 dark:text-slate-500 hover:text-black dark:hover:text-slate-300"
@@ -24,19 +29,34 @@ const { text, url, class: className = 'inline-block' } = Astro.props;
class="w-6 h-6 text-gray-400 dark:text-slate-500 hover:text-black dark:hover:text-slate-300"
/>
</button>
<button class="ml-2 rtl:ml-0 rtl:mr-2" title="Linkedin Share" data-aw-social-share="linkedin" data-aw-url={url} data-aw-text={text}
<button
class="ml-2 rtl:ml-0 rtl:mr-2"
title="Linkedin Share"
data-aw-social-share="linkedin"
data-aw-url={url}
data-aw-text={text}
><Icon
name="tabler:brand-linkedin"
class="w-6 h-6 text-gray-400 dark:text-slate-500 hover:text-black dark:hover:text-slate-300"
/>
</button>
<button class="ml-2 rtl:ml-0 rtl:mr-2" title="Whatsapp Share" data-aw-social-share="whatsapp" data-aw-url={url} data-aw-text={text}
<button
class="ml-2 rtl:ml-0 rtl:mr-2"
title="Whatsapp Share"
data-aw-social-share="whatsapp"
data-aw-url={url}
data-aw-text={text}
><Icon
name="tabler:brand-whatsapp"
class="w-6 h-6 text-gray-400 dark:text-slate-500 hover:text-black dark:hover:text-slate-300"
/>
</button>
<button class="ml-2 rtl:ml-0 rtl:mr-2" title="Email Share" data-aw-social-share="mail" data-aw-url={url} data-aw-text={text}
<button
class="ml-2 rtl:ml-0 rtl:mr-2"
title="Email Share"
data-aw-social-share="mail"
data-aw-url={url}
data-aw-text={text}
><Icon
name="tabler:mail"
class="w-6 h-6 text-gray-400 dark:text-slate-500 hover:text-black dark:hover:text-slate-300"

View File

@@ -6,16 +6,11 @@ export interface Props {
const {
label = 'Toggle Menu',
class:
className = "flex flex-col h-12 w-12 rounded justify-center items-center cursor-pointer group",
class: className = 'flex flex-col h-12 w-12 rounded justify-center items-center cursor-pointer group',
} = Astro.props;
---
<button
class={className}
aria-label={label}
data-aw-toggle-menu
>
<button class={className} aria-label={label} data-aw-toggle-menu>
<span class="sr-only">{label}</span>
<slot>
<span