-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from OZimbres/TBranch
Lampada
- Loading branch information
Showing
17 changed files
with
176 additions
and
2 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* Lâmpada */ | ||
body{ | ||
background-color: var(--preto); | ||
} | ||
|
||
/*---=MAIN=---*/ | ||
main{ | ||
height: 90%; | ||
width: 100%; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
|
||
article{ | ||
height: 100%; | ||
width: 100%; | ||
position: relative; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
|
||
.luz-container{ | ||
height: 100%; | ||
width: 100%; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
|
||
.interruptor-container{ | ||
height: 10%; | ||
width: 10%; | ||
aspect-ratio: 1/1; | ||
position: absolute; | ||
right: 5%; | ||
} | ||
.interruptor-img-container{ | ||
height: 100%; | ||
width: 100%; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
#interruptor{ | ||
height: 100%; | ||
object-fit: cover; | ||
cursor: pointer; | ||
} | ||
|
||
.trocarlamp-container{ | ||
height: 10%; | ||
width: 10%; | ||
aspect-ratio: 1/1; | ||
position: absolute; | ||
right: 5%; | ||
top: 30%; | ||
} | ||
.trocarlamp-img-container{ | ||
height: 100%; | ||
width: 100%; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
#trocarlamp{ | ||
height: 50%; | ||
object-fit: cover; | ||
cursor: pointer; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,71 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Document</title> | ||
<link rel="stylesheet" href="/css/universal.css"> | ||
<link rel="stylesheet" href="/css/lampada.css"> | ||
</head> | ||
<body> | ||
|
||
<body> | ||
|
||
<header> | ||
<nav> | ||
<a href="/index.html" target="_self">HOME</a> | ||
</nav> | ||
</header> | ||
|
||
<main> | ||
<article> | ||
<section class="luz-container"> | ||
<figure class="luz-img-container"> | ||
<img id="luz" src="/assets/imagens/lampada/LuzApagada.png" alt=""> | ||
</figure> | ||
</section> | ||
|
||
<section class="interruptor-container"> | ||
<figure class="interruptor-img-container"> | ||
<img id="interruptor" src="/assets/imagens/lampada/interruptorDesligado.png" alt=""> | ||
</figure> | ||
</section> | ||
<section class="trocarlamp-container"> | ||
<figure class="trocarlamp-img-container"> | ||
<img id="trocarlamp" src="/assets/imagens/lampada/TrocarLamp.png" alt=""> | ||
</figure> | ||
</section> | ||
</article> | ||
|
||
</main> | ||
|
||
<footer> | ||
<div class="repositorio"> | ||
<a href="https://github.com/OZimbres/VTL-SA2" target="_blank">Repositório</a> | ||
</div> | ||
|
||
<ul class="devs"> | ||
<li> | ||
<a href="https://github.com/LoriaLawrenceZ" target="_blank">LoriaLawrenceZ</a> | ||
</li> | ||
|
||
<li> | </li> | ||
|
||
<li> | ||
<a href="https://github.com/ThmZ1101" target="_blank">ThmZ</a> | ||
</li> | ||
|
||
<li> | </li> | ||
|
||
<li> | ||
<a href="https://github.com/epicestudar" target="_blank">epicestudar</a> | ||
</li> | ||
</ul> | ||
</footer> | ||
|
||
|
||
</body> | ||
|
||
<script src="/js/lampada.js"></script> | ||
|
||
</html> |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/*-----===VARIÁVEIS==-----*/ | ||
const interruptor = document.getElementById("interruptor"); | ||
var luzLigada = "/assets/imagens/lampada/LuzApagada.png"; | ||
var luzDesligada = "/assets/imagens/lampada/LuzAcesa.png"; | ||
var luzQuebrada = "/assets/imagens/lampada/luzQuebrada.png"; | ||
var interruptorDesligado = "/assets/imagens/lampada/interruptorDesligado.png" | ||
var interruptorLigado = "/assets/imagens/lampada/interruptorLigado.png" | ||
let contador = 0; | ||
const trocarlamp = document.getElementById("trocarlamp"); | ||
/*---=EventListener=---*/ | ||
interruptor.addEventListener("click", () => { | ||
if (contador < 10) { | ||
trocar(); | ||
contador++; | ||
} | ||
else { | ||
var luzAtual = document.getElementById("luz"); | ||
luzAtual.setAttribute("src", luzQuebrada); | ||
} | ||
}); | ||
|
||
trocarlamp.addEventListener("click", () => { | ||
contador = 0; | ||
let LuzAtual = "/assets/imagens/lampada/LuzApagada.png"; | ||
var luzAtual = document.getElementById("luz"); | ||
luzAtual.setAttribute("src", LuzAtual); | ||
}); | ||
/*---=FUNÇÕES=---*/ | ||
function trocar() { | ||
var luzAtual = document.getElementById("luz"); | ||
var srcLuzAtual = luzAtual.getAttribute("src"); | ||
|
||
var interruptorAtual = document.getElementById("interruptor"); | ||
|
||
if (srcLuzAtual == "/assets/imagens/lampada/LuzApagada.png") { | ||
luzAtual.setAttribute("src", luzDesligada); | ||
interruptorAtual.setAttribute("src", interruptorLigado); | ||
} else { | ||
luzAtual.setAttribute("src", luzLigada); | ||
interruptorAtual.setAttribute("src", interruptorDesligado); | ||
} | ||
} | ||
|