Skip to content

Commit

Permalink
Update copyframe.html
Browse files Browse the repository at this point in the history
  • Loading branch information
zbirow authored Dec 7, 2024
1 parent f8bea59 commit a531738
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions copyframe.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
margin: 20px;
}
textarea, button {
width: 100%;
width: 30%;
margin-top: 10px;
padding: 10px;
border: none;
Expand Down Expand Up @@ -51,7 +51,7 @@
.output-item span {
margin-right: 10px;
word-wrap: break-word;
white-space: pre-wrap; /* Ensures that long URLs or iframe code break lines properly */
white-space: pre-wrap;
}
.copy-button {
padding: 10px;
Expand Down Expand Up @@ -88,6 +88,7 @@ <h1>Generator iframe i linków</h1>
<div id="output-container" class="output-container"></div>

<script>
//Ni 2024
function generateContent() {
// Pobierz wartości z trzech pól i podziel je na linie
const links1 = document.getElementById('links1').value.trim().split(/\s+/);
Expand Down Expand Up @@ -159,15 +160,11 @@ <h1>Generator iframe i linków</h1>

// Funkcja do kopiowania tekstu i zmiany przycisku
function copyToClipboard(button, text) {
navigator.clipboard.writeText(text).then(() => {
button.textContent = 'Skopiowano!';
button.classList.add('copied');
setTimeout(() => {
button.textContent = 'Kopiuj';
button.classList.remove('copied');
}, 2000);
});
}
navigator.clipboard.writeText(text).then(() => {
button.textContent = 'Skopiowano!';
button.classList.add('copied');
}).catch(err => console.error('Błąd podczas kopiowania do schowka:', err));
}

// Funkcja do wyciągania nazwy z linku
function extractNameFromLink(link) {
Expand Down

0 comments on commit a531738

Please sign in to comment.