Skip to content

Commit cc9ad66

Browse files
committed
Make sidebar sticky
1 parent b7c6a11 commit cc9ad66

3 files changed

Lines changed: 26 additions & 25 deletions

File tree

www/_layouts/default.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
<article>
3737
<header>
3838
<div class="fade">
39-
<menu class="contentleft">
4039
<div class="title"><h1><a href="/"><img class="logobig" alt="DDraceNetwork" src="/ddnet2.svg"/><img class="logosmall" alt="DDraceNetwork" src="/ddnet.svg"/></a></h1></div>
40+
<menu class="contentleft">
4141
<ul class="big">
4242
<li><a href="/status/">Status</a></li>
4343
<li><a href="/ranks/">Ranks</a></li>

www/_layouts/post.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
<article>
3939
<header>
4040
<div class="fade">
41-
<menu class="contentleft">
4241
<div class="title"><h1><a href="/"><img class="logobig" alt="DDraceNetwork" src="/ddnet2.svg"/><img class="logosmall" alt="DDraceNetwork" src="/ddnet.svg"/></a><div class="fade"></div></h1></div>
42+
<menu class="contentleft">
4343
<ul class="big">
4444
<li><a href="/status/">Status</a></li>
4545
<li><a href="/ranks/">Ranks</a></li>

www/css.css

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,6 @@ body:not(#phpbb) .block {
7272

7373
.logobig {
7474
max-width: 16.8em;
75-
position: absolute;
76-
top: -15.2em;
77-
left: -0.5em;
7875
}
7976

8077
.logosmall {
@@ -740,13 +737,25 @@ body:not(#phpbb) .time {
740737

741738
@media (min-width: 1100px) {
742739
article {
740+
display: flex;
743741
margin: 0 auto;
744742
max-width: 99em;
745743
padding-top: 1em;
744+
min-height: 100vh;
745+
width: 100%;
746+
}
747+
748+
header {
749+
max-width: 20em;
750+
flex-shrink: 0;
751+
height: auto;
752+
}
753+
754+
.fade {
755+
height: 100%;
746756
}
747757

748758
section {
749-
margin: 0 0 0 20em;
750759
max-width: 80em;
751760
}
752761

@@ -766,8 +775,6 @@ body:not(#phpbb) .time {
766775

767776
menu {
768777
max-width: 20em;
769-
display: inline;
770-
float: left;
771778
}
772779

773780
.contentleft {
@@ -810,10 +817,13 @@ body:not(#phpbb) .time {
810817
padding: 2px 10px;
811818
text-align: right;
812819
width: 18.6em;
813-
top: 18em;
814820
margin-left: 0em;
815821
border-right: 3px solid #ffd246;
816822
transition-property: border-right-color;
823+
position: sticky;
824+
top: 1em;
825+
max-height: calc(100vh - 2em);
826+
overflow-y: auto;
817827
}
818828

819829
.contentleft ul {
@@ -830,20 +840,6 @@ body:not(#phpbb) .time {
830840
display: none;
831841
}
832842

833-
.title {
834-
position: absolute;
835-
}
836-
837-
.contentleft {
838-
position: absolute;
839-
}
840-
841-
.contentright {
842-
position: absolute;
843-
left: 39em;
844-
margin-top: -7em;
845-
}
846-
847843
.startvideo {
848844
float: left;
849845
width: 70%;
@@ -871,15 +867,20 @@ body:not(#phpbb) .time {
871867

872868
@media (max-width: 1099px) {
873869
header {
874-
position: relative;
875-
z-index: 0;
870+
position: sticky;
871+
z-index: 10;
872+
top: 0;
873+
background: var(--bg);
874+
border-bottom: 1px solid var(--border);
875+
margin-bottom: -1px;
876876
}
877877

878878
.fade {
879879
position: relative;
880880
background: linear-gradient(to left, #d8efff, rgba(216, 239, 255, 0) 5em);
881881
z-index: initial;
882882
pointer-events: none;
883+
display: flex;
883884
}
884885

885886
.logobig {

0 commit comments

Comments
 (0)