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 #50

Merged
merged 1 commit into from Oct 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
65 changes: 52 additions & 13 deletions index.html
Expand Up @@ -12,17 +12,31 @@
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">

<!-- FontAwesome -->
<script src="https://kit.fontawesome.com/5587893eae.js" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">

<!-- Custom CSS -->
<style>
body {
background-color: var(--secondary-color);
background-color: var(--primary-color);
}
#clear {
display: none;
text-transform: uppercase;
font-size: small;
margin-bottom: 10px;
}

:root {
--primary-color:white;
--secondary-color:black;
/* --ternary-color:rgb(41, 39, 39); */
}
.dark-theme{
--primary-color:black;
--secondary-color:white;
--ternary-color:rgb(41, 39, 39);
}
#clear:hover {
background-color: purple;
font-size: larger;
Expand All @@ -33,7 +47,7 @@
#btn33 {
font-size: large;
background-color: purple;
color: black;
color: var(--secondary-color);
}

#btn33:hover {
Expand All @@ -43,17 +57,17 @@
}


a:hover {
text-shadow: 5px 5px 5px black;
border: 1px outset white;
}
a:hover {
text-shadow: 5px 5px 5px var(--primary-color);
border: 1px outset var(--secondary-color);
}

#searchText {
background-color: black;
background-color: var(--secondary-color);
}

#searchText:hover {
background-color: white;
background-color: var(--primary-color);

transition: 1s;
}
Expand All @@ -73,7 +87,7 @@


#libraryForm {
border: 3px solid white;
border: 3px solid var(--primary-color);
box-shadow: 0px 3px 20px grey, 1px 0px 3px #bd8cbf;
padding: 20px;
border-radius: 20px;
Expand All @@ -91,9 +105,13 @@
text-style: outset;
font-weight: bold;
}

.form-control{
/* color:white; */
/* color:black; */
background-color:var(--ternary-color);
}
#table {
border: 3px solid white;
border: 3px solid var(--primary-color);
box-shadow: 0px 3px 20px grey, 1px 0px 3px #bd8cbf;
padding: 10px;
border-radius: 20px;
Expand Down Expand Up @@ -123,7 +141,22 @@
.input-right {
margin-left: 1em;
}

label{
color:var(--secondary-color);
}
legend{
color:var(--secondary-color);
}
#books{
color:var(--secondary-color);
}
#emptyMsg{
color:var(--secondary-color);
}
option{
background-color:var(--ternary-color);
color: var(--secondary-color);
}
</style>

</head>
Expand All @@ -132,7 +165,7 @@

<!--NavBar-->
<nav id="navbar" class="navbar navbar-expand-lg navbar-dark fixed-top"
style="background-color: #7952b3; opacity: .8;">
style="background-color: #7952b3; opacity: 0.9;">
<a class="navbar-brand mb-1" href="#" style="font-size: 24px;">
<marquee direction="right" scrollamount="5" onmouseover="this.stop();" onmouseout="this.start();">Online
Library</marquee>
Expand All @@ -157,7 +190,13 @@
placeholder="Search">
<button class="btn btn-dark my-2 my-sm-0 px-3" id="btn33" type="submit"
style="border-radius: 45px;">Search</button>

<a class="px-3 " style="font-size:20px;cursor: pointer;color: black;text-shadow: none;border: 0cm;">
<i id="icon" class="fa-solid fa-moon"></i>
</a>
</form>


</div>
</nav>

Expand Down
7 changes: 7 additions & 0 deletions script.js
Expand Up @@ -525,3 +525,10 @@ radioButtons.forEach((btn) => {
}
})
})

// dark mode
var icon = document.getElementById("icon");

icon.onclick=function(){
document.body.classList.toggle("dark-theme");
}