div+css实现干净清爽弹出提示层效果代码
代码语言:html
所属分类:弹出层
代码描述:div+css实现干净清爽弹出提示层效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
@import url('https://fonts.googleapis.com/css2?family=Varela+Round&display=swap');
:root {
--tr: all 0.5s ease 0s;
--ch1: #05478a;
--ch2: #0070e0;
--cs1: #005e38;
--cs2: #03a65a;
--cw1: #c24914;
--cw2: #fc8621;
--ce1: #851d41;
--ce2: #db3056;
}
@property --bg-help {
syntax: '<percentage>';
inherits: false;
initial-value: -10%;
}
@property --bg-success {
syntax: '<percentage>';
inherits: false;
initial-value: 145%;
}
@property --bg-warning {
syntax: '<percentage>';
inherits: false;
initial-value: -55%;
}
@property --bg-error {
syntax: '<percentage>';
inherits: false;
initial-value: 112%;
}
@property --bsc {
syntax: '<color>';
inherits: false;
initial-value: red;
}
body {
margin: 0;
padding: 0;
width: 100vw;
height: 100vh;
overflow: hidden;
display: flex;
align-items: center;
justify-content: flex-end;
flex-direction: column;
background: radial-gradient(circle at 100% 80%, #b3cdd1, #a7b5c9);
font-family: "Varela Round", sans-serif;
}
.toast-panel {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
transition: var(--tr);
position: absolute;
padding: 0 1rem;
height: 100%;
}
.toast-item {
/*overflow: hidden;*/
max-height: 25rem;
transition: var(--tr);
position: relative;
animation: show-toast 4s ease 3s 1;
}
@keyframes show-toast {
0%, 50%, 100% { max-height: 0; opacity: 0; }
10%, 25% { max-height: 15rem; opacity: 1; }
}
.toast {
background: #fff;
color: #f5f5f5;
padding: 1rem 2rem 1rem 3rem;
text-align: center;
border-radius: 1rem;
position: relative;
font-weight: 300;
margin: 1rem 0;
text-align: left;
max-width: 16rem;
transition: var(--tr);
opacity: 1;
border: 0.15rem solid #fff2;
box-shadow: 0 0 1.5rem 0 #1a1f4360;
}
.toast:before {
content: "";
position: absolute;
width: 0.5rem;
height: calc(100% - 1.5rem);
top: 0.75rem;
left: 0.5rem;
z-index: 0;
border-radius: 1rem;
background: var(--clr);
}
.toast h3 {
font-size: 1.2rem;
margin: 0;
line-height: 1.35rem;
font-weight: 600;
position: relative;
color: var(--clr);
}
.toast p {
position: relative;
font-size: 0.95rem;
z-index: 1;
margin: 0.25rem 0 0;
color: #595959;
line-height: 1.3rem;
}
.close {
position: absolute;
width: 1.35rem;
height: 1.35rem;
text-align: center;
right: 1rem;
cursor: pointer;
border-radius: 100%;
}
.close:after {
position: absolute;
font-family: 'Varela Round', san-serif;
width: 100%;
height: 100%;
left: 0;
font-size: 1.8rem;
content: "+";
transform: rotate(-45deg);
border-radius: 100%;
display: flex;
align-items: center;
justify-content: center;
color: #595959;
t.........完整代码请登录后点击上方下载按钮下载查看
网友评论0