From 480a88ab4e327aee1244a0a5d7ff18b98b06bc52 Mon Sep 17 00:00:00 2001 From: Baitinq Date: Sun, 31 Jul 2022 22:17:46 +0200 Subject: Add dark theme toggle functionality --- themes/researcher/assets/css/dark.css | 10 ++++ themes/researcher/exampleSite/config.toml | 53 -------------------- themes/researcher/exampleSite/content/_index.md | 1 - themes/researcher/exampleSite/content/about.md | 61 ----------------------- themes/researcher/exampleSite/content/contact.md | 24 --------- themes/researcher/exampleSite/static/avatar.jpg | Bin 12302 -> 0 bytes themes/researcher/exampleSite/static/favicon.ico | Bin 7406 -> 0 bytes themes/researcher/exampleSite/static/resume.pdf | Bin 96781 -> 0 bytes themes/researcher/layouts/partials/head.html | 3 ++ themes/researcher/layouts/partials/header.html | 3 +- themes/researcher/layouts/partials/toggle.html | 30 +++++++++++ 11 files changed, 45 insertions(+), 140 deletions(-) create mode 100644 themes/researcher/assets/css/dark.css delete mode 100644 themes/researcher/exampleSite/config.toml delete mode 120000 themes/researcher/exampleSite/content/_index.md delete mode 100644 themes/researcher/exampleSite/content/about.md delete mode 100644 themes/researcher/exampleSite/content/contact.md delete mode 100644 themes/researcher/exampleSite/static/avatar.jpg delete mode 100755 themes/researcher/exampleSite/static/favicon.ico delete mode 100644 themes/researcher/exampleSite/static/resume.pdf create mode 100644 themes/researcher/layouts/partials/toggle.html (limited to 'themes') diff --git a/themes/researcher/assets/css/dark.css b/themes/researcher/assets/css/dark.css new file mode 100644 index 0000000..42a92f7 --- /dev/null +++ b/themes/researcher/assets/css/dark.css @@ -0,0 +1,10 @@ +html { + filter: invert(100%) hue-rotate(180deg) brightness(105%) contrast(85%); + -webkit-filter: invert(100%) hue-rotate(180deg) brightness(105%) contrast(85%); +} +img, +video, +body * [style*="background-image"] { + filter: hue-rotate(180deg) contrast(100%) invert(100%); + -webkit-filter: hue-rotate(180deg) contrast(100%) invert(100%); +} diff --git a/themes/researcher/exampleSite/config.toml b/themes/researcher/exampleSite/config.toml deleted file mode 100644 index 1ca459a..0000000 --- a/themes/researcher/exampleSite/config.toml +++ /dev/null @@ -1,53 +0,0 @@ -title = "Researcher" -baseURL = "https://example.com" -theme = "researcher" -disableKinds = ["taxonomy", "term"] -enableEmoji = true -math = false # enable KaTeX (https://katex.org/) globally -googleAnalytics = "" # add your tracking id - -[params] - author = "Olivier Roques" - description = "A simple monospaced resume theme for Hugo." - favicon = "favicon.ico" # path to a .ico to use as favicon - logo = "" # url or path to a logo to put in the header - [params.footer] - text = "By Olivier Roques" - url = "https://github.com/ojroques/hugo-researcher" - [params.style] # appearance options (can be omitted) - fontFamily = "Inconsolata" - pageWidth = "750px" - avatarSize = "90px" - colorBlack = "#222222" - colorRed = "#dc3545" - [[params.socialIcons]] - icon = "fab fa-twitter" - title = "Twitter" - url = "https://twitter.com/" - [[params.socialIcons]] - icon = "fas fa-envelope" - title = "E-mail" - url = "mailto:mail@example.com" - -[permalinks] - "/" = "/:filename" - -[menu] - [[menu.main]] - name = "About" - url = "/about" - weight = 1 - [[menu.main]] - name = "Resume" - url = "/resume.pdf" - # 'pre' and 'post' hooks are available - # here we use an icon from Bootstrap https://icons.getbootstrap.com/ - pre = ' ' - weight = 2 - [[menu.main]] - name = "Contact" - url = "/contact" - weight = 3 - -[markup.goldmark.renderer] - unsafe = true # allow raw HTML in markdown files diff --git a/themes/researcher/exampleSite/content/_index.md b/themes/researcher/exampleSite/content/_index.md deleted file mode 120000 index 9728823..0000000 --- a/themes/researcher/exampleSite/content/_index.md +++ /dev/null @@ -1 +0,0 @@ -about.md \ No newline at end of file diff --git a/themes/researcher/exampleSite/content/about.md b/themes/researcher/exampleSite/content/about.md deleted file mode 100644 index b9fda09..0000000 --- a/themes/researcher/exampleSite/content/about.md +++ /dev/null @@ -1,61 +0,0 @@ -+++ -title = "About" -+++ - -## About Me - -{{< figure class="avatar" src="/avatar.jpg" alt="avatar">}} - -This is a Hugo based resume template. You can find the full source code on -[GitHub](https://github.com/ojroques/hugo-researcher). - -## Research Interest - -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam finibus ipsum -ac erat aliquam dapibus. Vestibulum vehicula placerat ex, a consectetur odio -pharetra quis[^1]. Mauris id urna ante. - -Fusce pharetra diam ac nisi aliquet, velegestas ex iaculis. Pellentesque -laoreet cursus tellus sed pellentesque. Praesent a rhoncus elit[^2]. Nunc -ipsum nisl, consequat sit amet pretium quis, gravida id ipsum. - -## Publications - -In chronological order: -1. F.Bar, J.Doe: Effects of having a placeholder of a name -2. S.Holmes, J.Watson: Consequences of living with a sociopath in London - -## Typography - -This is a [link](http://google.com). Something *italics* and something **bold**. - -Here is a table: - -Year | Award | Category ------|-------|-------- -2014 | Emmy | Won Outstanding Lead Actor in a miniseries or a movie -2015 | BAFTA | Nominated for Best Leading Actor for Sherlock -2014 | Satellite | Won Best Actor miniseries or television film - -Here is a horizontal rule: - ---- - -Here is a blockquote: - -> To a great mind, nothing is little - -Here is a `code` block: - -```python -def is_elementary(): - return True -``` - -## References - -* Foo Bar: Head of Department, Placeholder Names, Lorem -* John Doe: Associate Professor, Department of Computer Science, Ipsum - -[^1]: This is the first footnote. -[^2]: This is the second footnote. diff --git a/themes/researcher/exampleSite/content/contact.md b/themes/researcher/exampleSite/content/contact.md deleted file mode 100644 index a8864e1..0000000 --- a/themes/researcher/exampleSite/content/contact.md +++ /dev/null @@ -1,24 +0,0 @@ -+++ -title = "Contact" -+++ - -* Email: [foo@xyz.com](mailto:foo@xyz.com) -* Phone: [+91-123123](tel:+91-123123) - ---- - -## Mailing Address - -> 221B, Baker Street -> -> London -> -> United Kingdom - ---- - -## Social - -1. [Facebook](#) -2. [Twitter](#) -3. [Google+](#) diff --git a/themes/researcher/exampleSite/static/avatar.jpg b/themes/researcher/exampleSite/static/avatar.jpg deleted file mode 100644 index 062be4a..0000000 Binary files a/themes/researcher/exampleSite/static/avatar.jpg and /dev/null differ diff --git a/themes/researcher/exampleSite/static/favicon.ico b/themes/researcher/exampleSite/static/favicon.ico deleted file mode 100755 index 004044c..0000000 Binary files a/themes/researcher/exampleSite/static/favicon.ico and /dev/null differ diff --git a/themes/researcher/exampleSite/static/resume.pdf b/themes/researcher/exampleSite/static/resume.pdf deleted file mode 100644 index f720ae6..0000000 Binary files a/themes/researcher/exampleSite/static/resume.pdf and /dev/null differ diff --git a/themes/researcher/layouts/partials/head.html b/themes/researcher/layouts/partials/head.html index df307bb..5f792a8 100644 --- a/themes/researcher/layouts/partials/head.html +++ b/themes/researcher/layouts/partials/head.html @@ -12,6 +12,8 @@ {{ $style := resources.Get "sass/researcher.scss" | resources.ExecuteAsTemplate "sass/researcher.scss" . | toCSS | minify }} + {{ $darkstyle := resources.Get "css/dark.css" | minify }} + {{ with .Site.Params.favicon }} @@ -24,4 +26,5 @@ {{ if not .Site.IsServer }} {{ template "_internal/google_analytics.html" . }} {{ end }} + diff --git a/themes/researcher/layouts/partials/header.html b/themes/researcher/layouts/partials/header.html index b017ee2..8f97c4c 100644 --- a/themes/researcher/layouts/partials/header.html +++ b/themes/researcher/layouts/partials/header.html @@ -18,7 +18,8 @@ {{ end }} {{ end }} {{ end }} - + {{- partial "toggle.html" . -}} +
diff --git a/themes/researcher/layouts/partials/toggle.html b/themes/researcher/layouts/partials/toggle.html new file mode 100644 index 0000000..4ef8b86 --- /dev/null +++ b/themes/researcher/layouts/partials/toggle.html @@ -0,0 +1,30 @@ + + + -- cgit 1.4.1