Last active
November 29, 2019 17:44
-
-
Save edo9k/30fb239881dbbc9e1c640e91879ae99d to your computer and use it in GitHub Desktop.
Página de Redirect (exemplo)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- @format --> | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1" /> | |
<title>Diário LDI</title> | |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.8.0/css/bulma.min.css" /> | |
<script defer src="https://use.fontawesome.com/releases/v5.3.1/js/all.js"></script> | |
</head> | |
<body> | |
<section class="section"> | |
<div class="container"> | |
<h1 class="title is-1"> | |
Aviso | |
</h1> | |
<div class="content is-large"> | |
<p> | |
Movemos o Diário para <strong><a href="http://ldi.ufes.br/diario">http://ldi.ufes.br/diario</a>.</strong> | |
</p> | |
<p> | |
As senhas e contas continuam as mesmas. | |
</p> | |
<p> | |
No caso de problemas, contate o suporte abrindo um ticket em | |
<a href="mailto:suporte.sead@ufes.br">suporte.sead@ufes.br</a>. | |
</p> | |
<p>Você será redirecionado em <span id="contagem">50</span> segundo<span id="s">s</span>.</p> | |
</div> | |
<div> | |
<img src="https://media2.giphy.com/media/f9vsEmv4NA9ry/source.gif" /> | |
</div> | |
</div> | |
</section> | |
<script> | |
const main = () => { | |
const contagem = document.getElementById('contagem') | |
const s = document.getElementById('s') | |
const tempo = parseInt(contagem.innerText) | |
countDown(tempo) | |
} | |
const countDown = time => { | |
if (time === 0) { | |
/* redirect */ | |
window.location.href = 'http://ldi.ufes.br/diario' | |
} else { | |
if (time === 1) s.innerText = '' | |
contagem.innerText = time | |
setTimeout(() => countDown(time - 1), 1000) | |
} | |
} | |
document.addEventListener('DOMContentLoaded', main) | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment