Skip to content

Commit

Permalink
feat: implement fixed sidebar for improved navigation on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
akhileshthite committed Mar 28, 2024
1 parent 7d43ecb commit 5267632
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 4 deletions.
3 changes: 3 additions & 0 deletions about.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ <h1 class="header-branding">Social Reader</h1>
</p>
</div>
</div>
<div class="right-column">
<!-- This is an empty column to balance the layout -->
</div>
</div>
<script type="module" src="followed-accounts.js"></script>
<script type="module" src="./theme-selector.js"></script>
3 changes: 3 additions & 0 deletions followed-accounts.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ <h1 class="header-branding">Social Reader</h1>
list.</span
>
</div>
<div class="right-column">
<!-- This is an empty column to balance the layout -->
</div>
</div>
<script>
document
Expand Down
3 changes: 3 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ <h1 class="header-branding">Social Reader</h1>
</nav>
</div>
<reader-timeline></reader-timeline>
<div class="right-column">
<!-- This is an empty column to balance the layout -->
</div>
</div>
<script type="module" src="./dbInstance.js"></script>
<script type="module" src="./timeline.js"></script>
Expand Down
3 changes: 3 additions & 0 deletions profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ <h1 class="header-branding">Social Reader</h1>
<button id="nextPage">Next ></button>
</div>
</div>
<div class="right-column">
<!-- This is an empty column to balance the layout -->
</div>
</div>
<script>
// Pagination controls
Expand Down
35 changes: 31 additions & 4 deletions timeline.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,31 @@ body {
align-items: flex-start;
min-height: 100vh;
font-family: var(--rdp-font);
background: var(--bg-color);
}

.container {
display: flex;
justify-content: center;
align-items: flex-start;
justify-content: space-between;
max-width: 1200px;
width: 100%;
margin-top: 20px;
position: relative;
}

.header-branding {
color: var(--rdp-text-color);
}

.sidebar {
position: sticky;
top: 0;
flex: 0 0 250px;
display: flex;
flex-direction: column;
align-items: flex-start;
height: 100vh;
overflow-y: auto;
}

.sidebar h1 {
Expand Down Expand Up @@ -67,6 +73,22 @@ reader-timeline {
margin: 0 20px;
}

/* Empty right column for balance */
.right-column {
flex: 0 0 200px;
}

@media screen and (max-width: 1280px) {
.sidebar {
flex: 0 0 200px;
margin-left: 14px;
}

.right-column {
flex: 0 0 100px;
}
}

@media screen and (max-width: 768px) {
.container {
flex-direction: column;
Expand All @@ -78,11 +100,10 @@ reader-timeline {
position: fixed;
top: 0;
z-index: 100;
max-height: 100vh;
max-height: calc(100vh - 82vh);
overflow-y: auto;
align-items: center;
background-color: var(--bg-color);
padding: 10px;
}

.sidebar h1 {
Expand All @@ -100,3 +121,9 @@ reader-timeline {
margin-top: 150px;
}
}

@media screen and (max-width: 400px) {
.sidebar {
padding-bottom: 50px;
}
}

0 comments on commit 5267632

Please sign in to comment.