Agregar Tracking
This commit is contained in:
parent
3ae1904dd4
commit
c3275dde48
1 changed files with 157 additions and 113 deletions
|
|
@ -1,9 +1,9 @@
|
||||||
---
|
---
|
||||||
import '@/styles/global.css';
|
import "@/styles/global.css";
|
||||||
import siteConfig from '@/config/site.config';
|
import siteConfig from "@/config/site.config";
|
||||||
import Header from '@/components/layout/Header.astro';
|
import Header from "@/components/layout/Header.astro";
|
||||||
import Footer from '@/components/layout/Footer.astro';
|
import Footer from "@/components/layout/Footer.astro";
|
||||||
import CursorTrail from '@/components/effects/CursorTrail.astro';
|
import CursorTrail from "@/components/effects/CursorTrail.astro";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
title?: string;
|
title?: string;
|
||||||
|
|
@ -24,7 +24,12 @@ const canonicalURL = new URL(Astro.url.pathname, siteConfig.url);
|
||||||
---
|
---
|
||||||
|
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html lang="es" class="scroll-smooth dark" data-theme="default" data-theme-mode="system">
|
<html
|
||||||
|
lang="es"
|
||||||
|
class="scroll-smooth dark"
|
||||||
|
data-theme="default"
|
||||||
|
data-theme-mode="system"
|
||||||
|
>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
|
@ -42,39 +47,67 @@ const canonicalURL = new URL(Astro.url.pathname, siteConfig.url);
|
||||||
<meta property="og:url" content={canonicalURL} />
|
<meta property="og:url" content={canonicalURL} />
|
||||||
<meta property="og:title" content={pageTitle} />
|
<meta property="og:title" content={pageTitle} />
|
||||||
<meta property="og:description" content={description} />
|
<meta property="og:description" content={description} />
|
||||||
{image && <meta property="og:image" content={new URL(image, siteConfig.url)} />}
|
{
|
||||||
|
image && (
|
||||||
|
<meta
|
||||||
|
property="og:image"
|
||||||
|
content={new URL(image, siteConfig.url)}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
<meta name="twitter:card" content="summary_large_image" />
|
<meta name="twitter:card" content="summary_large_image" />
|
||||||
<meta name="twitter:title" content={pageTitle} />
|
<meta name="twitter:title" content={pageTitle} />
|
||||||
<meta name="twitter:description" content={description} />
|
<meta name="twitter:description" content={description} />
|
||||||
{image && <meta name="twitter:image" content={new URL(image, siteConfig.url)} />}
|
{
|
||||||
|
image && (
|
||||||
|
<meta
|
||||||
|
name="twitter:image"
|
||||||
|
content={new URL(image, siteConfig.url)}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
<script is:inline>
|
<script is:inline>
|
||||||
(function () {
|
(function () {
|
||||||
const VALID_MODES = ['system', 'light', 'dark'];
|
const VALID_MODES = ["system", "light", "dark"];
|
||||||
function getMode() {
|
function getMode() {
|
||||||
try {
|
try {
|
||||||
const stored = localStorage.getItem('theme');
|
const stored = localStorage.getItem("theme");
|
||||||
if (VALID_MODES.indexOf(stored) !== -1) return stored;
|
if (VALID_MODES.indexOf(stored) !== -1) return stored;
|
||||||
} catch {}
|
} catch {}
|
||||||
return 'system';
|
return "system";
|
||||||
}
|
}
|
||||||
function applyMode(el) {
|
function applyMode(el) {
|
||||||
const mode = getMode();
|
const mode = getMode();
|
||||||
el.setAttribute('data-theme-mode', mode);
|
el.setAttribute("data-theme-mode", mode);
|
||||||
const isDark = mode === 'dark' || (mode === 'system' && window.matchMedia('(prefers-color-scheme: dark)').matches);
|
const isDark =
|
||||||
if (isDark) el.classList.add('dark');
|
mode === "dark" ||
|
||||||
else el.classList.remove('dark');
|
(mode === "system" &&
|
||||||
|
window.matchMedia("(prefers-color-scheme: dark)")
|
||||||
|
.matches);
|
||||||
|
if (isDark) el.classList.add("dark");
|
||||||
|
else el.classList.remove("dark");
|
||||||
}
|
}
|
||||||
applyMode(document.documentElement);
|
applyMode(document.documentElement);
|
||||||
if (!window.__themeListenersInit) {
|
if (!window.__themeListenersInit) {
|
||||||
window.__themeListenersInit = true;
|
window.__themeListenersInit = true;
|
||||||
const mql = window.matchMedia('(prefers-color-scheme: dark)');
|
const mql = window.matchMedia(
|
||||||
const onSchemeChange = function () { if (getMode() === 'system') applyMode(document.documentElement); };
|
"(prefers-color-scheme: dark)",
|
||||||
if (mql.addEventListener) mql.addEventListener('change', onSchemeChange);
|
);
|
||||||
|
const onSchemeChange = function () {
|
||||||
|
if (getMode() === "system")
|
||||||
|
applyMode(document.documentElement);
|
||||||
|
};
|
||||||
|
if (mql.addEventListener)
|
||||||
|
mql.addEventListener("change", onSchemeChange);
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
|
<script
|
||||||
|
defer
|
||||||
|
src="https://umami.aoncoz.cc/script.js"
|
||||||
|
data-website-id="58738a7d-4beb-46c1-906b-75ec06340f25"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="min-h-screen bg-background text-foreground antialiased">
|
<body class="min-h-screen bg-background text-foreground antialiased">
|
||||||
|
|
@ -100,30 +133,41 @@ const canonicalURL = new URL(Astro.url.pathname, siteConfig.url);
|
||||||
aria-label="Volver arriba"
|
aria-label="Volver arriba"
|
||||||
class="fixed bottom-6 right-6 z-50 h-12 w-12 rounded-full bg-background border border-border-strong text-foreground-muted shadow-md hover:bg-secondary transition-all duration-200 opacity-0 translate-y-4 pointer-events-none"
|
class="fixed bottom-6 right-6 z-50 h-12 w-12 rounded-full bg-background border border-border-strong text-foreground-muted shadow-md hover:bg-secondary transition-all duration-200 opacity-0 translate-y-4 pointer-events-none"
|
||||||
>
|
>
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="mx-auto"><path d="m18 15-6-6-6 6"/></svg>
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width="16"
|
||||||
|
height="16"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
stroke-width="2.5"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
class="mx-auto"><path d="m18 15-6-6-6 6"></path></svg
|
||||||
|
>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<script is:inline>
|
<script is:inline>
|
||||||
(function () {
|
(function () {
|
||||||
const THRESHOLD = 400;
|
const THRESHOLD = 400;
|
||||||
const btn = document.getElementById('back-to-top');
|
const btn = document.getElementById("back-to-top");
|
||||||
if (!btn) return;
|
if (!btn) return;
|
||||||
|
|
||||||
function update() {
|
function update() {
|
||||||
if (window.scrollY > THRESHOLD) {
|
if (window.scrollY > THRESHOLD) {
|
||||||
btn.style.opacity = '1';
|
btn.style.opacity = "1";
|
||||||
btn.style.translate = '0 0';
|
btn.style.translate = "0 0";
|
||||||
btn.style.pointerEvents = 'auto';
|
btn.style.pointerEvents = "auto";
|
||||||
} else {
|
} else {
|
||||||
btn.style.opacity = '0';
|
btn.style.opacity = "0";
|
||||||
btn.style.translate = '0 1rem';
|
btn.style.translate = "0 1rem";
|
||||||
btn.style.pointerEvents = 'none';
|
btn.style.pointerEvents = "none";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
window.addEventListener('scroll', update, { passive: true });
|
window.addEventListener("scroll", update, { passive: true });
|
||||||
btn.addEventListener('click', function () {
|
btn.addEventListener("click", function () {
|
||||||
window.scrollTo({ top: 0, behavior: 'smooth' });
|
window.scrollTo({ top: 0, behavior: "smooth" });
|
||||||
});
|
});
|
||||||
update();
|
update();
|
||||||
})();
|
})();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue