Skip to content

Commit 602fc27

Browse files
committed
adicionado colar
1 parent 8f277a6 commit 602fc27

File tree

9 files changed

+44
-5
lines changed

9 files changed

+44
-5
lines changed

app/assets/js/scripts.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,20 @@ document.addEventListener('DOMContentLoaded', function () {
8585
}
8686
}
8787
});
88+
89+
// Paste button functionality
90+
const pasteButton = document.getElementById('paste');
91+
const urlInput = document.getElementById('url');
92+
93+
if (pasteButton && urlInput) {
94+
pasteButton.addEventListener('click', async (e) => {
95+
e.preventDefault();
96+
try {
97+
const clipboardText = await navigator.clipboard.readText();
98+
urlInput.value = clipboardText.trim();
99+
} catch (err) {
100+
console.error('Failed to read clipboard contents', err);
101+
}
102+
});
103+
}
88104
});

app/assets/scss/_icons.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,6 @@
3838
@include mixin.icon('warning', 'invert(89%) sepia(25%) saturate(5861%) hue-rotate(353deg) brightness(101%) contrast(101%)');
3939

4040
@include mixin.icon('hamburguer', 'invert(0%) sepia(21%) saturate(7425%) hue-rotate(12deg) brightness(96%) contrast(96%)');
41-
@include mixin.icon('close', 'invert(100%) sepia(32%) saturate(8%) hue-rotate(23deg) brightness(102%) contrast(100%)');
41+
@include mixin.icon('close', 'invert(100%) sepia(32%) saturate(8%) hue-rotate(23deg) brightness(102%) contrast(100%)');
42+
43+
@include mixin.icon('paste', 'invert(0%) sepia(21%) saturate(7425%) hue-rotate(12deg) brightness(96%) contrast(96%)');

app/assets/scss/home.scss

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,23 @@ main {
496496
}
497497
}
498498

499+
.paste {
500+
background: rgb(244,244,245);
501+
background: linear-gradient(90deg, rgba(244,244,245,0) 0%, rgba(244,244,245,1) 30%, rgba(244,244,245,1) 100%);
502+
align-items: center;
503+
z-index: 3;
504+
position: absolute;
505+
top: 4px;
506+
padding: 0 18px 0 22px;
507+
right: 50px;
508+
cursor: pointer;
509+
height: 48px;
510+
display: flex;
511+
.icon {
512+
513+
}
514+
}
515+
499516
button {
500517
position: relative;
501518
background-color: var(--marreta);

app/dist/css/style.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/dist/css/style.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/dist/icons/paste.svg

Lines changed: 3 additions & 0 deletions
Loading

app/dist/js/scripts.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/dist/js/scripts.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/views/home.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
required
8787
pattern="https?://.+"
8888
title="<?php echo \Inc\Language::getMessage('INVALID_URL')['message']; ?>">
89+
<span class="paste" id="paste"><span class="icon icon--paste"></span></span>
8990
</div>
9091
<button type="submit" alt="<?php echo \Inc\Language::get('analyze_button'); ?>">
9192
<span class="icon icon--marreta"></span>

0 commit comments

Comments
 (0)