Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8" />
- <meta http-equiv="X-UA-Compatible" content="IE=edge" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <title>Document</title>
- </head>
- <style>
- * {
- margin: 0;
- padding: 0;
- }
- body {
- position: relative;
- min-height: 100vh;
- display: grid;
- place-content: center;
- background-image: linear-gradient(to top, #fbc2eb 0%, #a6c1ee 100%);
- }
- h1 {
- font-family: "Franklin Gothic Medium", "Arial Narrow", Arial, sans-serif;
- font-size: 1.5rem;
- }
- .loader {
- position: fixed; // importante para evitar scroll
- min-height: 100vh;
- min-width: 100vw;
- display: grid;
- place-content: center;
- background-image: linear-gradient(120deg, #f093fb 0%, #f5576c 100%);
- }
- .fade-out {
- opacity: 0;
- transition: opacity 300ms ease-in-out;
- }
- .lds-dual-ring {
- display: inline-block;
- width: 80px;
- height: 80px;
- }
- .lds-dual-ring:after {
- content: " ";
- display: block;
- width: 64px;
- height: 64px;
- margin: 8px;
- border-radius: 50%;
- border: 6px solid #fff;
- border-color: #fff transparent #fff transparent;
- animation: lds-dual-ring 1.2s linear infinite;
- }
- @keyframes lds-dual-ring {
- 0% {
- transform: rotate(0deg);
- }
- 100% {
- transform: rotate(360deg);
- }
- }
- </style>
- <body>
- <div class="loader">
- <div class="lds-dual-ring"></div>
- </div>
- <h1>Hola!</h1>
- <button onclick="saludar('Uciel')">Saludar</button>
- </body>
- <script>
- function saludar(nombre) {
- alert(`Hola ${nombre}!`);
- }
- function showPage(wait, transition) {
- const loader = document.querySelector(".loader");
- setTimeout(() => {
- loader.classList.add("fade-out");
- setTimeout(() => {
- loader.remove();
- }, transition + 1);
- }, wait);
- }
- showPage(2000, 300);
- </script>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement