mirror of
https://github.com/timmypidashev/web.git
synced 2026-04-14 02:53:51 +00:00
mobile optimizations
This commit is contained in:
@@ -74,6 +74,7 @@ export default function MobileNav({ transparent = false }: { transparent?: boole
|
||||
<a
|
||||
key={tab.href}
|
||||
href={tab.href}
|
||||
data-astro-reload
|
||||
className={`flex flex-col items-center justify-center gap-0.5 flex-1 py-1 ${
|
||||
active ? tab.color : "text-foreground/40"
|
||||
}`}
|
||||
|
||||
@@ -39,52 +39,10 @@ const ogImage = "https://timmypidashev.dev/og-image.jpg";
|
||||
defaultTransition={false}
|
||||
handleFocus={false}
|
||||
/>
|
||||
<style>
|
||||
::view-transition-new(:root),
|
||||
::view-transition-old(:root) {
|
||||
animation: none;
|
||||
}
|
||||
#nav-mask {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 9999;
|
||||
background: rgb(var(--color-background));
|
||||
pointer-events: none;
|
||||
opacity: 0;
|
||||
transition: none;
|
||||
}
|
||||
#nav-mask.active {
|
||||
opacity: 1;
|
||||
}
|
||||
</style>
|
||||
<script is:inline set:html={THEME_LOADER_SCRIPT} />
|
||||
<script is:inline set:html={ANIMATION_LOADER_SCRIPT} />
|
||||
<script is:inline>
|
||||
(function() {
|
||||
function getMask() {
|
||||
var m = document.getElementById('nav-mask');
|
||||
if (!m) {
|
||||
m = document.createElement('div');
|
||||
m.id = 'nav-mask';
|
||||
document.documentElement.appendChild(m);
|
||||
}
|
||||
return m;
|
||||
}
|
||||
document.addEventListener('astro:before-preparation', function() {
|
||||
getMask().classList.add('active');
|
||||
});
|
||||
document.addEventListener('astro:after-swap', function() {
|
||||
var m = getMask();
|
||||
setTimeout(function() { m.classList.remove('active'); }, 50);
|
||||
});
|
||||
document.addEventListener('astro:after-swap', function() {
|
||||
window.__astroNavigation = true;
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
</head>
|
||||
<body class="bg-background text-foreground min-h-screen flex flex-col">
|
||||
<div id="nav-mask"></div>
|
||||
<Header client:load />
|
||||
<main class="flex-1 flex flex-col">
|
||||
<div class="max-w-5xl mx-auto pt-2 lg:pt-12 px-4 py-4 lg:py-8 pb-20 lg:pb-8 flex-1 relative z-10">
|
||||
|
||||
@@ -38,53 +38,10 @@ const ogImage = "https://timmypidashev.dev/og-image.jpg";
|
||||
<link rel="icon" type="image/jpeg" href="/me.jpeg" />
|
||||
<link rel="sitemap" href="/sitemap-index.xml" />
|
||||
<ClientRouter />
|
||||
<style>
|
||||
::view-transition-new(:root),
|
||||
::view-transition-old(:root) {
|
||||
animation: none;
|
||||
}
|
||||
#nav-mask {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 9999;
|
||||
background: rgb(var(--color-background));
|
||||
pointer-events: none;
|
||||
opacity: 0;
|
||||
transition: none;
|
||||
}
|
||||
#nav-mask.active {
|
||||
opacity: 1;
|
||||
}
|
||||
</style>
|
||||
<script is:inline set:html={THEME_LOADER_SCRIPT} />
|
||||
<script is:inline set:html={ANIMATION_LOADER_SCRIPT} />
|
||||
<script is:inline>
|
||||
(function() {
|
||||
function getMask() {
|
||||
var m = document.getElementById('nav-mask');
|
||||
if (!m) {
|
||||
m = document.createElement('div');
|
||||
m.id = 'nav-mask';
|
||||
document.documentElement.appendChild(m);
|
||||
}
|
||||
return m;
|
||||
}
|
||||
document.addEventListener('astro:before-preparation', function() {
|
||||
getMask().classList.add('active');
|
||||
});
|
||||
document.addEventListener('astro:after-swap', function() {
|
||||
var m = getMask();
|
||||
setTimeout(function() { m.classList.remove('active'); }, 50);
|
||||
});
|
||||
// Mark SPA navigations so AnimateIn can detect them
|
||||
document.addEventListener('astro:after-swap', function() {
|
||||
window.__astroNavigation = true;
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
</head>
|
||||
<body class="bg-background text-foreground overflow-hidden h-screen">
|
||||
<div id="nav-mask"></div>
|
||||
<Header client:load transparent />
|
||||
<main>
|
||||
<Background layout="index" client:only="react" transition:persist />
|
||||
|
||||
@@ -39,52 +39,10 @@ const ogImage = "https://timmypidashev.dev/og-image.jpg";
|
||||
defaultTransition={false}
|
||||
handleFocus={false}
|
||||
/>
|
||||
<style>
|
||||
::view-transition-new(:root),
|
||||
::view-transition-old(:root) {
|
||||
animation: none;
|
||||
}
|
||||
#nav-mask {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 9999;
|
||||
background: rgb(var(--color-background));
|
||||
pointer-events: none;
|
||||
opacity: 0;
|
||||
transition: none;
|
||||
}
|
||||
#nav-mask.active {
|
||||
opacity: 1;
|
||||
}
|
||||
</style>
|
||||
<script is:inline set:html={THEME_LOADER_SCRIPT} />
|
||||
<script is:inline set:html={ANIMATION_LOADER_SCRIPT} />
|
||||
<script is:inline>
|
||||
(function() {
|
||||
function getMask() {
|
||||
var m = document.getElementById('nav-mask');
|
||||
if (!m) {
|
||||
m = document.createElement('div');
|
||||
m.id = 'nav-mask';
|
||||
document.documentElement.appendChild(m);
|
||||
}
|
||||
return m;
|
||||
}
|
||||
document.addEventListener('astro:before-preparation', function() {
|
||||
getMask().classList.add('active');
|
||||
});
|
||||
document.addEventListener('astro:after-swap', function() {
|
||||
var m = getMask();
|
||||
setTimeout(function() { m.classList.remove('active'); }, 50);
|
||||
});
|
||||
document.addEventListener('astro:after-swap', function() {
|
||||
window.__astroNavigation = true;
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
</head>
|
||||
<body class="bg-background text-foreground min-h-screen flex flex-col">
|
||||
<div id="nav-mask"></div>
|
||||
<main class="flex-1 flex flex-col">
|
||||
<div class="max-w-5xl mx-auto pt-2 lg:pt-12 px-4 py-4 lg:py-8 flex-1 relative z-10">
|
||||
<Background layout="content" position="right" client:only="react" transition:persist />
|
||||
|
||||
Reference in New Issue
Block a user