Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielRomer authored Nov 10, 2023
1 parent 73f185b commit bb892b4
Show file tree
Hide file tree
Showing 11 changed files with 227 additions and 0 deletions.
28 changes: 28 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
alert('Boas vindas ao jogo do número secreto');
let numeroMaximo = 5000;
let numeroSecreto = parseInt(Math.random() * numeroMaximo + 1);
console.log(numeroSecreto);
let chute;
let tentativas = 1;

// enquanto chute não for igual ao n.s.
while (chute != numeroSecreto) {
chute = prompt(`Escolha um número entre 1 a ${numeroMaximo}`);

// se chute for igual ao número secreto
if (chute == numeroSecreto) {
break;
} else {
if (chute > numeroSecreto) {
alert(`O número secreto é menor que ${chute}`);
} else {
alert(`O número secreto é maior que ${chute}`);
}
//tentativas = tentativas + 1;
tentativas++;
}
}
let palavraTentativa = tentativas > 1 ? 'tentativas' : 'tentativa';
alert(`Isso ai! Você descobriu o número secreto ${numeroSecreto} com ${tentativas} ${palavraTentativa}.`);


50 changes: 50 additions & 0 deletions img/JS Game.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<!DOCTYPE html>
<!-- saved from url=(0032)http://127.0.0.1:5500/index.html -->
<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>JS Game</title>
<link rel="stylesheet" href="./JS Game_files/style.css"></head>
<body>
<script src="./JS Game_files/app.js" defer=""></script>
<!-- Code injected by live-server -->
<script>
// <![CDATA[ <-- For SVG support
if ('WebSocket' in window) {
(function () {
function refreshCSS() {
var sheets = [].slice.call(document.getElementsByTagName("link"));
var head = document.getElementsByTagName("head")[0];
for (var i = 0; i < sheets.length; ++i) {
var elem = sheets[i];
var parent = elem.parentElement || head;
parent.removeChild(elem);
var rel = elem.rel;
if (elem.href && typeof rel != "string" || rel.length == 0 || rel.toLowerCase() == "stylesheet") {
var url = elem.href.replace(/(&|\?)_cacheOverride=\d+/, '');
elem.href = url + (url.indexOf('?') >= 0 ? '&' : '?') + '_cacheOverride=' + (new Date().valueOf());
}
parent.appendChild(elem);
}
}
var protocol = window.location.protocol === 'http:' ? 'ws://' : 'wss://';
var address = protocol + window.location.host + window.location.pathname + '/ws';
var socket = new WebSocket(address);
socket.onmessage = function (msg) {
if (msg.data == 'reload') window.location.reload();
else if (msg.data == 'refreshcss') refreshCSS();
};
if (sessionStorage && !sessionStorage.getItem('IsThisFirstTime_Log_From_LiveServer')) {
console.log('Live reload enabled.');
sessionStorage.setItem('IsThisFirstTime_Log_From_LiveServer', true);
}
})();
}
else {
console.error('Upgrade your browser. This Browser is NOT supported WebSocket for Live-Reloading.');
}
// ]]>
</script>

</body></html>
22 changes: 22 additions & 0 deletions img/JS Game_files/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// let numeroSecreto = parseInt(Math.random() * 11)
// let tentativas = 1
// let chute

// alert('Boas vindas ao jogo do número secreto')

// while (chute != numeroSecreto) {
// let chute = prompt('Escolha um número entre 1 e 10')
// if (chute == numeroSecreto) {
// break
// } else {
// if (chute > numeroSecreto) {
// alert('O número secreto é menor')
// } else {
// alert('O número secreto é maior')
// }
// }
// tentativas++
// }

// let palavraTentativa = tentativas > 1 ? 'tentativas' : 'tentativa'
// alert(`O número secreto era ${numeroSecreto} e você acertou com apenas ${tentativas} ${palavraTentativa}`)
8 changes: 8 additions & 0 deletions img/JS Game_files/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
* {
background-color: black;
background-image: url('./img/bg.png');
background-repeat: no-repeat;
background-size: cover;
background-position: center;
opacity: 0.4;
}
Binary file added img/Ruido.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/code.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/robot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/trophy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@700&family=Inter:wght@400;700&display=swap"
rel="stylesheet">
<link rel="stylesheet" href="style.css">
<title>JS Game</title>
</head>

<body>
<div class="container">
<div class="container__conteudo">
<img src="./img/robot.png" alt="robô mergulhador" class="container__imagem-robo" />
<div class="container__informacoes">
<img src="./img/trophy.png" alt="ícone de um troféu" />
<div class="container__texto">
<h1>Você <span class="container__texto-azul">acertou!</span></h1>
<h2>Você descobriu o número secreto!</h2>
</div>
</div>
</div>
</div>
<script src="app.js" defer></script>
</body>

</html>
88 changes: 88 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
* {
box-sizing: border-box;
margin: 0;
padding: 0;
color: white;
}

body {
background: linear-gradient(#1354A5 0%, #041832 33.33%, #041832 66.67%, #01080E 100%);
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}


body::before {
background-image: url("img/code.png");
background-repeat: no-repeat;
background-position: right;
content: "";
display: block;
position: absolute;
width: 100%;
height: 100%;
opacity: 0.4;
}

.container {
width: 1200px;
height: 600px;
display: flex;
align-items: center;
justify-content: space-between;
border-radius: 24px;
border: 1px solid #1875E8;
box-shadow: 4px 4px 20px 0px rgba(1, 8, 14, 0.15);
background-image: url("img/Ruido.png");
background-size: 100% 100%;
position: relative;
}

.container__conteudo {
display: flex;
align-items: center;
position: absolute;
bottom: 0;
}

.container__informacoes {
flex: 1;
padding: 20px;
}

.container__botao {
border-radius: 16px;
background: #1875E8;
padding: 16px 24px;
width: 100%;
font-size: 24px;
font-weight: 700;
border: none;
margin-top: 16px;
}

.container__texto {
margin: 16px 0 16px 0;
}

.container__texto-azul {
color: #1875E8;
}

h1 {
font-family: 'Chakra Petch', sans-serif;
font-size: 72px;
}

h2,
p,
button {
font-family: 'Inter', sans-serif;
}

h2 {
font-size: 32px;
font-weight: 400;
}

0 comments on commit bb892b4

Please sign in to comment.