Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8"/>
- <title>Coutdown</title>
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <link rel="stylesheet" type="text/css" href="style.css">
- </head>
- <body>
- <p id="time">Countdown</p>
- <img src="xm.png" alt="Countdown" id="fire" onclick="xequeMate()">
- <script src="arquivo.js"></script>
- </body>
- </html>
- @import url('https://fonts.googleapis.com/css?family=Orbitron');
- body{
- font-family: 'Orbitron', sans-serif;
- background-color: #07060a;
- color: #ff0000;
- font-size: 43px;
- text-align: center;
- }
- #fire{
- cursor: pointer;
- }
- img{
- max-width: 100%;
- }
- var check = false;
- function xequeMate(){
- if(check==false){
- var timer1 = setInterval(function(){start()},1000);
- var timer2 = setInterval(function(){end()},13200);
- var count =10;
- function start(){
- soundBeep();
- document.getElementById("time").innerHTML = count;
- if(count==0){
- clearInterval(timer1);
- soundThunder();
- document.getElementById("fire").src="explosion.gif";
- document.getElementById("time").innerHTML = "GAME OVER";
- }
- count --;
- }
- check=true;
- }
- }
- function soundThunder(){
- var beep = new Audio();
- beep.src="Thunder_Crack.mp3";
- beep.play();
- }
- function soundBeep(){
- var beep = new Audio();
- beep.src="Beep_Short.mp3";
- beep.play();
- }
- function end(){
- document.getElementById("fire").src="clean.png";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement