Skip to content

Commit

Permalink
adicionado colar
Browse files Browse the repository at this point in the history
  • Loading branch information
altendorfme committed Feb 21, 2025
1 parent 8f277a6 commit 602fc27
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 5 deletions.
16 changes: 16 additions & 0 deletions app/assets/js/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,20 @@ document.addEventListener('DOMContentLoaded', function () {
}
}
});

// Paste button functionality
const pasteButton = document.getElementById('paste');
const urlInput = document.getElementById('url');

if (pasteButton && urlInput) {
pasteButton.addEventListener('click', async (e) => {
e.preventDefault();
try {
const clipboardText = await navigator.clipboard.readText();
urlInput.value = clipboardText.trim();
} catch (err) {
console.error('Failed to read clipboard contents', err);
}
});
}
});
4 changes: 3 additions & 1 deletion app/assets/scss/_icons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,6 @@
@include mixin.icon('warning', 'invert(89%) sepia(25%) saturate(5861%) hue-rotate(353deg) brightness(101%) contrast(101%)');

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

@include mixin.icon('paste', 'invert(0%) sepia(21%) saturate(7425%) hue-rotate(12deg) brightness(96%) contrast(96%)');
17 changes: 17 additions & 0 deletions app/assets/scss/home.scss
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,23 @@ main {
}
}

.paste {
background: rgb(244,244,245);
background: linear-gradient(90deg, rgba(244,244,245,0) 0%, rgba(244,244,245,1) 30%, rgba(244,244,245,1) 100%);
align-items: center;
z-index: 3;
position: absolute;
top: 4px;
padding: 0 18px 0 22px;
right: 50px;
cursor: pointer;
height: 48px;
display: flex;
.icon {

}
}

button {
position: relative;
background-color: var(--marreta);
Expand Down
2 changes: 1 addition & 1 deletion app/dist/css/style.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion app/dist/css/style.css.map

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions app/dist/icons/paste.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/dist/js/scripts.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/dist/js/scripts.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/src/views/home.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
required
pattern="https?://.+"
title="<?php echo \Inc\Language::getMessage('INVALID_URL')['message']; ?>">
<span class="paste" id="paste"><span class="icon icon--paste"></span></span>
</div>
<button type="submit" alt="<?php echo \Inc\Language::get('analyze_button'); ?>">
<span class="icon icon--marreta"></span>
Expand Down

0 comments on commit 602fc27

Please sign in to comment.