-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
120 lines (110 loc) · 3.37 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
<!DOCTYPE html>
<html>
<head>
<title>Color an SVG image using a color picker</title>
<link rel="icon" type="image/png" href="https://mohcin147.github.io/favicon.png">
<meta charset="UTF-8">
<meta name="google-site-verification" content="Zfcj56GqyW1ct5AltHgZbxtFyZsrJkVhPVkD32WmZZg" />
<meta http-equiv="Permissions-Policy" content="interest-cohort=()">
<meta name="description" content="Coloring SVG image: This project allows you to color an SVG image using a color picker. This script allows users to select a color from the color picker and apply it to specific elements on the webpage.">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
font-size: 14px;
line-height: 1.5;
font-family: Tahoma, sans-serif;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.nav {
width: 100%;
padding-top: 20px;
padding-bottom: 15px;
position: fixed;
text-align: center;
cursor: pointer;
background-color: #ff8000;
font-weight: bold;
font-size: 20px;
color: #fff;
z-index: 9999;
top: 0px;
left: 0px;
}
.aboutus {
display: flex;
text-align: center;
justify-content: center;
align-items: center;
background-color: #404040;
color: #ffffff;
}
.download {
text-align: center;
width: 100%;
padding: 10px;
margin-bottom: 20px;
background-color: #404040;
color: #ffffff;
transition: background-color 0.3s ease;
cursor: pointer;
}
.download:hover {
background-color: #c0c0c0;
color: #404040;
}
.color {
fill: #404040;
cursor: pointer;
}
.container {
display: flex;
justify-content: center;
align-items: center;
}
</style>
</head>
<body>
<div class="nav" onclick="window.location.href='https://mohcin147.github.io'">
<div>MOHCIN147
<p style="font-size: 14px;">DESIGNER & DEVELOPER ON GITHUB</p>
</div>
</div>
<div class="aboutus" style="padding: 20px; margin-top: 110px;">
<div>Coloring SVG image: This project allows you to color an SVG image using a color picker.<br>This script allows users to select a color from the color picker and apply it to specific elements on the webpage.</div>
</div>
<div class="container"><div class="download" onclick="window.location.href='code_color_an_svg_image_using_a_color_picker.zip'">Download</div></div>
<div class="container">
<svg class="color" width="100" height="100">
<circle cx="50" cy="50" r="40"></circle>
</svg>
<svg class="color" width="100" height="100">
<circle cx="50" cy="50" r="40"></circle>
</svg>
<svg class="color" width="100" height="100">
<circle cx="50" cy="50" r="40"></circle>
</svg>
</div>
<div class="container">
<input type="color" id="colorPicker" value="#000000">
</div>
</body>
<script>
document.addEventListener('contextmenu', function(e) {
e.preventDefault();
});
</script>
<script>
const colorPicker = document.getElementById('colorPicker');
const colors = document.querySelectorAll('.color');
colors.forEach(color => {
color.addEventListener('click', () => {
color.style.fill = colorPicker.value;
});
});
</script>
</html>