Skip to content

Commit

Permalink
feat[close #32]: hide topbar when reading/scrolling through articles
Browse files Browse the repository at this point in the history
  • Loading branch information
mirkobrombin committed Jan 28, 2024
1 parent f9d8fd8 commit 2981b22
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="topbar">
<div class="topbar" :class="{ 'is-sticky': stickyTopbar }">
<div class="container">
<nav class="navbar" role="navigation" aria-label="main navigation">
<div class="navbar-brand">
Expand Down Expand Up @@ -106,6 +106,9 @@ export default defineComponent({
chronosStore() {
return useChronosStore();
},
stickyTopbar() {
return this.$route.name !== "article";
},
},
watch: {
$route(to, from) {
Expand Down
9 changes: 8 additions & 1 deletion src/assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,14 @@ p span.badge {
.topbar {
background-color: #fff;
border-bottom: 1px solid #dddddd;
position: sticky;
top: 0;
z-index: 9;
}

.topbar.is-sticky {
position: sticky;
}

.navbar-end {
gap: 10px;
}
Expand Down Expand Up @@ -362,6 +365,10 @@ p span.badge {
z-index: 1;
}

.topbar:not(.is-sticky)~.breadcrumb.is-main {
top: 0;
}

.breadcrumb.is-main~.paned .sidebar aside {
top: 130px;
height: calc(100vh - 130px);
Expand Down

0 comments on commit 2981b22

Please sign in to comment.