Mas não consigo adicionar mais botões (Com apenas 1 botão deslizante funciona corretamente)
Se eu adicionar outro botão e ao aciona-lo ele desarma o primeiro, já mudei os nomes chaves do css, mas não deu certo.
Obs: Não é erro no PHP (salva no banco) é o css que aciona o deslizante do botão.
Como faço para adicionar mais 5 botões checkbox
Checkbox deslizante html
<label class="">
<!--Lógica 1 -- Se o apto estiver sujo exibe o botão ativado-->
<?php if($id == $id and $busca == $apto && $sujo == 1 ){
?>
<div class="switch__container">Sujo
<input id="switch-shadow" class="switch switch--shadow" name="check[]" value="0" type="checkbox" onclick="myFun()" checked>
<label for="switch-shadow"></label>
</div>
<!--Lógica 2 -- Se o apto não estiver sujo exibe o botão desativado-->
<?php
}else if ($id == $id and $busca == $apto && $sujo == 0) {
?>
<div class="switch__container">Sujo
<input id="switch-shadow" class="switch switch--shadow" name="check[]" value="1" type="checkbox" onclick="myFun()">
<label for="switch-shadow"></label>
</div>
<?php
}?>
</label>
[code=CSS]/* Estilo iOS */
.switch__container {
margin: 0px auto;
width: 50px;
}
.switch {
visibility: hidden;
position: absolute;
margin-left: 0px;
}
.switch + label {
display: block;
position: relative;
cursor: pointer;
outline: none;
user-select: none;
}
.switch--shadow + label {
padding: 2px;
width: 60px;
height: 30px;
background-color: #dddddd;
border-radius: 30px;
}
.switch--shadow + label:before,
.switch--shadow + label:after {
display: block;
position: absolute;
top: 1px;
left: 1px;
bottom: 1px;
content: "";
}
.switch--shadow + label:before {
right: 1px;
background-color: #f1f1f1;
border-radius: 30px;
transition: background 0.4s;
}
.switch--shadow + label:after {
width: 30px;
background-color: #fff;
border-radius: 100%;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
transition: all 0.4s;
}
.switch--shadow:checked + label:before {
background-color: #8ce196;
}
.switch--shadow:checked + label:after {
transform: translateX(18px);
}[/code]