Skip to content

Commit

Permalink
Improve CSS styling, add better sticky sidebar, fix logos
Browse files Browse the repository at this point in the history
  • Loading branch information
froggleston committed Sep 18, 2024
1 parent 1d45c12 commit 92001be
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 68 deletions.
41 changes: 28 additions & 13 deletions _layouts/glossary.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,32 @@
<link rel="stylesheet" type="text/css" href="{{ relative_root_path }}/assets/css/glossary.css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
{% include matomo.html %}

<script type="text/javascript" src="{{site.baseurl}}/assets/js/sticky-sidebar.min.js"></script>
</head>
<body>
<main>
{% include title.html %}
<div id="content-wrapper">
<div class="inner clearfix">
<section id="main-content-{{ direction }}">
{% include glossary.html headings = headings %}
</section>
<div class="sticky-{{ direction }}">
{% assign char_arr = headings | split: '' %}
{% for char in char_arr %}
<a class="letter_links"
href="#{{char}}">{{char}}</>
</a>
<br>
{% endfor %}

<div class="main-content clearfix">
<div id="main-content-{{ direction }}" class="content">
{% include glossary.html headings = headings %}
</div>
<div id="sidebar" class="sidebar sticky-{{ direction }}">
<div class="sidebar__inner">
{% assign char_arr = headings | split: '' %}
{% for char in char_arr %}
<div id="{{char}}" class="letter">
<a class="letter_links"
href="#{{char}}">{{char}}</>
</a>
</div>
<!-- <br> -->
{% endfor %}
</div>
</div>
</div>

</main>
<footer>
<p>
Expand All @@ -49,3 +55,12 @@
</p>
</footer>
</body>

<script type="text/javascript">
var sidebar = new StickySidebar('.sidebar', {
topSpacing: 20,
bottomSpacing: 20,
containerSelector: '.main-content',
innerWrapperSelector: '.sidebar__inner'
});
</script>
96 changes: 47 additions & 49 deletions assets/css/glossary.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ a:hover {

.button-ltr,
.button-rtl {
width: 134px;
height: 58px;
padding-top: 22px;
width: 202px;
height: 84px;
padding-top: 16px;
padding-left: 68px;
font-family: 'Helvetica Neue', Helvetica, Arial, serif;
font-size: 20px;
Expand All @@ -76,55 +76,65 @@ a:hover {
display: block;
}

.sidebar{
will-change: min-height;
}

.sidebar__inner{
transform: translate(0, 0); /* For browsers don't support translate3d. */
transform: translate3d(0, 0, 0);
will-change: position, transform;
}

.sticky-home,
.sticky-ltr,
.sticky-rtl {
position: sticky;
z-index: 0;
top: 0;
overflow: scroll;
overflow-x: hidden;
height: 95%;
background-color: grey;
color: white;
text-align: center;
vertical-align: middle;
align-contents: center;
padding-top: 30px;
padding-bottom: 30px;
bottom: 30px;
}

.sticky-home {
float: right;
margin-right: 1cm;
// margin-right: 1cm;
right: 0;
width: 20%;
}

.sticky-ltr {
float: right;
margin-right: 1cm;
// margin-right: 1cm;
right: 0;
width: 6%;
}

.sticky-rtl {
float: left;
margin-left: 1cm;
// margin-left: 1cm;
left: 0;
width: 6%;
}

.letter {
display: flex;
align-items: center;
justify-content: center;
font-size: 20px;
border: 1px solid grey;
background-color: grey;
color: white;
}

.lang_links,
.letter_links {
font-family: Arial, Helvetica, sans-serif;
text-align: center;
vertical-align: middle;
text-decoration: none;
font-size: 24;
font-size: px;
color: white;
margin: 20px 0% 30px 0%;
margin: 10px 0% 10px 0%;
}

.lang_links {
Expand All @@ -139,8 +149,6 @@ a:hover {
}

#content-wrapper {
padding-top: 30px;
border-top: solid 1px #fff;
margin-right: 0cm;
margin-left: 0cm;
}
Expand All @@ -156,8 +164,7 @@ a:hover {

#main-content-home {
float: left;
width: 60%;
max-width: 100%;
max-width: 73%;
padding: 1cm 1cm 1cm 1cm;
margin-left: 1cm;
}
Expand All @@ -175,8 +182,7 @@ a:hover {
#main-content-ltr,
#main-content-rtl {
padding: .5cm 1cm 1cm 1cm;
width: 75%;
max-width: 85%;
max-width: 87%;
}

#main-content-home,
Expand All @@ -191,9 +197,9 @@ a:hover {

.button-ltr,
.button-rtl {
width: 134px;
height: 58px;
padding-top: 22px;
width: 202px;
height: 84px;
padding-top: 16px;
padding-left: 68px;
font-family: 'Helvetica Neue', Helvetica, Arial, serif;
font-size: 20px;
Expand Down Expand Up @@ -222,40 +228,38 @@ a:hover {

.sticky-home {
display: none;
margin-right: 1cm;
}

.sticky-ltr,
.sticky-rtl {
position: sticky;
z-index: 0;
top: 8;
overflow: scroll;
overflow-x: hidden;
height: 110%;
width: 12%;
background-color: grey;
color: white;
text-align: center;
vertical-align: middle;
padding-bottom: 40px;
padding-top: 30px;
}

.sticky-ltr {
float: right;
margin-right: 0cm;
right: 0;
bottom: 30px;
}

.sticky-rtl {
float: left;
margin-left: .5cm;
left: 0;
bottom: 30px;
}

.letter {
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
border: 1px solid grey;
background-color: grey;
color: white;
}

.lang_links { }

.letter_links {
Expand All @@ -266,10 +270,7 @@ a:hover {
text-decoration: none;
}

#content-wrapper {
padding-top: 30px;
border-top: solid 1px #fff;
}
#content-wrapper { }

.clearfix:after {
display: block;
Expand All @@ -283,24 +284,21 @@ a:hover {

#main-content-home {
float: left;
width: 77%;
max-width: 80%;
max-width: 99%;
padding: 1cm 1cm 1cm 1cm;
margin-left: .5cm;
}

#main-content-ltr {
float: left;
width: 65%;
max-width: 80%;
max-width: 87%;
padding: 1cm .5cm 1cm 1cm;
margin-left: .5cm;
}

#main-content-rtl {
float: right;
width: 65%;
max-width: 80%;
max-width: 87%;
padding: 1cm 1cm 1cm .5cm;
margin-right: .5cm;
}
Expand Down
8 changes: 8 additions & 0 deletions assets/js/sticky-sidebar.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 5 additions & 6 deletions static/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ body {
img.logo {
float: left;
vertical-align: middle;
width: 15%;
width: 150px;
}

.row {
Expand All @@ -35,7 +35,7 @@ body {
float: right;
width: 100%;
}

.right-rtl {
float: right;
width: 25%;
Expand All @@ -45,16 +45,15 @@ body {
}

@media screen and (max-width: 768px) {

img.logo {
float: left;
vertical-align: middle;
width: 25%;
}
width: 120px;
}

.row {
background: grey;
width: 100%;
margin-left: .5cm;
margin-right: 1cm;
}
Expand Down

0 comments on commit 92001be

Please sign in to comment.