原生js+css实现卡通风格待办事项应用代码
代码语言:html
所属分类:其他
代码描述:原生js+css实现卡通风格待办事项应用代码
代码标签: 原生 js css 卡通 风格 待办 事项 应用 代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!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">
<style>
@import url('https://fonts.googleapis.com/css2?family=Kalam:wght@300;400;700&display=swap');
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
--add-todo-active: 0;
min-height: 100vh;
background-color: #222;
display: grid;
font-family: Poppins, sans-serif;
}
:root {
--hue: 20;
--accent: hsl(var(--hue), 80%, 50%);
--dark-accent: hsl(var(--hue), 100%, 5%);
--light-accent: hsl(var(--hue), 100%, 95%);
}
.add-todo {
--active: 0;
position: absolute;
top: 0;
left: 50%;
translate: -50% 0;
width: max(250px, calc(80vmin * var(--active)));
height: max(50px, calc(150px * var(--active)));
display: block;
border: none;
background-color: transparent;
overflow: visible;
transition: top .5s, width .5s, height .5s, translate .5s;
z-index: 10;
}
.add-todo::before,
.add-todo::after {
content: '';
position: absolute;
height: 50px;
aspect-ratio: 1;
background-color: var(--accent);
left: -50px;
top: 0;
z-index: 0;
mask:
radial-gradient(circle 25px, #0000 24px, #000 25px),
linear-gradient(45deg, #000 52px, #0000 50px);
mask-composite: subtract;
clip-path: inset(0 0 0 25px);
}
.add-todo::after {
left: 100%;
mask:
radial-gradient(circle 25px, #0000 24px, #000 25px),
linear-gradient(-45deg, #000 52px, #0000 50px);
mask-composite: subtract;
clip-path: inset(0 25px 0 0);
}
.add-todo .inner {
position: relative;
width: 100%;
height: 100%;
background-color: var(--accent);
padding: 1rem 2rem;
border-radius: 0 0 25px 25px;
display: grid;
grid-template-columns: 1fr;
grid-template-rows: 50px 1fr;
overflow: hidden;
transition: border-radius .5s;
border-bottom: 3px solid black;
}
.add-todo header {
display: flex;
align-items: center;
justify-content: center;
}
.add-todo header h1 {
color: var(--light-accent);
font-weight: 300;
display: flex;
align-items: center;
justify-content: center;
}
.add-todo header h1 svg {
width: 50px;
aspect-ratio: 1;
opacity: 1;
}
.add-todo .todo-input-section {
display: flex;
}
.add-todo .todo-input-section .todo-input-wrapper {
display: flex;
width: 100%;
align-items: center;
}
.add-todo .todo-input-section .todo-input-wrapper .todo-input {
width: 100%;
background-color: transparent;
border: none;
font-family: Poppins, sans-serif;
color: .........完整代码请登录后点击上方下载按钮下载查看
















网友评论0