diff --git a/css/color_fusion.css b/css/color_fusion.css index e69de29..8284dde 100644 --- a/css/color_fusion.css +++ b/css/color_fusion.css @@ -0,0 +1,85 @@ +.fa-arrow-up { + position: absolute; + padding: 10px 10px 10px 10px; + box-shadow: rgb(194, 194, 194) 0px 2px 2px 1px; + border-radius: 80px; + top: 840px; + left: 1830px; + font-size: 50px; + color: rgb(107, 106, 106); + z-index: 10; +} + +.fa-arrow-down { + position: absolute; + padding: 10px 10px 10px 10px; + box-shadow: rgb(194, 194, 194) 0px 2px 2px 1px; + border-radius: 80px; + top: 840px; + left: 1830px; + font-size: 50px; + color: rgb(107, 106, 106); + z-index: 10; +} + +input[id="color_fusion_true"] + label + label { + display: none; +} + +div[class="color_fusion"] { + position: fixed; + top: 937px; + display: flex; + align-items: center; + justify-items: center; + width: 100%; + height: 280px; + box-shadow: rgb(194, 194, 194) 0px -2px 2px 1px; + transition: 0.35s; +} +input[id="color_fusion_true"]:checked + label + label + div { + top: 680px; +} + +input[id="color_fusion_true"]:checked + label + label { + display: block; +} + +input[id="color_fusion_true"]:checked + label { + display: none; +} + +.fa-plus { + font-size: 50px; +} + +.color_material_1 { + margin-left: 200px; + margin-right: 80px; + width: 200px; + height: 200px; + box-shadow: rgba(82, 82, 82, 0.1) 5px 5px 5px 5px; + border-radius: 20px; +} + +.color_material_2 { + margin-left: 80px; + margin-right: 80px; + width: 200px; + height: 200px; + box-shadow: rgba(82, 82, 82, 0.1) 5px 5px 5px 5px; + border-radius: 20px; +} + +.fa-equals { + font-size: 50px; +} + +.color_fusion_output { + margin-left: 80px; + margin-right: 20px; + width: 200px; + height: 200px; + box-shadow: rgba(82, 82, 82, 0.1) 5px 5px 5px 5px; + border-radius: 20px; +} diff --git a/css/colorpicker.css b/css/colorpicker.css index dcab27a..11ae5e9 100644 --- a/css/colorpicker.css +++ b/css/colorpicker.css @@ -4,30 +4,21 @@ .color-indicator { display: inline-block; - width: 200px; - height: 200px; + width: 300px; + height: 300px; background-color: #fff; border-radius: 20px; box-shadow: rgba(82, 82, 82, 0.1) 5px 5px 5px 5px; + margin-top: 160px; margin-bottom: 10px; + margin-right: 100px; } .color-indicator2 { display: inline-block; left: 100px; - width: 200px; - height: 200px; - background-color: #fff; - border-radius: 20px; - box-shadow: rgba(82, 82, 82, 0.1) 5px 5px 5px 5px; - margin-bottom: 10px; -} - -.color-indicator3 { - display: inline-block; - left: 100px; - width: 200px; - height: 200px; + width: 300px; + height: 300px; background-color: #fff; border-radius: 20px; box-shadow: rgba(82, 82, 82, 0.1) 5px 5px 5px 5px; diff --git a/css/main.css b/css/main.css index 0c7577f..2ba1443 100644 --- a/css/main.css +++ b/css/main.css @@ -25,9 +25,47 @@ height: 30rem; justify-content: space-between; align-items: center; + margin-bottom: 100px; } .rgb_box_1 { border: 0 solid black; border-bottom: solid 1px rgba(129, 129, 129, 0.767); + margin-bottom: 10px; +} + +.rgb_box_2 { + border: 0 solid black; + border-bottom: solid 1px rgba(129, 129, 129, 0.767); + margin-bottom: 10px; +} + +.rgb_box_3 { + border: 0 solid black; + border-bottom: solid 1px rgba(129, 129, 129, 0.767); + margin-bottom: 10px; +} + +.rgb_box2 { + position: relative; + left: 405px; + top: -85px; +} + +.rgb_box_4 { + border: 0 solid black; + border-bottom: solid 1px rgba(129, 129, 129, 0.767); + margin-bottom: 10px; +} + +.rgb_box_5 { + border: 0 solid black; + border-bottom: solid 1px rgba(129, 129, 129, 0.767); + margin-bottom: 10px; +} + +.rgb_box_6 { + border: 0 solid black; + border-bottom: solid 1px rgba(129, 129, 129, 0.767); + margin-bottom: 10px; } diff --git a/index.html b/index.html index 8bcacd7..b4ce867 100644 --- a/index.html +++ b/index.html @@ -52,21 +52,40 @@
-
-    + hex
+ rgb
+ hsl +
+
+ hex
+ rgb
+ hsl
-
-
-
+ + + + +
+
+ +
+ +
+
+ diff --git a/js/app.js b/js/app.js index e0f2cb0..1bd2197 100644 --- a/js/app.js +++ b/js/app.js @@ -1,6 +1,18 @@ let colorIndicator = document.getElementById("color-indicator"); let colorIndicator2 = document.getElementById("color-indicator2"); let colorIndicator3 = document.getElementById("color-indicator3"); +//------------------------------------------------------------------------------------------- +let color_material_1 = document.getElementById("color_material_1"); +let color_material_2 = document.getElementById("color_material_2"); +let color_fusion_output = document.getElementById("color_fusion_output"); + +var hexInput = document.getElementById("hexInput"); +var rgbInput = document.getElementById("rgbInput"); +var hslInput = document.getElementById("hslInput"); + +var hexInput2 = document.getElementById("hexInput2"); +var rgbInput2 = document.getElementById("rgbInput2"); +var hslInput2 = document.getElementById("hslInput2"); const colorPicker = new iro.ColorPicker("#color-picker", { layout: [ @@ -15,19 +27,65 @@ const colorPicker = new iro.ColorPicker("#color-picker", { colors: [ "rgb(255, 0, 0)", // pure red "rgb(0, 255, 0)", // pure green - "rgb(0, 0, 255)", // pure blue ], }); colorPicker.on(["color:init", "color:change"], function () { colorPicker.colors.forEach(function () { - colorIndicator.style.backgroundColor = colorPicker.colors[0].rgbaString; - colorIndicator2.style.backgroundColor = colorPicker.colors[1].rgbaString; - colorIndicator3.style.backgroundColor = colorPicker.colors[2].rgbaString; + colorIndicator.style.backgroundColor = colorPicker.colors[0].rgbString; + color_material_1.style.backgroundColor = colorPicker.colors[0].rgbString; hexInput.value = colorPicker.colors[0].hexString; + rgbInput.value = colorPicker.colors[0].rgbString; + hslInput.value = colorPicker.colors[0].hslString; + + colorIndicator2.style.backgroundColor = colorPicker.colors[1].rgbString; + color_material_2.style.backgroundColor = colorPicker.colors[1].rgbString; + hexInput2.value = colorPicker.colors[1].hexString; + rgbInput2.value = colorPicker.colors[1].rgbString; + hslInput2.value = colorPicker.colors[1].hslString; }); }); hexInput.addEventListener("change", function () { - colorPicker.color.hexString = this.value; + colorPicker.colors[0].hexString = this.value; +}); + +rgbInput.addEventListener("change", function () { + colorPicker.colors[0].rgbInput = this.value; }); + +hslInput.addEventListener("change", function () { + colorPicker.colors[0].hslInput = this.value; +}); +//------------------------------------------------------- +hexInput2.addEventListener("change", function () { + colorPicker.colors[1].hexInput2 = this.value; +}); + +rgbInput2.addEventListener("change", function () { + colorPicker.colors[1].rgbInput2 = this.value; +}); + +hslInput2.addEventListener("change", function () { + colorPicker.colors[1].hslInput2 = this.value; +}); + +var material1_red = colorPicker.colors[0].red; +var material1_green = colorPicker.colors[0].green; +var material1_blue = colorPicker.colors[0].blue; + +var material2_red = colorPicker.colors[1].red; +var material2_green = colorPicker.colors[1].green; +var material2_blue = colorPicker.colors[1].blue; + +output_red = material1_red + material2_red; +output_red = output_red / 2; +output_red = Math.round(output_red); + +output_green = material1_green + material2_green; +output_green = output_green / 2; +output_green = Math.round(output_green); + +output_blue = material1_blue + material2_blue; +output_blue = output_blue / 2; +output_blue = Math.round(output_blue); diff --git a/js/color_Extraction.js b/js/color_Extraction.js index 336b165..e300fa4 100644 --- a/js/color_Extraction.js +++ b/js/color_Extraction.js @@ -47,12 +47,6 @@ colorPicker.on(["color:init", "color:change"], function (color) { hslInput.value = color.hslString; }); -function enterkey() { - if (window.event.keyCode == 13) { - colorIndicator.style.backgroundColor = rgb_box_1.value; - } -} - hexInput.addEventListener("change", function () { colorPicker.color.hexString = this.value; });