prvni várka

This commit is contained in:
2024-04-17 23:13:56 +02:00
commit 25ef045289
19 changed files with 433 additions and 0 deletions

9
codebox/index.html Normal file
View File

@ -0,0 +1,9 @@
<body>
<div class="code-box">
<pre id="code-content">
Místo pro kód (s kódem je možné manipulovat a tak i zůstame)
</pre
>
<button id="copy-button">Kopírovat</button>
</div>
</body>

10
codebox/script.js Normal file
View File

@ -0,0 +1,10 @@
// Code-box
document.getElementById("copy-button").addEventListener("click", function () {
var codeContent = document.getElementById("code-content");
var range = document.createRange();
range.selectNode(codeContent);
window.getSelection().removeAllRanges();
window.getSelection().addRange(range);
document.execCommand("copy");
window.getSelection().removeAllRanges();
});

24
codebox/style.css Normal file
View File

@ -0,0 +1,24 @@
/* CodeBox */
.code-box {
position: relative;
width: 500px;
height: auto;
border: 1px solid #734f96;
padding: 5px;
overflow: auto;
background-color: #313131;
color: yellowgreen;
margin: auto;
text-align: left;
}
#copy-button {
position: absolute;
top: 10px;
right: 10px;
cursor: pointer;
color: whitesmoke;
background-color: transparent;
border: 1px solid #734f96;
}