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 added #19

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
131 changes: 131 additions & 0 deletions public/stylesheets/main.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,133 @@
/* CSS FOR NAVIGATION BAR */

.gap{
padding-right: 50px;
}

.help{
padding-right: 30px;
}


.navbar a:hover {
background-color: black;

.navbar-icon-top .navbar-nav .nav-link > .fa {
position: relative;
width: 36px;
font-size: 24px;
}

.navbar-icon-top .navbar-nav .nav-link > .fa > .badge {
font-size: 0.75rem;
position: absolute;
right: 0;
font-family: sans-serif;
}

.navbar-icon-top .navbar-nav .nav-link > .fa {
top: 3px;
line-height: 12px;

}

.navbar-icon-top .navbar-nav .nav-link > .fa > .badge {
top: -10px;
}

@media (min-width: 576px) {
.navbar-icon-top.navbar-expand-sm .navbar-nav .nav-link {
text-align: center;
display: table-cell;
height: 70px;
vertical-align: middle;
padding-top: 0;
padding-bottom: 0;
}

.navbar-icon-top.navbar-expand-sm .navbar-nav .nav-link > .fa {
display: block;
width: 48px;
margin: 2px auto 4px auto;
top: 0;
line-height: 24px;
}

.navbar-icon-top.navbar-expand-sm .navbar-nav .nav-link > .fa > .badge {
top: -7px;
}
}

@media (min-width: 768px) {
.navbar-icon-top.navbar-expand-md .navbar-nav .nav-link {
text-align: center;
display: table-cell;
height: 70px;
vertical-align: middle;
padding-top: 0;
padding-bottom: 0;
}

.navbar-icon-top.navbar-expand-md .navbar-nav .nav-link > .fa {
display: block;
width: 48px;
margin: 2px auto 4px auto;
top: 0;
line-height: 24px;
}

.navbar-icon-top.navbar-expand-md .navbar-nav .nav-link > .fa > .badge {
top: -7px;
}
}

@media (min-width: 992px) {
.navbar-icon-top.navbar-expand-lg .navbar-nav .nav-link {
text-align: center;
display: table-cell;
height: 70px;
vertical-align: middle;
padding-top: 0;
padding-bottom: 0;
}

.navbar-icon-top.navbar-expand-lg .navbar-nav .nav-link > .fa {
display: block;
width: 48px;
margin: 2px auto 4px auto;
top: 0;
line-height: 24px;
}

.navbar-icon-top.navbar-expand-lg .navbar-nav .nav-link > .fa > .badge {
top: -7px;
}
}

@media (min-width: 1200px) {
.navbar-icon-top.navbar-expand-xl .navbar-nav .nav-link {
text-align: center;
display: table-cell;
height: 70px;
vertical-align: middle;
padding-top: 0;
padding-bottom: 0;
}

.navbar-icon-top.navbar-expand-xl .navbar-nav .nav-link > .fa {
display: block;
width: 48px;
margin: 2px auto 4px auto;
top: 0;
line-height: 24px;
}

.navbar-icon-top.navbar-expand-xl .navbar-nav .nav-link > .fa > .badge {
top: -7px;
}
}


h1 {
font-family: Arial, Helvetica, sans-serif;
text-align: center;
Expand All @@ -15,6 +145,7 @@ hr.style-two {
);
}


/* The sidebar menu */

.sidenav {
Expand Down
85 changes: 64 additions & 21 deletions views/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,75 @@
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.css">
<!-- <link rel="stylesheet" type="text/css" media="screen" href="main.css"> -->
<!-- <script src="main.js"></script> -->

<!-- Stylesheet for enabling dark darkmode -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/darkmode-js.min.js"></script>

</head>

<body>


<!-- -----------------------------------NAVBAR--------------------------------- -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<a class="navbar-brand" href="/" style="color:white"><span style="color:red">i</span>Blog</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>

<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="#">About <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item active">
<a class="nav-link" href="#">Contact<span class="sr-only">(current)</span></a>
</li>
<li class="nav-item active">
<a class="nav-link" href="/writing/postStory">New Blog<span class="sr-only">(current)</span></a>
</li>

</ul>
</div>
<nav class=" clear navbar navbar-icon-top navbar-expand-lg navbar-dark bg-primary">
<a class=" gap navbar-brand" href="/" style="color:white"> <span style="color:red">i</span>Blog</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>

<div class=" pad collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class=" help nav-item active">
<a class="nav-link" href="#">
<i class=" fa fa-home"></i>
Home
<span class="badge badge-danger"></span>
</a>
</li>
<!-- <li class=" help nav-item active">
<a class="nav-link" href="#">
<i class="fa fa-address-card"></i>
About
<span class="badge badge-danger"></span>
</a>
</li>
<li class=" help nav-item active">
<a class="nav-link" href="#">
<i class="fa fa-phone-volume"></i>
Contact
<span class="badge badge-danger"></span>
</a>
</li> -->
<li class=" help nav-item active">
<a class="nav-link" href="/writing/postStory">
<i class="far fa-edit"></i>
New Blog
<span class="badge badge-danger">NEW</span>
</a>
</li>

<script>

const options ={
bottom: '32px',
right: '32px',
left: 'unset',
time: '0.5s',
mixColor: '#fff',
backgroundColor: '#fff',
buttonColorDark: '#100f2c',
buttonColorLight: '#fff',
saveInCookies: false,
label: '🌓',
autoMatchOsTheme: true
}

const darkmode = new Darkmode(options);
darkmode.showWidget();

</script>

</div>
</nav>


Expand Down Expand Up @@ -80,4 +123,4 @@
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js" integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.js"></script>

</html>
</html>