Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Gerador de Link</title>
- <style>
- body {
- font-family: Arial, sans-serif;
- text-align: center;
- }
- h1 {
- margin-top: 50px;
- font-size: 36px;
- color: #333;
- }
- form {
- margin-top: 50px;
- text-align: left;
- width: 500px;
- margin-left: auto;
- margin-right: auto;
- }
- label, input, textarea, button {
- display: block;
- margin: 10px auto;
- width: 100%;
- }
- label {
- font-size: 18px;
- }
- input[type="text"], textarea {
- padding: 10px;
- font-size: 16px;
- border-radius: 5px;
- border: 1px solid #ccc;
- }
- textarea {
- height: 150px;
- resize: none;
- }
- button {
- padding: 10px 20px;
- background-color: #333;
- color: #fff;
- border-radius: 5px;
- border: none;
- font-size: 18px;
- cursor: pointer;
- }
- #message {
- margin-top: 20px;
- font-size: 18px;
- color: #333;
- }
- </style>
- </head>
- <body>
- <h1>Gerador de Link</h1>
- <form>
- <label for="inputURL">Insira a URL do arquivo ou site:</label>
- <input type="text" id="inputURL" name="inputURL">
- <br><br>
- <textarea id="downloadLink" rows="5" cols="50"></textarea>
- </form>
- <button id="copyButton">Copiar link</button>
- <div id="message" style="display: none;">Copiado!</div>
- <script>
- const inputURL = document.querySelector("#inputURL");
- const downloadLink = document.querySelector("#downloadLink");
- const copyButton = document.querySelector("#copyButton");
- const message = document.querySelector("#message");
- inputURL.addEventListener("input", function() {
- downloadLink.value = `<a href="${inputURL.value}" target="_blank">Clique aqui para acessar o link</a>`;
- });
- copyButton.addEventListener("click", function() {
- const textarea = document.querySelector("#downloadLink");
- textarea.select();
- document.execCommand("copy");
- message.style.display = "inline-block";
- setTimeout(function() {
- message.style.display = "none";
- }, 1000);
- });
- </script>
- </body>
- </html>
Add Comment
Please, Sign In to add comment