Skip to content

Commit 0876aa5

Browse files
author
HimC29
committed
App Update - New apps, better UI, more app functionality
1 parent 09b7077 commit 0876aa5

23 files changed

Lines changed: 77 additions & 20 deletions

README.md

100644100755
File mode changed.

apps/Calculator/index.html

100644100755
File mode changed.

apps/Calculator/index.js

100644100755
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const display = document.getElementById("display");
22
let userInputs = [];
3+
let calculated = false;
34
display.value = "Calculator"
45

56
function formatInputForScreen(userInputs){
@@ -33,6 +34,14 @@ function displayToScreen(){
3334
}
3435

3536
function appendToken(input){
37+
// If we just calculated and the new input is a number, clear and start fresh
38+
if(calculated && !isNaN(input)){
39+
clearDisplay();
40+
}
41+
// If an operator is pressed after a calculation, don't clear, just reset the flag
42+
if(calculated && isNaN(input)){
43+
calculated = false;
44+
}
3645
userInputs.push(input);
3746
displayToScreen();
3847
console.log(userInputs);
@@ -51,6 +60,7 @@ function delLastDigit(){
5160
}
5261

5362
function calculate(){
63+
calculated = true;
5464
let formattedEquation = "";
5565
let sqrtActive = false;
5666
for(const input of userInputs){

apps/Calculator/style.css

100644100755
Lines changed: 65 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,79 @@
1+
* {
2+
box-sizing: border-box;
3+
}
4+
15
body {
26
margin: 0;
3-
display: flex;
4-
justify-content: center;
5-
align-items: center;
7+
padding: 0;
68
height: 100vh;
9+
width: 100vw;
10+
overflow: hidden;
711
background-color: hsl(0, 0%, 75%);
12+
font-family: Arial, Helvetica, sans-serif;
813
}
914

1015
#calculator {
11-
font-family: Arial, Helvetica, sans-serif;
12-
background-color: hsl(0, 0%, 15%);
13-
border-radius: 1rem; /* was 15px */
14-
max-width: 90vw; /* responsive width */
15-
width: 400px; /* fallback for large screens */
16+
width: 100%;
17+
height: 100%;
18+
display: flex;
19+
flex-direction: column;
20+
background: linear-gradient(135deg, hsl(0, 0%, 20%), hsl(0, 0%, 15%));
1621
overflow: hidden;
1722
}
1823

1924
#display {
20-
width: calc(100% - 2rem); /* padding-aware */
21-
padding: 1.25rem; /* was 20px */
22-
font-size: 4rem; /* scales with container */
25+
width: 100%;
26+
padding: 2rem;
27+
flex: 0 0 20%;
28+
font-size: clamp(2rem, 10vh, 5rem);
2329
text-align: right;
2430
border: none;
25-
background-color: hsl(0, 0%, 20%);
26-
color: white;
31+
background-color: hsl(0, 0%, 10%);
32+
color: #ffffff;
2733
overflow-x: auto;
34+
overflow-y: hidden;
35+
resize: none;
36+
font-weight: bold;
2837
}
2938

3039
#keys {
3140
display: grid;
3241
grid-template-columns: repeat(4, 1fr);
33-
gap: 0.625rem; /* was 10px */
34-
padding: 1.5rem; /* was 25px */
42+
gap: 1rem;
43+
padding: 1.5rem;
44+
flex: 1;
45+
grid-auto-rows: 1fr;
46+
min-height: 0;
47+
width: 100%;
48+
max-width: 80rem;
49+
margin: 0 auto;
3550
}
3651

3752
button {
38-
width: 100%; /* fill grid cell */
39-
aspect-ratio: 1; /* keep buttons square */
40-
border-radius: 50%; /* circular buttons */
53+
border-radius: 0.5rem;
4154
border: none;
4255
background-color: hsl(0, 0%, 30%);
4356
color: white;
44-
font-size: 1.5rem; /* scales better on smaller screens */
57+
font-size: clamp(1rem, 5vw, 3rem);
4558
font-weight: bold;
4659
cursor: pointer;
47-
transition: background-color 0.2s;
60+
transition: all 0.15s ease;
61+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
62+
display: flex;
63+
align-items: center;
64+
justify-content: center;
4865
}
4966

5067
button:hover {
5168
background-color: hsl(0, 0%, 40%);
69+
transform: translateY(-2px);
70+
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
5271
}
5372

5473
button:active {
5574
background-color: hsl(0, 0%, 50%);
75+
transform: translateY(0);
76+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
5677
}
5778

5879
.operator-btn {
@@ -66,3 +87,27 @@ button:active {
6687
.operator-btn:active {
6788
background-color: hsl(35, 100%, 75%);
6889
}
90+
91+
/* Mobile/Responsive adjustments */
92+
@media (max-width: 600px) {
93+
#keys {
94+
gap: 0.75rem;
95+
padding: 1rem;
96+
}
97+
98+
#display {
99+
padding: 1.5rem 1rem;
100+
}
101+
}
102+
103+
@media (max-width: 400px) {
104+
#keys {
105+
gap: 0.5rem;
106+
padding: 0.75rem;
107+
}
108+
109+
#display {
110+
padding: 1rem;
111+
font-size: clamp(1.5rem, 8vh, 3rem);
112+
}
113+
}

apps/Settings/index.html

100644100755
File mode changed.

apps/Settings/script.js

100644100755
File mode changed.

apps/Settings/style.css

100644100755
File mode changed.

apps/apps.js

100644100755
File mode changed.

datetime.js

100644100755
File mode changed.

fonts/Poppins-BoldItalic.ttf

100644100755
File mode changed.

0 commit comments

Comments
 (0)