Skip to content
Snippets Groups Projects
Commit 18e4ea2c authored by grembem's avatar grembem
Browse files

ported the copy to clipboard to true palette

ported over the copy to clipboard feature from the main page to true palette. works identically to the main function.
parent 355a7acb
Branches
No related tags found
No related merge requests found
...@@ -10,6 +10,23 @@ ...@@ -10,6 +10,23 @@
background-repeat: repeat; background-repeat: repeat;
} }
</style> </style>
<script>
src = 'truepalette.js'
function copyHex(celement) {
let hexCopy = celement.innerText;
let input = document.createElement('input');
input.setAttribute('value', hexCopy);
document.body.appendChild(input);
input.select();
document.execCommand('copy');
document.body.removeChild(input);
alert('Copied: ' + celement.innerText);
}
</script>
<div class="text-center"> <div class="text-center">
<h1 class="display-4">Welcome</h1> <h1 class="display-4">Welcome</h1>
<h2> <h2>
...@@ -19,12 +36,12 @@ ...@@ -19,12 +36,12 @@
<span id="palNameTrue" class = "paletteNameTrue"></span> <span id="palNameTrue" class = "paletteNameTrue"></span>
<br> <br>
<br> <br>
<button id="palColor"></button> <button id="palColor" onclick="copyHex(palColor)"></button>
<button id="palColor2"></button> <button id="palColor2" onclick="copyHex(palColor2)"></button>
<button id="palColor3"></button> <button id="palColor3" onclick="copyHex(palColor3)"></button>
<button id="palColor4"></button> <button id="palColor4" onclick="copyHex(palColor4)"></button>
<button id="palColor5"></button> <button id="palColor5" onclick="copyHex(palColor5)"></button>
<button id="palColor6"></button> <button id="palColor6" onclick="copyHex(palColor6)"></button>
<canvas width = "700"></canvas> <canvas width = "700"></canvas>
</h2> </h2>
<h3> <h3>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment