Skip to content

Instantly share code, notes, and snippets.

View rodolfoghi's full-sized avatar

Rodolfo Ghiggi rodolfoghi

View GitHub Profile
<!-- Dentro do body, mas fora do palco, cria label para exibir o placar -->
<label id="placar">Fantasmas capturados: <span>0</span></label>
<!-- Associa a função capturar() ao evento onclick da imagem fantasma1 -->
<img src="fantasma1.svg" alt="Fantasma número 1" id="fantasma1" onclick="capturar()">
<script>
const $placar = document.getElementById('placar');
let fantasmasCapturados = 0;
#placar {
/* Para que seja possível definir tamanho e margin */
display: block;
/* Para que com margin left/right auto fique alinhado a esquerda com o palco */
width: 80%;
/* Para "centralizar" horizontalmente */
margin: 0 auto;
font-size: 1.5em;
padding: .2em;
}
<label id="cronometro">Tempo:
<span>10</span>
</label>
const $cronometro = document.getElementById('cronometro');
let tempoSegundos = 10;
// Define o intervalo de repetição em milissegundos.
let refreshIntervalId = setInterval(jogo, 1000);
function atualizaTempo() {
tempoSegundos--;
$cronometro.innerHTML = `Tempo: <span>${tempoSegundos}</span>`;
if (tempoSegundos <= 0) {
<style>
.display {
display: flex;
justify-content: space-between;
/* Para que com margin left/right auto fique alinhado a esquerda com o palco */
width: 80%;
/* Para "centralizar" horizontalmente */
margin: 0 auto;
font-size: 1.5em;
padding: .2em;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Caça fantasmas</title>
<style>
#palco {
url = ""
while url == "":
url = input("Informe a URL desejada: ")
numero_de_paginas = input("Informe a quantidade de páginas: ")
if numero_de_paginas == "":
numero_de_paginas = 1
else:
numero_de_paginas = int(numero_de_paginas)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Morning Coffee</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<!-- O vídeo -->
<video autoplay muted loop id="meuVideo">
<source src="morning-coffee.mp4" type="video/mp4">
</video>
</body>