8000 Changed color theme and changed the github svg by SarangKumar · Pull Request #22 · zxcodes/Calculator · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Feb 10, 2024. It is now read-only.

Changed color theme and changed the github svg #22

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
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
5 changes: 4 additions & 1 deletion assets/GitHubDark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion assets/GitHubLight.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion assets/MoonIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 18 additions & 18 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
<!-- This heading also notifies about the theme change.-->
<h1 id="toast">Calculator</h1>
<div class="top-buttons">
<a href="https://github.com/zxcodes/JavaScript-Calculator">
<img src="assets/GitHubLight.svg" alt="Sun Icon" height="22.5" width="22.5" id="github-icon">
<a target='_blank' href="https://github.com/zxcodes/JavaScript-Calculator">
<img src="assets/GitHubDark.svg" alt="Sun Icon" height="22.5" width="22.5" id="github-icon">
</a>
<button type="button" class="theme-button">
<img src="assets/SunIcon.svg" alt="Theme Icon" height="19" width="19" id="theme-icon">
Expand All @@ -34,28 +34,28 @@ <h1 id="toast">Calculator</h1>
<input type="button" value="C" id="clear-button" />
</div>
<div class="second-row">
<input type="button" value="1" />
<input type="button" value="2" />
<input type="button" value="3" />
<input type="button" value="+" />
<input type="button" class='btn' value="1" />
<input type="button" class='btn' value="2" />
<input type="button" class='btn' value="3" />
<input type="button" class='btn' value="+" />
</div>
<div class="third-row">
<input type="button" value="4" liveScreen(4)" />
<input type="button" value="5" liveScreen(5)" />
<input type="button" value="6" liveScreen(6)" />
<input type="button" value="-" />
<input type="button" class='btn' value="4" liveScreen(4)" />
<input type="button" class='btn' value="5" liveScreen(5)" />
<input type="button" class='btn' value="6" liveScreen(6)" />
<input type="button" class='btn' value="-" />
</div>
<div class="fourth-row">
<input type="button" value="7" />
<input type="button" value="8" />
<input type="button" value="9" liveScreen(9)" />
<input type="button" value="x" />
<input type="button" class='btn' value="7" />
<input type="button" class='btn' value="8" />
<input type="button" class='btn' value="9" liveScreen(9)" />
<input type="button" class='btn' value="x" />
</div>
<div class="fifth-row">
<input type="button" value="/" />
<input type="button" value="0" />
<input type="button" value="." />
<input type="button" value="=" />
<input type="button" class='btn' value="/" />
<input type="button" class='btn' value="0" />
<input type="button" class='btn' value="." />
<input type="button" class='btn' value="=" />
</div>
</div>
</div>
Expand Down
9 changes: 7 additions & 2 deletions scripts/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ const lightTheme = "styles/light.css";
const darkTheme = "styles/dark.css";
const sunIcon = "assets/SunIcon.svg";
const moonIcon = "assets/MoonIcon.svg";
const githubLight = "assets/githubLight.svg";
const githubDark = "assets/githubDark.svg";
const githubIcon = document.getElementById('github-icon');
const themeIcon = document.getElementById("theme-icon");
const res = document.getElementById("result");
const toast = document.getElementById("toast");
Expand All @@ -27,11 +30,13 @@ function changeTheme() {
if (theme.getAttribute("href") === lightTheme) {
theme.setAttribute("href", darkTheme);
themeIcon.setAttribute("src", sunIcon);
toast.innerHTML = "Dark Mode 🌙";
githubIcon.setAttribute("src", githubDark);
toast.innerHTML = "Dark Mode";
} else {
theme.setAttribute("href", lightTheme);
themeIcon.setAttribute("src", moonIcon);
toast.innerHTML = "Light Mode ☀️";
githubIcon.setAttribute("src", githubLight);
toast.innerHTML = "Light Mode";
}
}

Expand Down
30 changes: 24 additions & 6 deletions styles/dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,27 @@
justify-content: center;
flex-direction: column;
align-items: center;
background-color: rgb(20, 19, 19);
background-color: #292826;
transition: 0.8s all;
}

h1 {
margin-bottom: 1.5%;
color: #fff;
font-weight: normal;
font-weight: bolder;
font-size: 25px;
}

.container {
width: 350px;
width: 400px;
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
align-items: center; /* border:1px solid #000; */
padding:12px;
border-radius: 10px;
box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;

}

.header-container {
Expand All @@ -43,10 +48,13 @@ h1 {
width: 80%;
}

#result{
width:238px;
}

.top-buttons {
display: flex;
align-items: center;

}

input {
Expand All @@ -59,7 +67,17 @@ input {
border: none;
outline: none;
border-radius: 100px;
margin: 0.2em;
margin: 0.3em;
font-weight:600 ;
box-shadow: rgba(0, 0, 0, 0.16) 0px 3px 6px, rgba(0, 0, 0, 0.23) 0px 3px 6px;
transition: all 0.2s ease;

}

.btn:active{
box-shadow: rgba(60, 64, 67, 0.3) 0px 1px 2px 0px, rgba(60, 64, 67, 0.15) 0px 1px 3px 1px;
background-color: rgb(37, 35, 59);
color: #fff;
}

.first-row,
Expand Down
29 changes: 23 additions & 6 deletions styles/light.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,26 @@
justify-content: center;
flex-direction: column;
align-items: center;
background-color: rgb(7, 210, 199);
background-color: #f8f6f4;
transition: 0.8s all;
}

h1 {
margin-bottom: 1.5%;
color: #fff;
font-weight: normal;
color: rgb(122, 122, 122);
font-weight: bolder;
font-size: 25px;
}

.container {
width: 350px;
width: 400px;
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
padding:12px;
border-radius: 10px;
box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;
}

.header-container {
Expand All @@ -39,6 +43,10 @@ h1 {
width: 80%;
}

#result{
width:238px;
}

.top-buttons {
display: flex;
align-items: center;
Expand All @@ -54,7 +62,15 @@ input {
border: none;
outline: none;
border-radius: 100px;
margin: 0.2em;
margin: 0.3em;
font-weight:600 ;
box-shadow: rgba(0, 0, 0, 0.16) 0px 3px 6px, rgba(0, 0, 0, 0.23) 0px 3px 6px;
}

.btn:active{
box-shadow: rgba(60, 64, 67, 0.3) 0px 1px 2px 0px, rgba(60, 64, 67, 0.15) 0px 1px 3px 1px;
background-color: rgb(37, 35, 59);
color: #fff;
}

.first-row,
Expand All @@ -66,6 +82,7 @@ input {
}

input[type="button"] {
transition: all 0.2s ease;
color: rgb(122, 122, 122);
}

Expand All @@ -75,7 +92,7 @@ input[type="text"] {
}

input[type="button"]:hover {
background-color: rgb(37, 35, 59);
background-color: rgb(107, 107, 107);
color: #fff;
}

Expand Down
0