mirror of
https://github.com/zedeus/nitter.git
synced 2026-03-05 13:30:19 -05:00
@@ -66,10 +66,10 @@ settings:
|
|||||||
|
|
||||||
routes:
|
routes:
|
||||||
get "/":
|
get "/":
|
||||||
resp renderMain(renderSearch(), request, cfg, themePrefs())
|
resp renderMain(renderSearch(), request, cfg, cookiePrefs())
|
||||||
|
|
||||||
get "/about":
|
get "/about":
|
||||||
resp renderMain(renderAbout(), request, cfg, themePrefs())
|
resp renderMain(renderAbout(), request, cfg, cookiePrefs())
|
||||||
|
|
||||||
get "/explore":
|
get "/explore":
|
||||||
redirect("/about")
|
redirect("/about")
|
||||||
|
|||||||
@@ -60,6 +60,9 @@ genPrefs:
|
|||||||
stickyProfile(checkbox, true):
|
stickyProfile(checkbox, true):
|
||||||
"Make profile sidebar stick to top"
|
"Make profile sidebar stick to top"
|
||||||
|
|
||||||
|
stickyNav(checkbox, true):
|
||||||
|
"Keep navbar fixed to top"
|
||||||
|
|
||||||
bidiSupport(checkbox, false):
|
bidiSupport(checkbox, false):
|
||||||
"Support bidirectional text (makes clicking on tweets harder)"
|
"Support bidirectional text (makes clicking on tweets harder)"
|
||||||
|
|
||||||
|
|||||||
@@ -17,13 +17,8 @@ template cookiePrefs*(): untyped {.dirty.} =
|
|||||||
template cookiePref*(pref): untyped {.dirty.} =
|
template cookiePref*(pref): untyped {.dirty.} =
|
||||||
getPref(cookies(request), pref)
|
getPref(cookies(request), pref)
|
||||||
|
|
||||||
template themePrefs*(): Prefs =
|
|
||||||
var res = defaultPrefs
|
|
||||||
res.theme = cookiePref(theme)
|
|
||||||
res
|
|
||||||
|
|
||||||
template showError*(error: string; cfg: Config): string =
|
template showError*(error: string; cfg: Config): string =
|
||||||
renderMain(renderError(error), request, cfg, themePrefs(), "Error")
|
renderMain(renderError(error), request, cfg, cookiePrefs(), "Error")
|
||||||
|
|
||||||
template getPath*(): untyped {.dirty.} =
|
template getPath*(): untyped {.dirty.} =
|
||||||
$(parseUri(request.path) ? filterParams(request.params))
|
$(parseUri(request.path) ? filterParams(request.params))
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export feature
|
|||||||
proc createUnsupportedRouter*(cfg: Config) =
|
proc createUnsupportedRouter*(cfg: Config) =
|
||||||
router unsupported:
|
router unsupported:
|
||||||
template feature {.dirty.} =
|
template feature {.dirty.} =
|
||||||
resp renderMain(renderFeature(), request, cfg, themePrefs())
|
resp renderMain(renderFeature(), request, cfg, cookiePrefs())
|
||||||
|
|
||||||
get "/about/feature": feature()
|
get "/about/feature": feature()
|
||||||
get "/login/?@i?": feature()
|
get "/login/?@i?": feature()
|
||||||
|
|||||||
@@ -115,11 +115,14 @@ ul {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding-top: 50px;
|
|
||||||
margin: auto;
|
margin: auto;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
body.fixed-nav .container {
|
||||||
|
padding-top: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
.icon-container {
|
.icon-container {
|
||||||
display: inline;
|
display: inline;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
nav {
|
nav {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
position: fixed;
|
|
||||||
background-color: var(--bg_overlays);
|
background-color: var(--bg_overlays);
|
||||||
box-shadow: 0 0 4px $shadow;
|
box-shadow: 0 0 4px $shadow;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
@@ -16,6 +15,10 @@ nav {
|
|||||||
.icon-button button {
|
.icon-button button {
|
||||||
color: var(--fg_nav);
|
color: var(--fg_nav);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
body.fixed-nav & {
|
||||||
|
position: fixed;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.inner-nav {
|
.inner-nav {
|
||||||
|
|||||||
@@ -39,7 +39,11 @@
|
|||||||
text-align: left;
|
text-align: left;
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
max-width: 32%;
|
max-width: 32%;
|
||||||
top: 50px;
|
top: 0;
|
||||||
|
|
||||||
|
body.fixed-nav & {
|
||||||
|
top: 50px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.profile-result {
|
.profile-result {
|
||||||
|
|||||||
@@ -16,8 +16,10 @@
|
|||||||
|
|
||||||
.main-tweet,
|
.main-tweet,
|
||||||
.replies {
|
.replies {
|
||||||
padding-top: 50px;
|
body.fixed-nav & {
|
||||||
margin-top: -50px;
|
padding-top: 50px;
|
||||||
|
margin-top: -50px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.main-tweet .tweet-content {
|
.main-tweet .tweet-content {
|
||||||
|
|||||||
@@ -131,7 +131,8 @@ proc renderMain*(body: VNode; req: Request; cfg: Config; prefs=defaultPrefs;
|
|||||||
renderHead(prefs, cfg, req, titleText, desc, video, images, banner, ogTitle,
|
renderHead(prefs, cfg, req, titleText, desc, video, images, banner, ogTitle,
|
||||||
rss, twitterLink)
|
rss, twitterLink)
|
||||||
|
|
||||||
body:
|
let bodyClass = if prefs.stickyNav: "fixed-nav" else: ""
|
||||||
|
body(class=bodyClass):
|
||||||
renderNavbar(cfg, req, rss, twitterLink)
|
renderNavbar(cfg, req, rss, twitterLink)
|
||||||
|
|
||||||
tdiv(class="container"):
|
tdiv(class="container"):
|
||||||
|
|||||||
Reference in New Issue
Block a user