-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
117 lines (109 loc) · 6.62 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="./public/css/tailwind.css">
<title>Control casa inteligente</title>
</head>
<body>
<div class="grid bg-layout place-items-center bg-center bg-cover box-border min-h-screen w-full p-8 lg:p-0">
<div class="glassmorphism flex flex-col p-8 lg:p-16 box-border max-w-screen-lg w-full lg:w-8/12">
<p class="text-base lg:text-xl mt-0 mb-2 text-center">Alexis Bacik</p>
<h1 class="text-2xl lg:text-4xl mt-0 text-center font-bold">Control de Casa Inteligente</h1>
<div class="flex flex-col lg:flex-row gap-5 justify-center w-full mt-8 lg:mt-16 mb-0 lg:my-16">
<div class="relative grid place-items-center w-full lg:w-4/6">
<img class="w-full" src="./public/img/7615928a31984e7db4b55cf20f39661a.jpg" alt="">
<div id="luz-1" class="luz-1 absolute rounded-full"></div>
<div id="luz-2" class="luz-2 absolute rounded-full"></div>
<div id="luz-3" class="luz-3 absolute rounded-full"></div>
<img id="aspiradora-inicio" class="aspiradora-inicio absolute" src="https://img.icons8.com/external-flaticons-flat-flat-icons/64/null/external-vacuum-cleaner-automation-technology-flaticons-flat-flat-icons.png"/>
<audio id="audio" src="./public/music/dreams.mp3"></audio>
<div id="sensor" class="sensor absolute rounded-full"></div>
</div>
<div class="controles grid place-items-center w-full lg:w-2/6 mt-8 lg:mt-0">
<div class="controles grid gap-5 grid-cols-2 md:grid-cols-4 lg:grid-cols-2 grid-rows-2 md:grid-rows1 lg:grid-rows-2 max-w-full w-full">
<div class="glassmorphism relative grid place-items-center box-border w-full h-full cursor-pointer">
<p class="m-1 text-sm">Luces</p>
<img class="w-8 m-2 rotate-180" src="https://img.icons8.com/ios/100/000000/light-on--v1.png" alt="luces">
<input id="botonDeLuces" class="absolute w-full h-full opacity-0" type="checkbox">
<label for="botonDeLuces" class="flex items-center mb-1 bg-gray-400 h-6 w-12 rounded-full">
<div class="toggle-dot bg-white m-1 h-5 w-5 rounded-full"></div>
</label>
</div>
<div class="glassmorphism relative grid place-items-center box-border w-full h-full cursor-pointer">
<p class="m-1 text-sm">Aspiradora</p>
<img class="w-8 m-2" src="https://img.icons8.com/external-phatplus-lineal-phatplus/64/null/external-robot-vacuum-cleaner-ai-for-earth-phatplus-lineal-phatplus.png" alt="luces">
<input id="boton-aspiradora" class="absolute w-full h-full opacity-0" type="checkbox">
<label for="boton-aspiradora" class="flex items-center mb-1 bg-gray-400 h-6 w-12 rounded-full">
<div class="toggle-dot bg-white m-1 h-5 w-5 rounded-full"></div>
</label>
</div>
<div class="glassmorphism relative grid place-items-center box-border w-full h-full cursor-pointer">
<p class="m-1 text-sm">Música</p>
<img class="w-8 m-2" src="https://img.icons8.com/carbon-copy/100/null/music.png" alt="luces">
<input id="boton-musica" class="absolute w-full h-full opacity-0" type="checkbox">
<label for="boton-musica" class="flex items-center mb-1 bg-gray-400 h-6 w-12 rounded-full">
<div class="toggle-dot bg-white m-1 h-5 w-5 rounded-full"></div>
</label>
</div>
<div class="glassmorphism relative grid place-items-center box-border w-full h-full cursor-pointer">
<p class="m-1 text-sm">Alarma</p>
<img class="w-8 m-2" src="https://img.icons8.com/ios/100/null/security-checked.png" alt="luces">
<input id="boton-alarma" class="absolute w-full h-full opacity-0" type="checkbox">
<label for="boton-alarma" class="flex items-center mb-1 bg-gray-400 h-6 w-12 rounded-full">
<div class="toggle-dot bg-white m-1 h-5 w-5 rounded-full"></div>
</label>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
const botonDeLuces = document.getElementById('botonDeLuces')
const botonLuz1 = document.getElementById('luz-1')
const botonLuz2 = document.getElementById('luz-2')
const botonLuz3 = document.getElementById('luz-3')
const botonAspiradora = document.getElementById('boton-aspiradora')
const aspiradoraInicio = document.getElementById('aspiradora-inicio')
const botonMusica = document.getElementById('boton-musica')
const audio = document.getElementById('audio')
const botonAlarma = document.getElementById('boton-alarma')
const botonSensor = document.getElementById('sensor')
function interruptorLuces() {
botonDeLuces.addEventListener('change', () => {
botonLuz1.classList.toggle('luz')
botonLuz2.classList.toggle('luz')
botonLuz3.classList.toggle('luz')
})
}
interruptorLuces()
function aspiradora(){
botonAspiradora.addEventListener('change', ()=>{
aspiradoraInicio.classList.toggle('aspiradora-funcionando')
})
}
aspiradora()
let reproducir = true
botonMusica.addEventListener('change', reproducirMusica)
function reproducirMusica(){
if(reproducir){
audio.pause()
reproducir = false
}else {
audio.play()
reproducir = true
}
}
reproducirMusica()
function activarAlarma(){
botonAlarma.addEventListener('change', ()=>{
botonSensor.classList.toggle('sensor-activado')
})
}
activarAlarma()
</script>
</body>
</html>