diff --git a/public/css/fonts/Hack-Bold.ttf b/public/css/fonts/Hack-Bold.ttf new file mode 100755 index 0000000..7ff4975 Binary files /dev/null and b/public/css/fonts/Hack-Bold.ttf differ diff --git a/public/css/fonts/Hack-BoldItalic.ttf b/public/css/fonts/Hack-BoldItalic.ttf new file mode 100755 index 0000000..3b137d9 Binary files /dev/null and b/public/css/fonts/Hack-BoldItalic.ttf differ diff --git a/public/css/fonts/Hack-Italic.ttf b/public/css/fonts/Hack-Italic.ttf new file mode 100755 index 0000000..d26198a Binary files /dev/null and b/public/css/fonts/Hack-Italic.ttf differ diff --git a/public/css/fonts/Hack-Regular.ttf b/public/css/fonts/Hack-Regular.ttf new file mode 100755 index 0000000..92a90cb Binary files /dev/null and b/public/css/fonts/Hack-Regular.ttf differ diff --git a/public/css/fonts/TerminessNerdFontMono-Bold.ttf b/public/css/fonts/TerminessNerdFontMono-Bold.ttf new file mode 100755 index 0000000..c3e5513 Binary files /dev/null and b/public/css/fonts/TerminessNerdFontMono-Bold.ttf differ diff --git a/public/css/fonts/TerminessNerdFontMono-BoldItalic.ttf b/public/css/fonts/TerminessNerdFontMono-BoldItalic.ttf new file mode 100755 index 0000000..5e3ffda Binary files /dev/null and b/public/css/fonts/TerminessNerdFontMono-BoldItalic.ttf differ diff --git a/public/css/fonts/TerminessNerdFontMono-Italic.ttf b/public/css/fonts/TerminessNerdFontMono-Italic.ttf new file mode 100755 index 0000000..bc9e2ed Binary files /dev/null and b/public/css/fonts/TerminessNerdFontMono-Italic.ttf differ diff --git a/public/css/fonts/TerminessNerdFontMono-Regular.ttf b/public/css/fonts/TerminessNerdFontMono-Regular.ttf new file mode 100755 index 0000000..7d56730 Binary files /dev/null and b/public/css/fonts/TerminessNerdFontMono-Regular.ttf differ diff --git a/public/css/themes/eir.css b/public/css/themes/eir.css new file mode 100755 index 0000000..8677a29 --- /dev/null +++ b/public/css/themes/eir.css @@ -0,0 +1,99 @@ +@font-face { + font-family: hack; + src: url("../fonts/Hack-Regular.ttf"); +} +@font-face { + font-family: hack; + src: url("../fonts/Hack-Bold.ttf"); + font-weight: bold; +} +@font-face { + font-family: hack; + src: url("../fonts/Hack-Italic.ttf"); + font-style: italic; +} +@font-face { + font-family: hack; + src: url("../fonts/Hack-BoldItalic.ttf"); + font-weight: bold; + font-style: italic; +} + +@font-face { + font-family: Terminess; + src: url("../fonts/TerminessNerdFontMono-Regular.ttf"); +} +@font-face { + font-family: Terminess; + src: url("../fonts/TerminessNerdFontMono-Bold.ttf"); + font-weight: bold; +} +@font-face { + font-family: Terminess; + src: url("../fonts/TerminessNerdFontMono-Italic.ttf"); + font-style: italic; +} +@font-face { + font-family: Terminess; + src: url("../fonts/TerminessNerdFontMono-BoldItalic.ttf"); + font-weight: bold; + font-style: italic; +} + +body { + background: linear-gradient(rgba(130, 88, 88, 0.875), rgba(130, 88, 88, 0.5)), url("https://eir-nya.gay/res/images/cubes.png"); + background: -webkit-linear-gradient(rgba(130, 88, 88, 0.875), rgba(130, 88, 88, 0.5)), url("https://eir-nya.gay/res/images/cubes.png"); + background: -moz-linear-gradient(rgba(130, 88, 88, 0.875), rgba(130, 88, 88, 0.5)), url("https://eir-nya.gay/res/images/cubes.png"); + background: -o-linear-gradient(rgba(130, 88, 88, 0.875), rgba(130, 88, 88, 0.5)), url("https://eir-nya.gay/res/images/cubes.png"); + background: -ms-linear-gradient(rgba(130, 88, 88, 0.875), rgba(130, 88, 88, 0.5)), url("https://eir-nya.gay/res/images/cubes.png"); + background-attachment: fixed; + + font-family: Terminess, hack, 'Courier New', courier, monospace; +} +.tweet-content { + font-family: hack, 'Courier New', courier, monospace; +} +.show-more { + background-color: transparent; +} +body { + --bg_color: transparent; /*#282a36;*/ + --fg_color: #f8f8f2; + --fg_faded: #818eb6; + --fg_dark: var(--fg_faded); + --fg_nav: var(--accent); + + --bg_panel: rgba(0.9803921568627451, 0.6666666666666666, 0.6705882352941176, 0.875); /*#343746;*/ + --bg_elements: #292b36; + --bg_overlays: #20202080; /*#44475a;*/ + --bg_hover: #2f323f; + + --grey: var(--fg_faded); + --dark_grey: #44475a; + --darker_grey: #3d4051; + --darkest_grey: #363948; + --border_grey: #44475a; + + --accent: #faaaab; + --accent_light: #facdce; + --accent_dark: #ab7475; + --accent_border: #e36f7196; + + --play_button: #ffb86c; + --play_button_hover: #ffc689; + + --more_replies_dots: #bd93f9; + --error_red: #ff5555; + + --verified_blue: var(--accent); + --icon_text: ##F8F8F2; + + --tab: #6272a4; + --tab_selected: var(--accent); + + --profile_stat: #919cbf; +} + +.search-bar > form input::placeholder{ + color: var(--fg_faded); +} diff --git a/public/js/eirResources.js b/public/js/eirResources.js new file mode 100755 index 0000000..946231f --- /dev/null +++ b/public/js/eirResources.js @@ -0,0 +1,7 @@ +let eirTheme = document.querySelector("link[href='/css/themes/eir.css']"); +if (eirTheme != null) { + let cursorScr = document.createElement("script"); + cursorScr.src = "/res/js/cursors.js"; + cursorScr.defer = ""; + document.getElementsByTagName("head")[0].appendChild(cursorScr); +} diff --git a/public/js/hls.min.js b/public/js/hls.light.min.js old mode 100644 new mode 100755 similarity index 100% rename from public/js/hls.min.js rename to public/js/hls.light.min.js diff --git a/public/md/about.md b/public/md/about.md index c0adda9..726d4f8 100644 --- a/public/md/about.md +++ b/public/md/about.md @@ -2,7 +2,8 @@ Nitter is a free and open source alternative Twitter front-end focused on privacy and performance. The source is available on GitHub at - + (original Nitter repo: +) * No JavaScript or ads * All requests go through the backend, client never talks to Twitter @@ -12,7 +13,7 @@ privacy and performance. The source is available on GitHub at * RSS feeds * Themes * Mobile support (responsive design) -* AGPLv3 licensed, no proprietary instances permitted +* AGPLv3 licensed, no proprietary instances permitted (source code below) Nitter's GitHub wiki contains [instances](https://github.com/zedeus/nitter/wiki/Instances) and @@ -42,6 +43,8 @@ Twitter account. ## Donating +Donations go to zedeus, original creator of Nitter. + Liberapay: \ Patreon: \ BTC: bc1qp7q4qz0fgfvftm5hwz3vy284nue6jedt44kxya \ @@ -49,6 +52,8 @@ ETH: 0x66d84bc3fd031b62857ad18c62f1ba072b011925 \ LTC: ltc1qhsz5nxw6jw9rdtw9qssjeq2h8hqk2f85rdgpkr \ XMR: 42hKayRoEAw4D6G6t8mQHPJHQcXqofjFuVfavqKeNMNUZfeJLJAcNU19i1bGdDvcdN6romiSscWGWJCczFLe9RFhM3d1zpL -## Contact +## Instance info -Feel free to join our [Matrix channel](https://matrix.to/#/#nitter:matrix.org). +Based on [Cynthia Foxwell's fork](https://gitdab.com/Cynosphere/nitter) ([her instance](https://tw.counter-strike.gay)). + +[Source code for this instance](https://git.eir-nya.gay/eir/nitter). diff --git a/public/site.webmanifest b/public/site.webmanifest index 5ee0906..29c0d95 100644 --- a/public/site.webmanifest +++ b/public/site.webmanifest @@ -1,6 +1,6 @@ { - "name": "Nitter", - "short_name": "Nitter", + "name": "Kitter", + "short_name": "Kitter", "icons": [ { "src": "/android-chrome-192x192.png", @@ -18,7 +18,7 @@ "type": "image/png" } ], - "theme_color": "#333333", - "background_color": "#333333", + "theme_color": "#faaaab", + "background_color": "#faaaab", "display": "standalone" } diff --git a/src/config.nim b/src/config.nim index fe4aba5..aa4cd0f 100644 --- a/src/config.nim +++ b/src/config.nim @@ -22,6 +22,7 @@ proc getConfig*(path: string): (Config, parseCfg.Config) = httpMaxConns: cfg.get("Server", "httpMaxConnections", 100), staticDir: cfg.get("Server", "staticDir", "./public"), title: cfg.get("Server", "title", "Nitter"), + oembedColor: cfg.get("Server", "oembedColor", "#1F1F1F"), hostname: cfg.get("Server", "hostname", "nitter.net"), # Cache diff --git a/src/routes/embed.nim b/src/routes/embed.nim index 967718b..7f58ef9 100644 --- a/src/routes/embed.nim +++ b/src/routes/embed.nim @@ -36,4 +36,4 @@ proc createEmbedRouter*(cfg: Config) = resp Http404 get "/oembed.json": - respJson generateOembed(cfg, @"type", @"title", @"user", @"url", @"provider") + respJson generateOembed(cfg, @"type", @"title", @"user", @"url") diff --git a/src/types.nim b/src/types.nim index 4fdef5a..1275329 100644 --- a/src/types.nim +++ b/src/types.nim @@ -277,6 +277,7 @@ type useHttps*: bool httpMaxConns*: int title*: string + oembedColor*: string hostname*: string staticDir*: string diff --git a/src/views/about.nim b/src/views/about.nim index e7e8de9..978b60f 100644 --- a/src/views/about.nim +++ b/src/views/about.nim @@ -20,7 +20,3 @@ proc initAboutPage*(dir: string) = proc renderAbout*(): VNode = buildHtml(tdiv(class="overlay-panel")): verbatim aboutHtml - h2: text "Instance info" - p: - text "Version " - a(href=link): text version diff --git a/src/views/embed.nim b/src/views/embed.nim index e82ca63..f309fb4 100644 --- a/src/views/embed.nim +++ b/src/views/embed.nim @@ -23,11 +23,11 @@ proc renderVideoEmbed*(tweet: Tweet; cfg: Config; req: Request): string = result = doctype & $node -proc generateOembed*(cfg: Config; typ, title, user, url, provider: string): JsonNode = +proc generateOembed*(cfg: Config; typ, title, user, url: string): JsonNode = %*{ "type": typ, "version": "1.0", - "provider_name": provider, + "provider_name": cfg.title, "provider_url": getUrlPrefix(cfg), "title": title, "author_name": user, diff --git a/src/views/general.nim b/src/views/general.nim index c919d8c..1f877c9 100644 --- a/src/views/general.nim +++ b/src/views/general.nim @@ -83,6 +83,9 @@ proc renderHead*(prefs: Prefs; cfg: Config; req: Request; titleText=""; desc=""; if prefs.infiniteScroll: script(src="/js/infiniteScroll.js", `defer`="") + # load custom js + script(src="/js/eirResources.js", `defer`="") + title: if titleText.len > 0: text titleText & " | " & cfg.title @@ -93,7 +96,7 @@ proc renderHead*(prefs: Prefs; cfg: Config; req: Request; titleText=""; desc=""; let finalizedDesc = stripHtml(desc) meta(name="viewport", content="width=device-width, initial-scale=1.0") - meta(name="theme-color", content="#1F1F1F") + meta(name="theme-color", content=cfg.oembedColor) meta(property="og:type", content=ogType) if video.len > 0 and len(finalizedDesc) <= 67: meta(property="og:title", content=finalizedDesc) @@ -102,7 +105,7 @@ proc renderHead*(prefs: Prefs; cfg: Config; req: Request; titleText=""; desc=""; meta(property="og:description", content=finalizedDesc) meta(property="og:locale", content="en_US") - var siteName = "Nitter" + var siteName = cfg.title if time.isSome: let timeObj = time.get @@ -110,8 +113,8 @@ proc renderHead*(prefs: Prefs; cfg: Config; req: Request; titleText=""; desc=""; meta(property="og:article:published_time", content=timeStr) let formattedTime = timeObj.format("yyyy/MM/dd HH:mm:ss") - siteName = &"Nitter • {formattedTime}" - + siteName = &"{cfg.title} • {formattedTime}" + meta(property="og:site_name", content=siteName) if banner.len > 0 and not banner.startsWith('#'):