diff --git a/app.js b/app.js index 68931d5..c7c8f0c 100644 --- a/app.js +++ b/app.js @@ -35,3 +35,18 @@ function hideAll() { s.style.display = "none"; }); } + + +function switchTheme(){ + let currTheme = document.documentElement.style.getPropertyValue('color-scheme'); + console.log(currTheme); + if (currTheme == "dark") { + document.getElementsByClassName("fa-sun")[0].style.display = "none"; + document.getElementsByClassName("fa-moon")[0].style.display = "block"; + document.documentElement.style.setProperty('color-scheme', 'light'); + } else { + document.getElementsByClassName("fa-moon")[0].style.display = "none"; + document.getElementsByClassName("fa-sun")[0].style.display = "block"; + document.documentElement.style.setProperty('color-scheme', 'dark'); + } +} \ No newline at end of file diff --git a/build.sh b/build.sh index d299ffe..48e19f5 100755 --- a/build.sh +++ b/build.sh @@ -20,21 +20,6 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -write_header(){ - echo " - - - - - - - Gruvbox wallpapers - - - - -

Gruvbox Wallpapers

" > $1 -} write_section_header(){ echo "

" >> $3 @@ -47,15 +32,40 @@ write_img(){ \"$1\"" >> $2 } -write_footer(){ - echo "

Contributions!! here.

- -" >> $1 -} +rm *.html touch ./index.html -write_header ./index.html +echo " + + + + + + + Gruvbox wallpapers + + + + + +
+ +
+ + +
+ +

Gruvbox Wallpapers

" > ./index.html color=1 @@ -124,9 +134,15 @@ done echo " activeSection(\"${sections[0]}\"); + if(!window.matchMedia(\"(prefers-color-scheme: dark)\").matches){ + document.getElementsByClassName(\"fa-sun\")[0].style.display = \"none\"; + document.getElementsByClassName(\"fa-moon\")[0].style.display = \"block\"; + } } " >> ./index.html -write_footer ./index.html +echo " + +" >> ./index.html diff --git a/style.css b/style.css index 0216b17..9cbfc38 100644 --- a/style.css +++ b/style.css @@ -19,7 +19,7 @@ body { font-family: "Curier New", monospace; } -* { +*:not( i ) { color: var(--fg-color); } @@ -124,3 +124,27 @@ img:hover { .section { display: none; } + +.float-btns{ + position: fixed; + /*top: 80%;*/ + bottom: 10px; + right: 35px; +} + +.float-btn{ + background-color: var(--bg-color-reverse); + border: none; + color: var(--fg-color-reverse); + text-align: center; + text-decoration: none; + display: inline-block; + height: 2.5rem; + width: 2.5rem; + margin-bottom: 10px; +} + +.float-btn span{ + font-size: 1.5rem; + color: var(--fg-color-reverse); +} \ No newline at end of file