let index = env.parsed_url.pathname.indexOf('/', 1)
let dir = index === -1 ? '' : env.parsed_url.pathname.slice(1, index)
- div.container {
- div.row.align-items-center.py-3 {
- div.col-sm-8 {
- _out.push(logo_large)
- }
- div.'col-sm-4' {
- //div {
- // let signed_in =
- // Object.prototype.hasOwnProperty.call(env.session, 'account')
- // span#signed-in-status {
- // if (signed_in)
- // `Signed in as ${env.session.account}.`
- // else
- // 'Browsing as guest.'
- // }
- // ' '
- // if (signed_in)
- // a#sign-in(href="" hidden="") {'Sign in'}
- // else
- // a#sign-in(href="") {'Sign in'}
- // ' '
- // if (signed_in)
- // a#sign-out(href="") {'Sign out'}
- // else
- // a#sign-out(href="" hidden="") {'Sign out'}
- //}
- //p {}
-
- form/*.form-inline*/(action="/search/index.html") {
- div.input-group {
- input.form-control(name="query" type="text" placeholder="Search" aria-describedby="search-button") {}
- div.input-group-append {
- button.btn.btn-outline-secondary#search-button(type="submit") {
- _out.push(icon_search_mono)
+ div.scrollbar-fix {
+ div.container {
+ div.row.align-items-center.py-3 {
+ div.col-sm-8 {
+ _out.push(logo_large)
+ }
+ div.'col-sm-4' {
+ //div {
+ // let signed_in =
+ // Object.prototype.hasOwnProperty.call(env.session, 'account')
+ // span#signed-in-status {
+ // if (signed_in)
+ // `Signed in as ${env.session.account}.`
+ // else
+ // 'Browsing as guest.'
+ // }
+ // ' '
+ // if (signed_in)
+ // a#sign-in(href="" hidden="") {'Sign in'}
+ // else
+ // a#sign-in(href="") {'Sign in'}
+ // ' '
+ // if (signed_in)
+ // a#sign-out(href="") {'Sign out'}
+ // else
+ // a#sign-out(href="" hidden="") {'Sign out'}
+ //}
+ //p {}
+
+ form/*.form-inline*/(action="/search/index.html") {
+ div.input-group {
+ input.form-control(name="query" type="text" placeholder="Search" aria-describedby="search-button") {}
+ div.input-group-append {
+ button.btn.btn-outline-secondary#search-button(type="submit") {
+ _out.push(icon_search_mono)
+ }
}
}
}
}
+
+ //div.'col-sm-1'.vbottom {
+ // // a nested div is used to avoid hover colour on the padding
+ // div.nav-li-a(style="text-align: center;") {
+ // a(href="/online_store/view_cart/index.html") {
+ // div.cart-icon {
+ // _out.push(icon_cart_small)
+ // }
+ // div.cart-number {
+ // div.cart-circle {
+ // `${(env.cart.items || []).length}`
+ // }
+ // }
+ // }
+ // }
+ //}
}
-
- //div.'col-sm-1'.vbottom {
- // // a nested div is used to avoid hover colour on the padding
- // div.nav-li-a(style="text-align: center;") {
- // a(href="/online_store/view_cart/index.html") {
- // div.cart-icon {
- // _out.push(icon_cart_small)
- // }
- // div.cart-number {
- // div.cart-circle {
- // `${(env.cart.items || []).length}`
- // }
- // }
- // }
- // }
- //}
}
}
- nav.navbar.navbar-expand-lg.navbar-dark.bg-primary {
+ nav.navbar.navbar-expand-lg.navbar-dark.bg-primary.scrollbar-fix {
div.container {
//a.navbar-brand(href="#") {'Navbar'}
//' '
}
}
}
- div.container {
- await body(_out)
+ div.scrollbar-fix {
+ div.container {
+ await body(_out)
+ }
}
- footer {
+ footer.scrollbar-fix {
div.container {
a(rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/") {
img(alt="Creative Commons License" style="border-width:0;" src="/images/by-sa_3.0_88x31.png") {}
$footer-link-color: darken(theme-color("success"), 10%);
$footer-link-hover-color: darken($footer-link-color, 10%);
+// apply this to a div inside the body tag
+// prevents page shifting to left/right as scrollbar appears/disappears
+// it works by calculating the width of the scrollbar and then adding
+// the corresponding amount of padding to left to keep things centered
+// see https://stackoverflow.com/questions/45524214/how-do-i-stop-my-web-content-from-shifting-left-when-the-vertical-scrollbar-appe
+.scrollbar-fix {
+ padding-left: calc(100vw - 100%);
+}
+
// apply this to svg, see _svg/icon_search.svg
.svg-icon {
display: inline-block;
//bottom: -.125em;
}
-// note: needs to match the bootstrap border spinner
-.svg-color {
- width: 32px;
- height: 32px;
-}
-
// use this to display the pi symbol without horrible blocky look in Sans
.serif {
font-family: $font-family-serif;