path css 发光,使用CSS3 offset-path使得弹窗按指定路径淡出

CSS

语言:

CSSSCSS

确定

html,

body {

height: 100%;

}

body {

background: #eee;

display: -webkit-box;

display: -ms-flexbox;

display: flex;

-webkit-box-pack: center;

-ms-flex-pack: center;

justify-content: center;

-webkit-box-align: center;

-ms-flex-align: center;

align-items: center;

}

.modal {

width: 500px;

background: white;

border: 1px solid #ccc;

-webkit-transition: 1.1s ease-out;

transition: 1.1s ease-out;

box-shadow: -2rem 2rem 2rem rgba(0, 0, 0, 0.2);

-webkit-filter: blur(0);

filter: blur(0);

-webkit-transform: scale(1);

transform: scale(1);

opacity: 1;

visibility: visible;

}

.modal.off {

opacity: 0;

visibility: hidden;

-webkit-filter: blur(8px);

filter: blur(8px);

-webkit-transform: scale(0.33);

transform: scale(0.33);

box-shadow: 1rem 0 0 rgba(0, 0, 0, 0.2);

}

@supports (offset-rotation: 0deg) {

.modal {

offset-rotation: 0deg;

offset-path: path("M 250,100 S -300,500 -700,-200");

}

.modal.off {

offset-distance: 100%;

}

}

@media (prefers-reduced-motion) {

@supports (offset-rotation: 0deg) {

.modal {

offset-path: none;

}

}

}

.modal h2 {

border-bottom: 1px solid #ccc;

padding: 1rem;

margin: 0;

}

.modal .content {

padding: 1rem;

}

.modal .actions {

border-top: 1px solid #ccc;

background: #eee;

padding: 0.5rem 1rem;

}

.modal .actions button {

border: 0;

background: #78f89f;

border-radius: 5px;

padding: 0.5rem 1rem;

font-size: 0.8rem;

line-height: 1;

}

#centered-toggle-button {

position: absolute;

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值