Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dark mode #214

Closed
wants to merge 19 commits into from
19 changes: 19 additions & 0 deletions src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,22 @@ window.addEventListener('load', () => {

cascade.call(window, true);
});

var mode = document.getElementsByClassName("fas");
aslafy-z marked this conversation as resolved.
Show resolved Hide resolved
mode[0].addEventListener("click",function(){
sseficha marked this conversation as resolved.
Show resolved Hide resolved
sseficha marked this conversation as resolved.
Show resolved Hide resolved
const body = document.querySelector('body');
sseficha marked this conversation as resolved.
Show resolved Hide resolved
body.classList.toggle("dark_container");
const heading_h1 = document.querySelector("section.main .heading h1");
sseficha marked this conversation as resolved.
Show resolved Hide resolved
heading_h1.classList.toggle("dark");
const heading_p = document.querySelectorAll("section.main .heading p");
heading_p[0].classList.toggle("dark");
heading_p[1].classList.toggle("dark");
const descriptions = document.querySelectorAll("section.main .content .item p.description");
for (var i =0; i<descriptions.length; i++) {
descriptions[i].classList.toggle("dark");
}
const refs = document.querySelectorAll("section.main .content .item a");
for (var i =0; i<refs.length; i++) {
refs[i].classList.toggle("dark_refs");
}
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you run npm run lint and fix any issues? Thanks!

3 changes: 2 additions & 1 deletion src/pug/includes/body.pug
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ include ./fork.pug
section.main.flex

.heading.flex
i.fas.fa-moon
h1 devSwag
p 😎 swag opportunities for developers
p As a developer, nothing piques my interest more than developer swag! I created devSwag to scratch my own itch by starting a curation of such opportunities in Feb '18. These are crowdsourced and verified by the community. All of them ship worldwide!
Expand Down Expand Up @@ -59,7 +60,7 @@ include ./fork.pug

footer.flex
.item.flex
iframe(src='https://upscri.be/67d2fa?as_embed', style='width:100%;max-width:800px;margin:0 auto;', height='400', frameborder='0', title='Subscribe for updates')
iframe(src='https://upscri.be/67d2fa?as_embed', style='width:100%;max-width:800px;margin:0 auto;border:5px solid white;border-radius: 15px;', height='400', frameborder='0', title='Subscribe for updates')
sseficha marked this conversation as resolved.
Show resolved Hide resolved
.item.flex
p Made with ❤︎ by #[a(href="https://github.com/swapagarwal") Swapnil Agarwal]
.item.flex
Expand Down
1 change: 1 addition & 0 deletions src/pug/includes/head.pug
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ meta(http-equiv="X-UA-Compatible" content="IE=edge")

Copy link
Collaborator

@aslafy-z aslafy-z Jan 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes should be reverted.

meta(name="description" content="swag opportunities for developers")

<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous">
aslafy-z marked this conversation as resolved.
Show resolved Hide resolved
sseficha marked this conversation as resolved.
Show resolved Hide resolved

link(rel="icon" type="image/png" href="/assets/img/logo.png")
link(rel="apple-touch-icon" size="128x128" href="/assets/img/logo.png")
Expand Down
15 changes: 14 additions & 1 deletion src/styl/index.styl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@require "imports/base"

aslafy-z marked this conversation as resolved.
Show resolved Hide resolved
vikaspotluri123 marked this conversation as resolved.
Show resolved Hide resolved
.container
min-height 100vh
width 100vw
Expand Down Expand Up @@ -102,6 +102,19 @@ footer
.item
width 100%

.dark_container
background-color black
sseficha marked this conversation as resolved.
Show resolved Hide resolved
color white !important

.dark
color white !important

.dark_refs
color #2a2aad !important

.fas
cursor pointer

@import "imports/a11y"

#content .item.visible
Expand Down