mirror of
https://github.com/Damillora/Yuika
synced 2024-12-25 05:33:45 +00:00
Fixed navbar
This commit is contained in:
parent
98a2e9fe13
commit
8f2affea9d
@ -7,10 +7,13 @@
|
||||
html {
|
||||
@apply font-sans;
|
||||
}
|
||||
|
||||
/* 2. Site Header */
|
||||
header {
|
||||
@apply py-4 px-4 bg-yuika-blue-700;
|
||||
@apply py-4 px-4;
|
||||
}
|
||||
/* 2. Site Header */
|
||||
.index-navbar {
|
||||
z-index: 10;
|
||||
@apply transition-bg;
|
||||
}
|
||||
.index-navbar header {
|
||||
background-color: transparent;
|
||||
@ -161,7 +164,6 @@ footer {
|
||||
}
|
||||
|
||||
.nav-fixed {
|
||||
z-index: 10;
|
||||
@apply bg-yuika-blue-700;
|
||||
}
|
||||
|
||||
|
@ -31,14 +31,10 @@
|
||||
var progressMax = lastDocumentHeight - lastWindowHeight;
|
||||
|
||||
// show/hide nav
|
||||
if (lastScrollY >= trigger - 20) {
|
||||
nav.classList.add('fixed');
|
||||
if (lastScrollY >= nav.getBoundingClientRect().bottom) {
|
||||
nav.classList.add('nav-fixed');
|
||||
nav.classList.remove('absolute');
|
||||
} else {
|
||||
nav.classList.remove('fixed');
|
||||
nav.classList.remove('nav-fixed');
|
||||
nav.classList.add('absolute');
|
||||
}
|
||||
|
||||
ticking = false;
|
||||
|
@ -1,5 +1,6 @@
|
||||
{{!< default}}
|
||||
{{#author}}
|
||||
{{> "site-header"}}
|
||||
<div class="relative group index-header">
|
||||
{{> header-background background=cover_image}} {{!--Special header-image.hbs partial to generate the background image--}}
|
||||
<div class="h-full opacity-50 bg-black group-hover:opacity-75 transition-opacity">
|
||||
@ -45,7 +46,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{> "site-header"}}
|
||||
</div>
|
||||
{{/author}}
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
{{!< default}}
|
||||
{{> "site-header"}}
|
||||
<div class="h-64 relative group index-header">
|
||||
{{> header-background background=@site.cover_image}} {{!--Special header-image.hbs partial to generate the background image--}}
|
||||
<div class="w-full h-full opacity-50 bg-black group-hover:opacity-75 transition-opacity">
|
||||
</div>
|
||||
</div>
|
||||
{{> "site-header"}}
|
||||
</div>
|
||||
<div class="flex flex-wrap justify-start post-feed content w-full px-4">
|
||||
{{#foreach posts}}
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "yuika",
|
||||
"description": "nanao.moe's blog theme",
|
||||
"version": "0.5.0",
|
||||
"version": "0.6.0",
|
||||
"engines": {
|
||||
"ghost-api": "v3"
|
||||
},
|
||||
|
2
page.hbs
2
page.hbs
@ -1,6 +1,7 @@
|
||||
{{!< default}}
|
||||
|
||||
{{#post}}
|
||||
{{> "site-header"}}
|
||||
<div class="relative group index-header">
|
||||
{{> header-background background=feature_image}} {{!--Special header-image.hbs partial to generate the background image--}}
|
||||
<div class="h-full opacity-50 bg-black group-hover:opacity-75 transition-opacity">
|
||||
@ -13,7 +14,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{> "site-header"}}
|
||||
</div>
|
||||
|
||||
<article class="post-article">
|
||||
|
@ -1,4 +1,4 @@
|
||||
<div class="w-full flex flex-row justify-begin items-center absolute top-0 index-navbar">
|
||||
<div class="w-full flex flex-row justify-begin items-center fixed index-navbar">
|
||||
<header class="flex flex-row py-2 flex-wrap w-full">
|
||||
{{#if @site.logo}}
|
||||
<div class="w-12 h-12">
|
||||
|
2
post.hbs
2
post.hbs
@ -1,6 +1,7 @@
|
||||
{{!< default}}
|
||||
|
||||
{{#post}}
|
||||
{{> "site-header"}}
|
||||
<div class="relative group index-header">
|
||||
{{> header-background background=feature_image}} {{!--Special header-image.hbs partial to generate the background image--}}
|
||||
<div class="h-full opacity-50 bg-black group-hover:opacity-75 transition-opacity">
|
||||
@ -39,7 +40,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{> "site-header"}}
|
||||
</div>
|
||||
|
||||
<article class="post-article">
|
||||
|
2
tag.hbs
2
tag.hbs
@ -1,6 +1,7 @@
|
||||
{{!< default}}
|
||||
|
||||
{{#tag}}
|
||||
{{> "site-header"}}
|
||||
<div class="relative group index-header">
|
||||
{{> header-background background=feature_image}} {{!--Special header-image.hbs partial to generate the background image--}}
|
||||
<div class="h-full opacity-50 bg-black group-hover:opacity-75 transition-opacity">
|
||||
@ -23,7 +24,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{> "site-header"}}
|
||||
</div>
|
||||
{{/tag}}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user