Skip to content

Commit a518ad5

Browse files
updated
1 parent d2f4f4b commit a518ad5

File tree

3 files changed

+97
-35
lines changed

3 files changed

+97
-35
lines changed

index.html

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,22 +56,25 @@
5656
<button id="fullscreen-button" aria-label="Toggle Fullscreen" onclick="toggleFullscreen()">
5757
<i class="fas fa-expand"></i>
5858
</button>
59+
<button id="delete-button" aria-label="delete" onclick="deleteEntire()">
60+
<i class="fas fa-trash"></i>
61+
</button>
5962
</aside>
6063

6164
<!-- Main Content -->
6265
<main class="flex-grow-1 d-flex flex-column">
6366
<!-- Dynamic Tool Options -->
6467
<section id="tool-options-container" class="p-3 bg-light">
6568
<div id="pen-options" class="tool-options active">
66-
<label for="pen-size">Pen Size:</label>
67-
<input type="range" id="pen-size" min="2" max="50" value="10">
68-
<label for="pen-color">Pen Color:</label>
69+
<label for="pen-size"></label>
70+
<input type="number" id="pen-size" min="2" max="50" value="10">
71+
<label for="pen-color"></label>
6972
<input type="color" id="pen-color" value="#000000">
7073
</div>
7174

7275
<div id="eraser-options" class="tool-options">
73-
<label for="eraser-size">Eraser Size:</label>
74-
<input type="range" id="eraser-size" min="2" max="50" value="20">
76+
<label for="eraser-size">Eraser Size</label>
77+
<input type="number" id="eraser-size" min="2" max="50" value="20">
7578
</div>
7679

7780
<div id="text-options" class="tool-options">
@@ -84,16 +87,16 @@
8487
<section class="flex-grow-1 d-flex justify-content-center align-items-center">
8588
<canvas id="whiteboard"></canvas>
8689
</section>
90+
<footer class="mt-auto">
91+
<div class="container text-center py-2">
92+
<h6>Whiteboard | Made with ❤️ by <a href="https://github.com/skvprogrammer" class="text-light">SKV</a></h6>
93+
</div>
94+
</footer>
95+
8796
</main>
8897
</div>
8998

90-
<!-- Footer -->
91-
<footer class="mt-auto">
92-
<div class="container text-center py-2">
93-
<h6>Whiteboard | Made with ❤️ by <a href="https://github.com/skvprogrammer" class="text-light">SKV</a></h6>
94-
</div>
95-
</footer>
96-
99+
97100
<script src="script.js"></script>
98101
</body>
99102

script.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ document.getElementById("eraser-size").addEventListener("input", (e) => {
159159
// Save Work
160160
function saveWork() {
161161
const link = document.createElement("a");
162-
link.download = "whiteboard.png";
163-
link.href = canvas.toDataURL("image/png");
162+
link.download = "whiteboard.jpg";
163+
link.href = canvas.toDataURL("image/jpg");
164164
link.click();
165165
}
166166

@@ -194,6 +194,14 @@ function toggleFullscreen() {
194194
document.exitFullscreen();
195195
}
196196
}
197+
function deleteEntire() {
198+
const canvas = document.getElementById('whiteboard'); // Replace with your canvas ID
199+
const ctx = canvas.getContext('2d');
200+
201+
// Clear the entire canvas
202+
ctx.clearRect(0, 0, canvas.width, canvas.height);
203+
}
204+
197205

198206
// Call resizeCanvas when fullscreen changes
199207
document.addEventListener('fullscreenchange', resizeCanvas);

style.css

Lines changed: 72 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ body {
5555
align-items: center;
5656
justify-content: center; */
5757
/* position: relative; */
58-
/* overflow: hidden; For ripple effect */
58+
5959
}
6060

6161
#side-menu button:hover {
@@ -91,40 +91,89 @@ body {
9191
}
9292

9393
/* Tool Options */
94-
/* #tool-options-container {
95-
padding: 16px;
96-
background-color: #f9f9f9;
97-
border-bottom: 1px solid #e0e0e0;
98-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
99-
} */
94+
#tool-options-container {
95+
max-width:400px;
96+
}
97+
/* Tool Options Container */
98+
.tool-options {
99+
display: flex;
100+
align-items: center;
101+
gap: 5px;
102+
padding: 10px 12px;
103+
background: linear-gradient(145deg, #f7f7f7, #e4e4e4);
104+
border-radius: 16px;
105+
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
106+
transition: all 0.3s ease;
107+
}
108+
109+
.tool-options:hover {
110+
transform: translateY(-5px); /* Subtle lift effect */
111+
box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15); /* Enhanced shadow on hover */
112+
}
100113

114+
/* Label Styling */
101115
.tool-options label {
102-
font-size: 0.9rem;
103-
font-weight: 500;
104-
margin-right: 8px;
105-
color: #555; /* Muted gray text */
116+
font-size: 1.2rem;
117+
font-weight: 600;
118+
color: #333;
119+
text-transform: capitalize;
120+
letter-spacing: 1px;
121+
transition: color 0.3s ease, transform 0.3s ease;
106122
}
107123

124+
.tool-options label:hover {
125+
color: #ff6f61; /* Soft coral color */
126+
transform: translateY(-2px); /* Slight lift effect */
127+
}
128+
129+
/* Input Styling */
108130
.tool-options input {
109-
margin-right: 16px;
110-
border-radius: 4px;
111-
border: 1px solid #ccc;
112-
padding: 4px;
113-
font-size: 0.9rem;
131+
margin-right: 24px;
132+
border-radius: 10px;
133+
border: 1px solid #ddd;
134+
padding: 10px 16px;
135+
font-size: 1rem;
136+
background: #fff;
137+
color: #444;
138+
transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
139+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
114140
}
115141

142+
.tool-options input:focus {
143+
border-color: #4a90e2; /* Soft blue border on focus */
144+
outline: none;
145+
box-shadow: 0 0 12px rgba(74, 144, 226, 0.4); /* Soft blue glow */
146+
transform: translateY(-2px); /* Lift effect on focus */
147+
}
148+
149+
/* Color Input Styling */
116150
.tool-options input[type="color"] {
117-
border: none;
151+
width: 48px;
152+
height: 48px;
118153
padding: 0;
119-
width: 36px;
120-
height: 36px;
154+
border: none;
121155
cursor: pointer;
156+
border-radius: 50%;
157+
transition: all 0.3s ease;
158+
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
159+
}
160+
161+
.tool-options input[type="color"]:hover {
162+
transform: scale(1.1); /* Zoom effect on hover */
163+
box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3); /* Blue glow on hover */
164+
}
165+
166+
.tool-options input[type="color"]:active {
167+
transform: scale(0.95); /* Slight press effect */
122168
}
123169

170+
.tool-options input[type="color"]::-webkit-color-swatch-wrapper {
171+
border-radius: 50%;
172+
}
173+
174+
/* Active State of Tool Options */
124175
.tool-options.active {
125176
display: flex;
126-
align-items: center;
127-
gap: 16px;
128177
}
129178

130179
.tool-options:not(.active) {
@@ -137,6 +186,8 @@ body {
137186
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle inner shadow */
138187
background: #ffffff; /* White background */
139188
cursor: crosshair;
189+
width: 80vw; /* 80% of the viewport width */
190+
height: 80vh;
140191
}
141192

142193
/* Footer Styling */

0 commit comments

Comments
 (0)