-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
142 lines (118 loc) · 7.28 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
<!DOCTYPE html>
<html class="light">
<head lang="eng">
<title>ColorStack</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<link rel="stylesheet" href="./style.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Peralta&display=swap" rel="stylesheet">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Londrina+Solid:wght@100;300;400;900&display=swap" rel="stylesheet">
<div id="header" style="display: grid; ">
<h1 id="head" class="elementHeader">ColorStack✎ᝰ. </h1>
<select id="colorMode">
<option value="light" class="light">Light</option>
<option value="dark" class="dark">Dark</option>
</select>
</div>
<div style="display: flex; gap:5px;padding: 5px;; justify-content: center;">
<button class="btn btn-outline-secondary"id="getFromColor">Get from color</button>
<button class="btn btn-outline-secondary" id="getFromImage">Get from image</button>
<button class="btn btn-outline-secondary" id="getFromClipboard">Get from clipboard</button>
<button class="btn btn-outline-secondary" id="hexToRgb">from HEX to RGB</button>
<button class="btn btn-outline-secondary" id="rgbToHex">from RGB to HEX</button>
</div>
</head>
<body class="light">
<div id="fromColor" style="display: block;">
<div id="colorPickerSection">
<label for="colorPicker">Color Picker:</label>
<input type="color" id="colorPicker" value="#0000ff">
<input type="text" id="colorInput" readonly>
</div>
<!-- HEX Code Input comment comment-->
<div id="hexCodeSection" style="display: none;" class="container">
<label for="hexCode" style="width:max-content ;">HEX code:</label>
<input type="text" id="hexCode" style="width: 90px;"placeholder="#000000">
<div id="colorChosenInput"></div>
<button class="btn btn-secondary" onclick="submitColor()">Submit color</button>
</div>
<!-- Buttons for toggling -->
<button type="button" class="btn btn-primary" id="useColorPickerBtn">Use Color Picker</button>
<button type="button" class="btn btn-outline-secondary" id="useHexCodeBtn">Use HEX Code</button>
<br>
<br>
<label style="margin:5px;" for="options">Select the desired relation:</label>
<select id="options" name="options">
<option value="Complementary">Complementary</option>
<option value="Monochromatic">Monochromatic</option>
<option value="Analogous">Analogous</option>
<option value="Split-complementary">Split-complementary</option>
</select>
<br>
<p id="infoColor"> Complementary colors are hues that are directly opposite each other on the color wheel. They create vibrant contrast when used together, making each other appear more intense.</p>
<button id="generate" style="margin:5px; justify-content: center;" type="button" class="btn btn-primary">Generate</button>
<div id="colorsDiv" class="grid-container" style="display: none;">
<div class="grid-element colors" id="color1"></div>
<div class="grid-element colors" id="color2"></div>
<div class="grid-element colors" id="color3"></div>
<button type="button" class="btnColor grid-element btn btn-outline-secondary">
</button>
<button type="button" class="btnColor grid-element btn btn-outline-secondary"></button>
<button type="button" class="btnColor grid-element btn btn-outline-secondary">sss</button>
</div>
<br>
<hr>
</div>
<!-- div for getFromImage -->
<div id="fromImage" style="display: none;">
<br>
<input id="imageFromUser" type="file" accept="image/*" />
<img style="display: none;" src="#" id="userImage">
<div style="display: flex;" class="divOfDivs" id="divOfDivs2">
</div>
</div>
<br>
<div id="fromClipboard" style="display: none;">
<img id="image" style="border: 1px solid silver; width: 320px; height: 240px" />
<div id="divOfDivs3" class="divOfDivs"></div>
</div>
<button style="display: none;" id="clipButton" class='btn-outline-secondary' onclick="pasteImageBitmap()">Paste image bitmap from clipboard</button>
<div id="hexToRgbDiv" style="display: none; text-align: center;">
<input id="hexInput" type="text" placeholder="HEX CODE">
<button type="submit" onclick="convertHex()" style="height: fit-content;">Submit HEX code.</button> <br>
<div style="justify-content: center; gap:5px; margin: 5px; display: grid; grid-template-columns: min-content min-content;">
<div style="display: inline-block; text-align: center; justify-content: center;" id="colorChosenRGB" class="colorChosenCircle"></div>
<input type="text" id="showRGB" style="display: inline-block; height: fit-content;" readonly>
</div>
</div>
<div id="rgbToHexDiv" style="display: none; text-align: center; justify-content: center;">
<div id="redgreenblue" style="display:none">
<p style="display: inline-block; align-items: center;">Enter the RGB code: </p>
<input type="text" placeholder="red" id="red1">
<input type="text" placeholder="green" id="green1">
<input type="text" placeholder="blue" id="blue1">
<br>
<div style="display: inline-block; text-align: center;">
<button type="submit" style="margin: 8px;" onclick="RGBtoHEX()">Submit</button>
<div style="display: grid; grid-template-columns: min-content max-content; gap: 5px;">
<div id="colorChosenHEX"></div>
<input type="text" id="showHEX" style="height: fit-content; width: fit-content;" readonly>
</div>
</div>
</div>
<br>
</div>
<footer style="display: flex; justify-content: center;">
<h6 style="justify-content: center; align-self: center; align-content: center;">© All rights reserved : se0klie on <a href="https://github.com/se0klie">github</a>
</h6>
</footer>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tinycolor/1.4.2/tinycolor.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/color-thief/2.3.0/color-thief.umd.js"></script>
<script src="index.js"></script>
</body>
</html>