Add files via upload
This commit is contained in:
parent
be50ea2328
commit
886f811f17
@ -0,0 +1,10 @@
|
||||
let body = document.querySelector('body');
|
||||
let dark = document.querySelector('#dark');
|
||||
|
||||
dark.onclick = function (){
|
||||
if(dark.checked == true){
|
||||
body.classList.add('darkMode');
|
||||
} else {
|
||||
body.classList.remove('darkMode');
|
||||
}
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
<!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="style.css">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<body>
|
||||
<div class="box">
|
||||
<div class="profile">
|
||||
<div class="imgBx">
|
||||
<img src="user.jpg">
|
||||
</div>
|
||||
<h4 class="text">Ahmed ... <br><span>Full Stack</span></h4>
|
||||
</div>
|
||||
<ul class="menu">
|
||||
<li>
|
||||
<label>
|
||||
<span class="title">
|
||||
<ion-icon name="wifi-outline"></ion-icon>
|
||||
Wi-Fi</span>
|
||||
<span class="action">
|
||||
<input type="checkbox">
|
||||
<i></i>
|
||||
</span>
|
||||
</label>
|
||||
<label>
|
||||
<span class="title">
|
||||
<ion-icon name="bluetooth-outline"></ion-icon>
|
||||
Bluetooth</span>
|
||||
<span class="action">
|
||||
<input type="checkbox">
|
||||
<i></i>
|
||||
</span>
|
||||
</label>
|
||||
<label>
|
||||
<span class="title">
|
||||
<ion-icon name="airplane-outline"></ion-icon>
|
||||
Airplane Mode</span>
|
||||
<span class="action">
|
||||
<input type="checkbox">
|
||||
<i></i>
|
||||
</span>
|
||||
</label>
|
||||
<label>
|
||||
<span class="title">
|
||||
<ion-icon name="location-outline"></ion-icon>
|
||||
Location</span>
|
||||
<span class="action">
|
||||
<input type="checkbox">
|
||||
<i></i>
|
||||
</span>
|
||||
</label>
|
||||
<label>
|
||||
<span class="title">
|
||||
<ion-icon name="moon-outline"></ion-icon>
|
||||
Dark Mode</span>
|
||||
<span class="action">
|
||||
<input type="checkbox" id="dark">
|
||||
<i></i>
|
||||
</span>
|
||||
</label>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<script type="module" src="https://unpkg.com/ionicons@5.5.2/dist/ionicons/ionicons.esm.js"></script>
|
||||
<script nomodule src="https://unpkg.com/ionicons@5.5.2/dist/ionicons/ionicons.js"></script>
|
||||
<script src="app.js"></script>
|
||||
</body>
|
||||
</html>
|
144
100_projects/53-custom-checkbox-toggle-dark-light-mode/style.css
Normal file
144
100_projects/53-custom-checkbox-toggle-dark-light-mode/style.css
Normal file
@ -0,0 +1,144 @@
|
||||
*{
|
||||
margin:0;
|
||||
padding:0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
body{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
min-height: 100vh;
|
||||
background: #f0f0f0;
|
||||
transition: .3s;
|
||||
}
|
||||
.darkMode{
|
||||
background: #333;
|
||||
}
|
||||
.box{
|
||||
position: relative;
|
||||
width: 300px;
|
||||
padding: 30px;
|
||||
background: #fff;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 30px 30px rgba(0,0,0, .5);
|
||||
transition: .3s;
|
||||
}
|
||||
.darkMode .box{
|
||||
background: #292929;
|
||||
}
|
||||
.profile{
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
.profile .imgBx{
|
||||
position: relative;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
background: #f00;
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
}
|
||||
.profile .imgBx img{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
object-fit: cover;
|
||||
}
|
||||
.profile .text{
|
||||
font-weight: 500;
|
||||
color: #777;
|
||||
line-height: 1.2em;
|
||||
}
|
||||
.darkMode .profile .text{
|
||||
color: #ddd;
|
||||
}
|
||||
.profile .text span{
|
||||
font-weight: 400;
|
||||
font-size: .85em;
|
||||
color: #888;
|
||||
}
|
||||
.darkMode .profile .text span{
|
||||
color: #aaa;
|
||||
}
|
||||
.menu{
|
||||
position: relative;
|
||||
margin-top: 20px;
|
||||
padding-top: 10px;
|
||||
border-top: 1px solid rgba(0,0,0, .1);
|
||||
}
|
||||
.darkMode .menu{
|
||||
border-top: 1px solid rgba(255,255,255, .5);
|
||||
}
|
||||
.menu li{
|
||||
list-style: none;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 20px;
|
||||
}
|
||||
.menu li label{
|
||||
position: relative;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.menu li label span{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
user-select: none;
|
||||
cursor: pointer;
|
||||
color: #777;
|
||||
transition: .2s;
|
||||
}
|
||||
.darkMode .menu li label span{
|
||||
color: #aaa;
|
||||
}
|
||||
.menu li label span:hover{
|
||||
color: rgba(0,0,0, .3);
|
||||
}
|
||||
.darkMode .menu li label span:hover{
|
||||
color: rgba(255,255,255, .3);
|
||||
}
|
||||
.menu li label span ion-icon{
|
||||
margin-right: 5px;
|
||||
}
|
||||
.menu li label .action{
|
||||
position: relative;
|
||||
}
|
||||
.menu li label .action input{
|
||||
appearance: none;
|
||||
}
|
||||
.menu li label .action i {
|
||||
position: relative;
|
||||
width: 30px;
|
||||
height: 15px;
|
||||
background: #ddd;
|
||||
border-radius: 15px;
|
||||
transition: .3s;
|
||||
}
|
||||
.darkMode .menu li label .action i{
|
||||
background: #666;
|
||||
}
|
||||
.menu li label .action input:checked ~ i{
|
||||
background: #555;
|
||||
}
|
||||
.menu li label .action i::before{
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 2.5px;
|
||||
left: 2.5px;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
border-radius: 10px;
|
||||
background: #fff;
|
||||
box-shadow: 0 2px 4px rgba(0,0,0, .1);
|
||||
transition: .3s;
|
||||
}
|
||||
.menu li label .action input:checked ~ i::before{
|
||||
left: calc(100% - 12.5px);
|
||||
}
|
BIN
100_projects/53-custom-checkbox-toggle-dark-light-mode/user.jpg
Normal file
BIN
100_projects/53-custom-checkbox-toggle-dark-light-mode/user.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 330 KiB |
Loading…
Reference in New Issue
Block a user