-
Notifications
You must be signed in to change notification settings - Fork 317
/
index.html
1590 lines (1322 loc) · 52.2 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Creative Canvas Tool</title>
<meta name="description"
content="Canvas Editor is an intuitive, interactive tool for drawing, editing, and enhancing digital images directly on a canvas. Supports a wide range of brushes, colors, and editing features.">
<meta name="keywords"
content="canvas editor, drawing tool, image editor, interactive editor, digital canvas, online drawing, image editing features, paint tool, art editor, graphic design tool, photo editing, vector editor, HTML5 canvas, JavaScript drawing, online sketch, freehand drawing, digital art tool, custom brushes, canvas manipulation, web-based editor, graphics editor, color palette, shape editor, text overlay, photo effects, pixel art, raster editor, online image editor, creative tools, visual editor">
<!-- Open Graph / Facebook -->
<meta property="og:type" content="website">
<meta property="og:url" content="https://github.com/vishanurag/Canvas-Editor">
<meta property="og:title" content="Canvas Editor - Interactive Drawing & Editing Tool">
<meta property="og:description"
content="Canvas Editor is an intuitive, interactive tool for drawing, editing, and enhancing digital images directly on a canvas. Supports a wide range of brushes, colors, and editing features.">
<meta property="og:image" content="resources/favicon.ico">
<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:url" content="https://github.com/vishanurag/Canvas-Editor">
<meta property="twitter:title" content="Canvas Editor - Interactive Drawing & Editing Tool">
<meta property="twitter:description"
content="Canvas Editor is an intuitive, interactive tool for drawing, editing, and enhancing digital images directly on a canvas. Supports a wide range of brushes, colors, and editing features.">
<meta property="twitter:image" content="resources/favicon.ico">
<!-- Additional SEO Tags -->
<meta name="keywords"
content="canvas editor, drawing tool, image editor, interactive editor, digital canvas, online drawing, image editing features">
<meta name="author" content="Vishanurag">
<link rel="canonical" href="https://github.com/vishanurag/Canvas-Editor">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="icon" href="resources/favicon.ico" type="image/ico">
<link rel="manifest" href="/manifest.json">
<div class="visitor-counter">
<div>Visitor</div>
<div class="website-counter"></div>
</div>
<style>
#toggleGridButton {
margin-top: 10px;
}
.visitor-counter {
position: fixed;
top: 570px;
left: 10px;
background-color: rgba(255, 255, 255, 0.8);
/* Slightly opaque background for better visibility */
height: 100px;
width: 100px;
color: #333;
/* Darker text for better contrast */
font-weight: 700;
font-size: 18px;
text-align: center;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
border-radius: 12px;
/* Softer corners */
backdrop-filter: blur(10px);
/* Increased blur for a modern touch */
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15),
/* Slightly more pronounced shadow */
0 2px 4px rgba(0, 0, 0, 0.1);
z-index: 1000;
transition: all 0.3s ease;
/* Smooth transition for hover effect */
}
.visitor-counter:hover {
transform: scale(1.05);
/* Slightly enlarge on hover */
box-shadow: 0 8px 16px rgba(197, 56, 215, 0.2);
/* Enhance shadow on hover */
}
.visitor-counter div:first-child {
margin-bottom: 5px;
font-size: 14px;
/* Adjusted for clarity */
letter-spacing: 1px;
/* Increased spacing for readability */
}
.website-counter {
font-size: 24px;
font-family: 'Arial', sans-serif;
/* Consistent font family */
}
@media screen and (max-width: 768px) {
.visitor-counter {
height: 100px;
width: 100px;
font-size: 16px;
}
.website-counter {
font-size: 20px;
}
}
@media screen and (max-width: 480px) {
.visitor-counter {
height: 80px;
width: 80px;
font-size: 14px;
}
.website-counter {
font-size: 18px;
}
}
.dark-mode .visitor-counter div {
color: #f0f0f0;
/* Lighter text for dark mode */
}
.dark-mode .visitor-counter .website-counter {
color: #f0f0f0;
/* Lighter color for consistency */
}
.dark-mode .visitor-counter {
background-color: rgba(185, 66, 196, 0.7);
/* Darker background for dark mode */
box-shadow: 0 6px 12px rgba(255, 255, 255, 0.1),
0 2px 4px rgba(255, 255, 255, 0.05);
}
body {
font-family: 'Poppins', sans-serif;
margin: 0;
padding: 0;
background-color: #f0f0f0;
overflow-x: hidden;
}
.sidebar {
width: 100px;
background: linear-gradient(135deg, #f78ca0, #f9748f, #fd868c, #fe9a8b);
color: white;
padding: 20px;
padding-top: 100px;
display: flex;
flex-direction: column;
gap: 15px;
}
.sidebar button {
display: block;
width: 100%;
padding: 10px;
background-color: #63077f;
border: none;
color: #f8f9f9;
text-align: left;
cursor: pointer;
border-radius: 12px;
font-size: 15px;
transition: all 0.3s ease;
}
.sidebar button i {
margin-right: 8px;
}
.sidebar button:hover {
background: #f67280;
transform: scale(1.05);
}
.navbar {
background: linear-gradient(45deg, #ff9a9e, #fad0c4);
padding: 10px;
display: flex;
justify-content: space-between;
align-items: center;
}
.navbar h1 {
color: #7e2424;
margin: 0px;
font-size: 30px;
}
.navbar a {
color: #ffffff;
text-decoration: none;
padding: 6px 12px;
border-radius: 8px;
transition: background-color 0.3s;
}
.navbar a:hover {
background-color: #f67280;
}
.tools {
display: flex;
gap: 10px;
padding: 10px;
background-color: #e76af5;
align-items: center;
}
.tool {
background-color: #460346;
border: none;
color: white;
text-align: center;
display: inline-block;
font-size: 16px;
border-radius: 8px;
padding: 10px;
cursor: pointer;
transition: all 0.3s;
}
.tool i {
font-size: 20px;
transition: transform 0.2s ease, color 0.2s ease;
}
.tool:hover i {
color: #ff6b6b;
transform: scale(1.2);
}
.tool.active {
background-color: #5e044f;
}
#canvas {
border: 2px solid #e049e8;
background-color: white;
cursor: crosshair;
width: 100%;
height: calc(100vh - 220px);
}
.visitor-counter {
position: fixed;
top: 570px;
left: 10px;
background: linear-gradient(135deg, #fc5c7d, #6a82fb);
color: white;
font-weight: 700;
font-size: 18px;
text-align: center;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
border-radius: 12px;
width: 100px;
height: 100px;
box-shadow: 0 8px 20px rgba(255, 105, 135, 0.4);
transition: transform 0.3s ease;
}
.visitor-counter:hover {
transform: scale(1.1);
}
.footer {
background: linear-gradient(90deg, #a18cd1, #fbc2eb);
color: white;
padding: 20px;
text-align: center;
border-radius: 12px;
box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
}
.footer .subscribe {
background-color: #d426d7;
color: white;
padding: 10px 20px;
border: none;
border-radius: 8px;
cursor: pointer;
transition: background-color 0.3s;
}
.footer .subscribe:hover {
background-color: #a008b7;
}
</style>
<script>
// Function to get the count from localStorage or initialize it
function getVisitorCount() {
return localStorage.getItem('visitorCount') || 0;
}
// Function to increment and save the count
function incrementVisitorCount() {
let count = parseInt(getVisitorCount()) + 1;
localStorage.setItem('visitorCount', count);
return count;
}
// Function to display the count
function displayVisitorCount() {
const counterElement = document.querySelector('.website-counter');
const count = incrementVisitorCount();
counterElement.textContent = count;
}
// Call the display function when the page loads
document.addEventListener('DOMContentLoaded', displayVisitorCount);
</script>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #f0f0f0;
display: flex;
overflow-x: hidden;
}
.sidebar {
width: 100px;
background-color: #eca6f4;
color: white;
padding: 17px;
padding-top: 100px;
}
.sidebar button {
display: block;
width: 100%;
padding: 10px;
margin-bottom: 10px;
background-color: #63077f;
border: none;
color: rgb(248, 249, 249);
text-align: left;
cursor: pointer;
border-radius: 5px;
transition: background-color 0.3s;
font-size: 15px;
}
.sidebar button:hover {
background-color: #911da1;
}
.canvas {
padding-right: 50px;
padding-left: 10px;
}
.main-content {
flex-grow: 1;
display: flex;
flex-direction: column;
min-height: 100vh;
}
.navbar {
background-color: #f0adfb;
padding: 10px;
display: flex;
justify-content: space-between;
align-items: center;
padding-bottom: 50px;
}
.navbar h1 {
color: rgb(126, 36, 36);
margin: 0px;
font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
font-size: 20px;
}
.nav-links {
display: flex;
gap: 20px;
margin: auto;
align-items: center;
}
.nav-links a {
color: rgb(255, 255, 255);
text-decoration: none;
padding: 6px 4px;
border-radius: 4px;
transition: background-color 0.3s;
}
.nav-links a:hover {
background-color: #541058;
}
.tools {
display: flex;
gap: 10px;
padding-left: 40px;
padding-bottom: 10px;
background-color: #e76af5;
}
.tool {
background-color: #460346;
border: none;
color: white;
/* padding: 10px; */
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 0px 0px;
cursor: pointer;
border-radius: 5px;
transition: background-color 0.3s;
}
.tool:hover {
background-color: #87087c;
}
.tool.active {
background-color: #5e044f;
}
#canvas {
border: 1px solid #e049e8;
background-color: white;
width: 100%;
height: calc(100vh - 280px);
/* Adjusted for footer */
}
.color-picker {
margin: 10px 0;
position: relative;
display: inline-block;
}
.color-picker input[type="color"] {
padding: 0;
width: 50px;
height: 40px;
border: none;
border-radius: 4px;
cursor: pointer;
}
.color-palette {
position: absolute;
top: 100%;
left: 0;
background: white;
padding: 10px;
border-radius: 4px;
box-shadow: 0 2px 10px rgba(187, 60, 178, 0.1);
display: none;
grid-template-columns: repeat(5, 1fr);
gap: 5px;
z-index: 1000;
}
.color-picker:hover .color-palette {
display: grid;
}
.color-swatch {
width: 25px;
height: 25px;
border-radius: 4px;
cursor: pointer;
border: 1px solid #ddd;
}
.footer {
background-color: #fb99f8;
color: rgb(255, 255, 255);
}
.newsletter-section {
display: flex;
justify-content: center;
align-items: center;
gap: 20px;
max-width: 900px;
margin: 0 auto;
}
.newsletter-section input {
padding: 10px;
width: 300px;
border: none;
border-radius: 4px;
}
.newsletter-section button {
background-color: #d426d7;
color: white;
border: none;
padding: 10px 20px;
border-radius: 4px;
cursor: pointer;
transition: background-color 0.3s;
}
.newsletter-section button:hover {
background-color: #a008b7;
}
.text-size-control {
display: flex;
align-items: center;
gap: 10px;
margin: 10px 0;
background-color: #c350da;
padding: 10px;
border-radius: 5px;
color: white;
}
.text-size-control input {
width: 60px;
padding: 5px;
border: none;
border-radius: 4px;
background-color: white;
}
.text-size-control:hover {
background-color: #5d0874;
transition: background-color 0.3s;
}
.credit {
text-align: center;
}
.share {
font-size: 25px;
}
.share i {
transition: transform 0.3s ease, color 0.3s ease;
}
.share i:hover {
cursor: pointer;
color: #5c2872;
}
.profile {
font-size: 2rem;
padding-right: 1rem;
}
</style>
<style>
/* Circle styles */
.circle {
height: 24px;
width: 24px;
border-radius: 50%;
background-color: black;
position: fixed;
top: 0;
left: 0;
pointer-events: none;
z-index: 99999999;
transition: transform 0.1s ease-out;
}
/* Hide cursor when the 'hidden' class is applied */
.circle.hidden {
visibility: hidden;
}
</style>
</head>
<body>
<!-- Circles -->
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="sidebar">
<button id="tools-btn"><i class="fas fa-wrench"></i> Tools</button>
<button id="settings-btn"><i class="fas fa-cogs"></i> Settings</button>
<button id="help-btn"><i class="fas fa-question-circle"></i> Help</button>
</div>
<div class="main-content">
<nav class="navbar">
<div class="nav-links">
<h1 class="canvas">Canvas Editor</h1>
<a href="index.html">Home</a>
<a href="about-us.html">About Us</a>
<a href="review.html">Review</a>
<a href="testimonial.html">Testimonial</a>
<a href="privacy.html">Privacy</a>
<a href="tutorial.html">Tutorial</a>
<a href="Blog_page.html">Blog</a>
<a href="Faq.html">FAQ</a>
<a href="./Feedback.html">Feedback</a>
<a href="./contact.html">contact us</a>
<!-- <a href="signup.html">Sign Up</a> -->
<a href="contributors.html">Contributors</a>
<a href="auth.html">Login</a>
<!-- Profile Icon -->
<a href="./profile.html" class="profile-link"
style="display: flex; align-items: center; text-decoration: none;">
<img id="homeProfileImage" src="https://i.postimg.cc/NFFmtc9K/xnz-Mst5-V-400x400.jpg"
alt="Profile Icon"
style="width: 35px; height: 35px; border-radius: 50%; margin-top: -1px; align-items: center;">
</a>
</li>
<script>
document.addEventListener("DOMContentLoaded", function () {
// Retrieve the saved avatar from localStorage
const savedAvatar = localStorage.getItem("selectedAvatar");
// If an avatar is saved, update the profile image
if (savedAvatar) {
const homeProfileImage = document.getElementById("homeProfileImage");
if (homeProfileImage) {
homeProfileImage.src = savedAvatar;
}
}
});
</script>
<style>
/* Override the existing hover styles */
.navbar-nav .nav-item .profile-link:hover {
background-color: transparent !important;
/* Remove background color */
border-radius: 0 !important;
/* Reset border radius */
transform: none !important;
/* Prevent scaling */
}
.profile-icon {
border-radius: 50%;
position: relative;
margin-left: 20px;
Margin-top: 100px;
}
.dropdown-menu {
display: none;
position: absolute;
top: 35px;
/* Adjust based on the height of your navbar */
right: 0;
background-color: white;
color: black;
border: 1px solid #ccc;
border-radius: 4px;
z-index: 1;
}
.dropdown-menu a {
display: block;
padding: 10px 15px;
text-decoration: none;
}
.dropdown-menu a:hover {
background-color: #f1f1f1;
}
</style>
<script>
function toggleMenu() {
const menu = document.getElementById('profileMenu');
menu.style.display = menu.style.display === 'block' ? 'none' : 'block';
}
// Close the dropdown if the user clicks outside of it
window.onclick = function (event) {
if (!event.target.matches('.profile-icon img')) {
const menu = document.getElementById('profileMenu');
if (menu.style.display === 'block') {
menu.style.display = 'none';
}
}
}
</script>
</div>
</nav>
<div class="tools">
<button id="toggleToolbar" class="arrow-button">
<i class="fas fa-arrow-left"></i>
</button>
<button class="tool active" id="pencil"><i class="fas fa-pencil-alt" title="Pencil"></i></button>
<button class="tool" id="marker"><i class="fas fa-highlighter" title="Marker"></i></button>
<button class="tool" id="eraser"><i class="fas fa-eraser" title="Eraser"></i></button>
<button class="tool" id="line"><i class="fas fa-minus" title="Line"></i></button>
<button class="tool" id="rectangle"><i class="far fa-square" title="Rectangle"></i></button>
<button class="tool" id="circle"><i class="far fa-circle" title="Circle"></i></button>
<button class="tool" id="text"><i class="fas fa-font" title="Text"></i></button>
<button class="tool" id="textarea"><svg xmlns="http://www.w3.org/2000/svg" height="24px"
viewBox="0 -960 960 960" width="24px" fill="#ffff" title="Text Area">
<path
d="M256-240h84l44-122h192l44 122h84L522-720h-84L256-240Zm152-192 70-198h4l70 198H408ZM160-80q-33 0-56.5-23.5T80-160v-640q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v640q0 33-23.5 56.5T800-80H160Zm0-80h640v-640H160v640Zm0-640v640-640Z" />
</svg></button>
<button class="tool" id="undoButton"><i class="fa-solid fa-rotate-left" title="Undo"></i></button>
<button class="tool" id="redoButton"><i class="fa-solid fa-rotate-right" title="Redo"></i></button>
<div class="color-picker">
<input type="color" id="colorPicker">
<div class="color-palette">
<div class="color-swatch" style="background: #ff0000"></div>
<div class="color-swatch" style="background: #00ff00"></div>
<div class="color-swatch" style="background: #0000ff"></div>
<div class="color-swatch" style="background: #ffff00"></div>
<div class="color-swatch" style="background: #ff00ff"></div>
<div class="color-swatch" style="background: #00ffff"></div>
<div class="color-swatch" style="background: #000000"></div>
<div class="color-swatch" style="background: #ffffff"></div>
<div class="color-swatch" style="background: #808080"></div>
<div class="color-swatch" style="background: #c0c0c0"></div>
</div>
</div>
<div class="color-picker">
<input type="color" id="bgColorPicker">
<div class="color-palette">
<div class="color-swatch" style="background: #ff0000"></div>
<div class="color-swatch" style="background: #00ff00"></div>
<div class="color-swatch" style="background: #0000ff"></div>
<div class="color-swatch" style="background: #ffff00"></div>
<div class="color-swatch" style="background: #ff00ff"></div>
<div class="color-swatch" style="background: #00ffff"></div>
<div class="color-swatch" style="background: #000000"></div>
<div class="color-swatch" style="background: #ffffff"></div>
<div class="color-swatch" style="background: #808080"></div>
<div class="color-swatch" style="background: #c0c0c0"></div>
</div>
</div>
<input type="range" id="lineWidth" min="1" max="50" value="5">
<div class="text-size-control">
<label for="textSize"><svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960"
width="24px" fill="#ffff" title="Text Size">
<path
d="M560-160v-520H360v-120h520v120H680v520H560Zm-360 0v-320H80v-120h360v120H320v320H200Z" />
</svg>:</label>
<input type="number" id="textSize" min="8" max="72" value="20">
</div>
<button class="tool" id="clear"><i class="fas fa-trash-alt" title="Clear Canvas"></i></button>
<button class="tool" id="toggleGridButton"><svg xmlns="http://www.w3.org/2000/svg" height="24px"
viewBox="0 -960 960 960" width="24px" fill="#ffff" title="Toggle Grid">
<path
d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h133v-133H200v133Zm213 0h134v-133H413v133Zm214 0h133v-133H627v133ZM200-413h133v-134H200v134Zm213 0h134v-134H413v134Zm214 0h133v-134H627v134ZM200-627h133v-133H200v133Zm213 0h134v-133H413v133Zm214 0h133v-133H627v133Z" />
</svg></button>
<style>
/* Styling for the toggle button */
#toggleToolbar {
background-color: #460346;
color: white;
border: none;
padding: 10px;
border-radius: 8px;
cursor: pointer;
font-size: 16px;
transition: all 0.3s ease;
display: inline-flex;
align-items: center;
}
#toggleToolbar i {
margin-right: 5px;
}
#toggleToolbar:hover {
background-color: #5e044f;
}
/* CSS for hiding and showing toolbar */
.sidebar.collapsed {
width: 0;
padding: 0;
overflow: hidden;
transition: width 0.3s ease;
}
.arrow-button {
background-color: #460346;
color: white;
border: none;
padding: 10px;
border-radius: 8px;
cursor: pointer;
font-size: 16px;
transition: transform 0.3s ease;
display: inline-flex;
align-items: center;
}
.arrow-button i {
font-size: 20px;
transition: transform 0.3s ease;
}
.arrow-button:hover {
background-color: #5e044f;
}
/* Rotate arrow when sidebar is collapsed */
.sidebar.collapsed+.tools .arrow-button i {
transform: rotate(180deg);
}
/* CSS for hiding and showing toolbar */
.sidebar.collapsed {
width: 0;
padding: 0;
overflow: hidden;
transition: width 0.3s ease;
}
</style>
<script>
const toolbarButton = document.getElementById('toggleToolbar');
const sidebar = document.querySelector('.sidebar');
const canva = document.getElementById('canvas');
const arrowIcon = toolbarButton.querySelector('i'); // Get the icon element
toolbarButton.addEventListener('click', () => {
sidebar.classList.toggle('collapsed');
updateArrowIcon(); // Update the arrow direction
resizeCanvas(); // Adjust canvas width when the sidebar toggles
});
function updateArrowIcon() {
if (sidebar.classList.contains('collapsed')) {
arrowIcon.classList.remove('fa-arrow-left');
arrowIcon.classList.add('fa-arrow-right'); // Right arrow when toolbar is minimized
} else {
arrowIcon.classList.remove('fa-arrow-right');
arrowIcon.classList.add('fa-arrow-left'); // Left arrow when toolbar is expanded
}
}
function resizeCanvas() {
const sidebarWidth = sidebar.classList.contains('collapsed') ? 0 : 200;
canvas.width = window.innerWidth - sidebarWidth; // Adjust for sidebar
canvas.height = window.innerHeight - 220; // Adjust for footer
}
// Initial call to set the canvas size correctly
resizeCanvas();
window.addEventListener('resize', resizeCanvas);
</script>
</div>
<canvas id="canvas"></canvas>
<footer class="footer">
<div class="footer-content">
<!-- <div class="footer-image">
<img src="popup.jpg" alt="Newsletter signup" width="100">
</div> -->
<div class="newsletter-section">
<h3>Subscribe to our Newsletter</h3>
<input type="email" id="newsletter-email" placeholder="Enter your email address"><br>
<button onclick="subscribeNewsletter()" class="subscribe">Subscribe</button>
</div>
<div class="credit" style="font-size: 0.6rem;">
<p>
Created by <a href="https://github.com/vishanurag">ANURAG VISHWAKARMA </a> | All rights reserved
© <span id="year"></span>
</p>
<div style="margin: 20px;" class="share">
<i class="fab fa-github" style="margin-right: 10px;"></i>
<i class="fab fa-linkedin" style="margin-right: 10px;"></i>
<i class="fab fa-twitter"></i>
</div>
</div>
</footer>
</div>
<script>
function subscribeNewsletter() {
const email = document.getElementById('newsletter-email').value;
if (email) {
alert('Thank you for subscribing!');
document.getElementById('newsletter-email').value = '';
} else {
alert('Please enter a valid email address');
}
}
const canvas = document.getElementById('canvas');
const ctx = canvas.getContext('2d');
let isDrawing = false;
let currentTool = 'pencil';
let startX, startY;
let showGrid = false;
// Set canvas size
function resizeCanvas() {
canvas.width = window.innerWidth - 200; // Subtracting sidebar width
canvas.height = window.innerHeight - 220; // Adjusted for footer
updateCanvasWithGrid();
}
// Initial resize and add event listener for window resize
resizeCanvas();
window.addEventListener('resize', resizeCanvas);
// Set initial styles
ctx.lineWidth = 5;
ctx.lineCap = 'round';