diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index c4b88eb..51b373c 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -82,6 +82,7 @@ - [Hussaini Zulkifli](https://github.com/hussaini/) - [Ellison Leão](https://github.com/ellisonleao) - [Lucas de Oliveira](https://github.com/lucas-dOliveira) +- [Jian Loong Liew](https://github.com/JianLoong) - [earnest ma](https://github.com/earnestma) - [TMineCola](https://github.com/tminecola) -- [Arafat Hasan](https://github.com/arafat-hasan) \ No newline at end of file +- [Arafat Hasan](https://github.com/arafat-hasan) diff --git a/assets/scss/_float.scss b/assets/scss/_float.scss new file mode 100644 index 0000000..c98e1f4 --- /dev/null +++ b/assets/scss/_float.scss @@ -0,0 +1,25 @@ +.float-container { + bottom: 2rem; + right: 2rem; + z-index: 100; + position: fixed; + font-size: 1.6em; + a { + display: block; + color: $alt-fg-color; + background-color: $alt-bg-color; + font-size: 2.0rem; + padding: 0.5rem; + border-radius: 0.5rem; + opacity: 50%; + transition: opacity 0.5s, color 0.5s; + &:hover, &:focus { + color: $link-color; + opacity: 100%; + @media only screen and (max-width : 768px) { + color: $alt-fg-color; + opacity: 50%; + } + } + } +} diff --git a/assets/scss/_float_dark.scss b/assets/scss/_float_dark.scss new file mode 100644 index 0000000..40b984b --- /dev/null +++ b/assets/scss/_float_dark.scss @@ -0,0 +1,24 @@ +@mixin float_dark { + .float-container { + a { + color: $alt-fg-color-dark; + background-color: $alt-bg-color-dark; + &:hover, &:focus { + color: $link-color-dark; + @media only screen and (max-width : 768px) { + color: $alt-fg-color-dark; + } + } + } + } +} + +body.colorscheme-dark { + @include float_dark() +} + + body.colorscheme-auto { + @media (prefers-color-scheme: dark) { + @include float_dark() + } +} diff --git a/assets/scss/_navigation.scss b/assets/scss/_navigation.scss index 84f7014..343a46d 100644 --- a/assets/scss/_navigation.scss +++ b/assets/scss/_navigation.scss @@ -74,6 +74,10 @@ margin: 1.7rem 0; font-size: 2.4rem; line-height: inherit; + bottom: 2rem; + left: 2rem; + z-index: 100; + position: fixed; } #menu-toggle { display: none; diff --git a/assets/scss/coder-dark.scss b/assets/scss/coder-dark.scss index 2cd4cf9..9f7576b 100644 --- a/assets/scss/coder-dark.scss +++ b/assets/scss/coder-dark.scss @@ -3,3 +3,4 @@ @import "content_dark"; @import "navigation_dark"; @import "footer_dark"; +@import "float_dark"; diff --git a/assets/scss/coder.scss b/assets/scss/coder.scss index 2866b6c..6e27811 100644 --- a/assets/scss/coder.scss +++ b/assets/scss/coder.scss @@ -4,3 +4,4 @@ @import "navigation"; @import "pagination"; @import "footer"; +@import "float"; diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 516cfef..ec7eff4 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -99,6 +99,7 @@
+ {{ partial "float" . }}