先贴效果图:
优点:图标是有动画效果的,不需要背景图片。
1、需要引用一个dialog.css,代码如下:
/* ===========================================
@des: dialog.less
@author: 美奇软件开发工作室
@QQ: 15577969
@赞助平台: 元宝支付(18pay.net)
@time: 2021-01-10
=============================================*/
@charset "utf-8";
.clearfix {
*zoom: 1;
}
.clearfix:after {
visibility: hidden;
display: block;
font-size: 0;
content: " ";
clear: both;
height: 0;
}
* {
margin: 0;
padding: 0;
}
ul,
ol {
list-style: none;
}
img {
border: none;
}
input,
select,
textarea {
outline: none;
border: none;
background: none;
}
textarea {
resize: none;
}
a {
text-decoration: none;
}
.body {
font-family: 14px "Microsoft Yahei", "微软雅黑", Arial, Tahoma;
}
.btn-container {
width: 100%;
display: flex;
display: -webkit-flex;
display: -moz-flex;
justify-content: space-around;
-webkit-justify-content: space-around;
-moz-justify-content: space-around;
}
.btn-container input[type='button'] {
width: 20%;
padding: 0.357rem;
color: #fff;
border-radius: 3px;
-webkit-radius: 3px;
-moz-radius: 3px;
background-color: #3B9DFF;
}
.btn-container input[type='button']:active {
background-color: #1966b3;
}
/*重置盒模型 */
.boxContent * {
box-sizing: content-box;
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
}
/*animation start*/
#animationTipBox {
width: 100%;
height: auto;
background-color: #fff;
border-radius: 8px;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
position: fixed;
left: 50%;
top: 30%;
margin-left: -50%;
margin-top: -75px;
z-index: 1001;
-webkit-animation: alertAnimation 0.3s ease-in-out 0s 1;
-moz-animation: alertAnimation 0.3s ease-in-out 0s 1;
animation: alertAnimation 0.3s ease-in-out 0s 1;
}
#animationTipBox * {
box-sizing: content-box;
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
}
#animationTipBox .icon {
position: relative;
width: 80px;
height: 80px;
border-radius: 50px;
-webkit-border-radius: 50px;
-moz-border-radius: 50px;
border: 4px solid #66cc33;
margin: 15px auto 5px auto;
}
#animationTipBox .icon_box {
width: 80px;
height: 80px;
margin: 0 auto;
text-align: center;
position: relative;
}
#animationTipBox .lose .icon {
border-color: #FF9090;
}
#animationTipBox .lose .icon_box {
-webkit-animation: lose_Animation 0.5s ease 0s 1;
-moz-animation: lose_Animation 0.5s ease 0s 1;
animation: lose_Animation 0.5s ease 0s 1;
}
#animationTipBox .dec_txt {
font-size: 16px;
text-align: center;
color: #666;
line-height: 26px;
height: 26px;
padding: 5px 0 10px 0;
}
.tip .icon {
width: 80px;
height: 80px;
background-color: #66cc33;
border-radius: 100%;
-webkit-border-radius: 100%;
-moz-border-radius: 100%;
color: #fff;
font-size: 80px;
text-align: center;
line-height: 80px;
}
.success .line_short {
width: 25px;
height: 5px;
position: absolute;
left: 14px;
top: 46px;
border-radius: 4px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
background-color: #66cc33;
transform: rotate(45deg);
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-webkit-animation: success_short_Animation 0.65s ease 0s 1;
-moz-animation: success_short_Animation 0.65s ease 0s 1;
animation: success_short_Animation 0.65s ease 0s 1;
}
.success .line_long {
width: 47px;
height: 5px;
position: absolute;
right: 8px;
top: 38px;
border-radius: 4px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
background-color: #66cc33;
transform: rotate(-45deg);
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-webkit-animation: success_long_Animation 0.65s ease 0s 1;
-moz-animation: success_long_Animation 0.65s ease 0s 1;
animation: success_long_Animation 0.65s ease 0s 1;
}
.lose .line_left,
.lose .line_right {
width: 47px;
height: 5px;
position: absolute;
left: 17px;
top: 37px;
border-radius: 4px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
background-color: #FF9090;
transform: rotate(45deg);
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
}
.lose .line_right {
right: 11px;
top: 37px;
transform: rotate(-45deg);
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
}
/* 总体动画 函数 */
/*all animate*/
@-webkit-keyframes alertAnimation {
0% {
-webkit-transform: scale(0.5);
}
45% {
-webkit-transform: scale(1.25);
}
80% {
-webkit-transform: scale(0.95);
}
100% {
-webkit-transform: scale(1);
}
}
@-moz-keyframes alertAnimation {
0% {
-webkit-transform: scale(0.5);
}
45% {
-webkit-transform: scale(1.25);
}
80% {
-webkit-transform: scale(0.95);
}
100% {
-webkit-transform: scale(1);
}
}
@-webkit-keyframes alertAnimation {
0% {
-webkit-transform: scale(0.5);
}
45% {
-webkit-transform: scale(1.25);
}
80% {
-webkit-transform: scale(0.95);
}
100% {
-webkit-transform: scale(1);
}
}
/*all animate*/
/*success short animate*/
@-webkit-keyframes success_short_Animation {
0% {
е赅е4(4(еФе4) 赭4(4(еФе4) е4(4(еФе4(4(耸(聙4(4(赥4(3cvSjv4(4(n_}}}MQQ%
}|t4(vSjv(э}}!%9-}AQ Lэ}4(э}!%9-}AQ Lэ}4(э}}!%9-}AQ L4(э}!%9-}AQ L4(rn/Z4(4)9=1e=UQ}}=
QeAAU 1%\Qa!Q50Q8QHQ4(4(4(ф
еQн4(ф4(C虱4(4(展MQQ%
}|4(屔н4(е聍еɑе聹(屔4(4(4(4(Q4(э4(4("C*|4(4(4(}4(}4(}4(4(4(}Мх4(4(4(4(Rg4(4(4(}4(}М4(}М4(4(4(}Мх4(4(4(4(4(v*'^Ф4(4(
4(4(4(н4(йМ4(ййQ504(4(4(?jjgvd4("kJ1>Cv{Z"nknkJ1>Cv碾Bs&7jZ"[#vjnZroB;kkR2 |