div+css+svg实现支持暗黑亮色模式的遥控器代码
代码语言:html
所属分类:布局界面
代码描述:div+css+svg实现支持暗黑亮色模式的遥控器代码
代码标签: div css svg 暗黑 亮色 模式 遥控器
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
@charset "utf-8";
/* CSS Document */
:root {
--light: #ffffff;
--theme-color: #222222;
--theme-dark: #1f1f1f;
--theme-medium: #333333;
--body-bg: #353535;
--phone-bg: #262626;
}
.light-theme {
--light: #777777;
--theme-color: #f0f0f3;
--theme-dark: #d9d9d9;
--theme-medium: #777777;
--body-bg: #353535;
--phone-bg: #f5f5f5;
}
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Nunito:wght@400;700&display=swap");
* {
margin: 0px;
padding: 0px;
box-sizing: border-box;
}
body {
background: var(--body-bg);
font-size: 16px;
color: var(--light);
font-family: "Nunito", sans-serif;
text-transform: uppercase;
}
h1 {
font-size: 84px;
line-height: 86px;
letter-spacing: 4px;
font-weight: normal;
}
p {
margin-right: -8px;
font-size: 32px;
line-height: 32px;
font-weight: lighter;
letter-spacing: 14px;
}
main {
padding: 15px;
min-height: 100vh;
display: flex;
display: -webkit-flex;
justify-content: center;
-webkit-justify-content: center;
align-items: center;
-webkit-align-items: center;
}
.d-flex {
display: flex;
display: -webkit-flex;
}
.justify-content-center {
justify-content: center;
-webkit-justify-content: center;
}
.align-items-center {
align-items: center;
-webkit-align-items: center;
}
.justify-content-between {
justify-content: space-between;
-webkit-justify-content: space-between;
}
.phone {
width: 375px;
height: 812px;
background: var(--phone-bg);
border: 8px solid var(--theme-dark);
border-radius: 28px;
position: relative;
}
.btn {
width: 56px;
height: 56px;
line-height: 56px;
background: var(--theme-color);
color: var(--light);
border: none;
border-radius: 50%;
cursor: pointer;
display: flex;
display: -webkit-flex;
justify-content: center;
-webkit-justify-content: center;
align-items: center;
-webkit-align-items: center;
}
.btn.btn-small {
width: 48px;
height: 48px;
line-height: 48px;
}
.btn img {
max-width: 50%;
transition: all 0.3s ease-in-out;
-webkit-transition: all 0.3s ease-in-out;
}
.light-theme img {
filter: brightness(0.5);
-webkit-filter: brightness(0.5);
}
.light-theme .no-mode img {
filter: none;
-webkit-filter: none;
}
.btn-shadow {
box-shadow: -10px -10px 20px rgba(255, 255, 255, 0.1),
10px 10px 20px rgba(0, 0, 0, 0.25);
-webkit-box-shadow: -10px -10px 20px rgba(255, 255, 255, 0.1),
10px 10px 20px rgba(0, 0, 0, 0.25);
}
.light-theme .btn-shadow {
box-shadow: -10px -10px 20px #ffffff, 10px 10px 20px rgba(174, 174, 192, 0.4);
-webkit-box-shadow: -10px -10px 20px #ffffff,
10px 10px 20px rgba(174, 174, 192, 0.4);
}
.list {
margin-bottom: 36px;
padding: 0 20px;
}
.status-bar img {
margin-left: 4px;
}
.topbar {
margin: 20px 0 36px;
font-size: 12px;
line-height: 14px;
}
.center-btns {
width: 142px;
height: 142px;
background: var(--theme-color);
border-radius: 50%;
position: relative;
}
.center-btns::after {
content: "";
position: absolute;
height: 18px;
width: 18px;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
-webkit-transform: translate(-50%, -50%);
background: var(--theme-medium);
border-radius: 50%;
}
.center-btns .btn {
width: 36px;
height: 36px;
position: absolute;
}
.center-btns .btn-up,
.center-btns .btn-down {
left: 50%;
transform: translateX(-50%);
-webkit-transform: translateX(-50%);
}
.center-btns .btn-up {
top: 8px;
}
.center-btns .btn-down {
bottom: 8px;
}
.center-btns .btn-left,
.center-btns .btn-right {
top: 50%;
transform: translateY(-50%);
-webkit-transform: translateY(-50%);
}
.center-btns .btn-left {
left: 8px;
}
.center-btns .btn-right {
right: 8px;
}
.side-btns {
padding: 6px;
width: 58px;
height: 142px;.........完整代码请登录后点击上方下载按钮下载查看
网友评论0