From 524c0995d27fd0ed15bf62db4812ccaaa3a000df Mon Sep 17 00:00:00 2001
From: Phillip Phan <php46@drexel.edu>
Date: Thu, 18 May 2023 14:08:27 -0400
Subject: [PATCH] Press Space to generate True Palette

---
 CI-ColorWebs/Pages/TruePalette.cshtml  | 16 ++++++++--------
 CI-ColorWebs/wwwroot/js/truepalette.js |  9 +++++++++
 2 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/CI-ColorWebs/Pages/TruePalette.cshtml b/CI-ColorWebs/Pages/TruePalette.cshtml
index 75e0aea..09022b9 100644
--- a/CI-ColorWebs/Pages/TruePalette.cshtml
+++ b/CI-ColorWebs/Pages/TruePalette.cshtml
@@ -33,16 +33,16 @@ function copyHex(celement) {
         <button id="gsetNew">Generate New Set Palette</button>
         <br>
         <br>
-        <span id="palNameTrue" class = "paletteNameTrue"></span>
+        <span id="palNameTrue" class="paletteNameTrue"></span>
         <br>
         <br>
-        <button id="palColor" onclick="copyHex(palColor)" class = "hexcodeStyle"></button>
-        <button id="palColor2" onclick="copyHex(palColor2)" class = "hexcodeStyle"></button>
-        <button id="palColor3" onclick="copyHex(palColor3)" class = "hexcodeStyle"></button>
-        <button id="palColor4" onclick="copyHex(palColor4)" class = "hexcodeStyle"></button>
-        <button id="palColor5" onclick="copyHex(palColor5)" class = "hexcodeStyle"></button>
-        <button id="palColor6" onclick="copyHex(palColor6)" class = "hexcodeStyle"></button>
-        <canvas width = "1000" height = '200'></canvas>
+        <button id="palColor" onclick="copyHex(palColor)" class="hexcodeStyle"></button>
+        <button id="palColor2" onclick="copyHex(palColor2)" class="hexcodeStyle"></button>
+        <button id="palColor3" onclick="copyHex(palColor3)" class="hexcodeStyle"></button>
+        <button id="palColor4" onclick="copyHex(palColor4)" class="hexcodeStyle"></button>
+        <button id="palColor5" onclick="copyHex(palColor5)" class="hexcodeStyle"></button>
+        <button id="palColor6" onclick="copyHex(palColor6)" class="hexcodeStyle"></button>
+        <canvas width="1000" height='200'></canvas>
     </h2>
     <h3>
         <p>View your pallete visualized through AI art:</p>
diff --git a/CI-ColorWebs/wwwroot/js/truepalette.js b/CI-ColorWebs/wwwroot/js/truepalette.js
index b5b82c7..f770ac3 100644
--- a/CI-ColorWebs/wwwroot/js/truepalette.js
+++ b/CI-ColorWebs/wwwroot/js/truepalette.js
@@ -126,3 +126,12 @@ const bre = () => {
 
 document.getElementById("gsetNew").addEventListener("click", bre);
 bre();
+
+document.addEventListener('keyup', event =>
+{
+    if (event.code === 'Space') 
+    {
+        event.preventDefault();
+        bre();
+    }
+})
-- 
GitLab