xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

CSS clip-path All In One

CSS clip-path All In One

clip-path

https://developer.mozilla.org/en-US/docs/Web/CSS/clip-path

/* Keyword values */
clip-path: none;

/* <clip-source> values */
clip-path: url(resources.svg#c1);

/* <geometry-box> values */
clip-path: margin-box;
clip-path: border-box;
clip-path: padding-box;
clip-path: content-box;
clip-path: fill-box;
clip-path: stroke-box;
clip-path: view-box;

/* <basic-shape> values */
clip-path: inset(100px 50px);
clip-path: circle(50px at 0 100px);
clip-path: ellipse(50px 60px at 0 10% 20%);
clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
clip-path: path('M0.5,1 C0.5,1,0,0.7,0,0.3 A0.25,0.25,1,1,1,0.5,0.3 A0.25,0.25,1,1,1,1,0.3 C1,0.7,0.5,1,0.5,1 Z');

/* Box and shape values combined */
clip-path: padding-box circle(50px at 0 100px);

/* Global values */
clip-path: inherit;
clip-path: initial;
clip-path: revert;
clip-path: revert-layer;
clip-path: unset;

https://interactive-examples.mdn.mozilla.net/pages/css/clip-path.html


demos

赛博朋克 2077

@supports ((-webkit-clip-path:polygon(0 2%,100% 2%,100% 5%,0 5%)) or (clip-path:polygon(0 2%,100% 2%,100% 5%,0 5%)))
.btn-preorder:hover .btn-preorder--glitch, .btn-preorder:hover .btn-preorder__text:after {
    -webkit-animation-direction: alternate;
    animation-direction: alternate;
    -webkit-animation-duration: 2s;
    animation-duration: 2s;
    -webkit-animation-iteration-count: infinite;
    animation-iteration-count: infinite;
    -webkit-animation-name: glitch-anim-1;
    animation-name: glitch-anim-1;
    -webkit-animation-timing-function: linear;
    animation-timing-function: linear;
    display: block;
}



@supports ((-webkit-clip-path: polygon(0 2%,100% 2%,100% 5%,0 5%)) or (clip-path:polygon(0 2%,100% 2%,100% 5%,0 5%))) {
    .btn-preorder:hover .btn-preorder--glitch,.btn-preorder:hover .btn-preorder__text:after {
        -webkit-animation-direction:alternate;
        animation-direction: alternate;
        -webkit-animation-duration: 2s;
        animation-duration: 2s;
        -webkit-animation-iteration-count: infinite;
        animation-iteration-count: infinite;
        -webkit-animation-name: glitch-anim-1;
        animation-name: glitch-anim-1;
        -webkit-animation-timing-function: linear;
        animation-timing-function: linear;
        display: block
    }
}


https://www.cyberpunk.net/us/zh-cn/

https://www.bilibili.com/video/BV1KB4y1R7s9/

tongqu / 同济大学 -> 同去

https://tongqu.me/

https://tongqu.sjtu.edu.cn/

twitter & clap effect

vue-clap-button (shit npm package demo) 💩

https://jsbin.com/kapomaw/edit?html,output

https://gist.github.com/xgqfrms/172096109549ca406aee0d102413f69d?permalink_comment_id=4291365#gistcomment-4291365

https://gist.github.com/xgqfrms/172096109549ca406aee0d102413f69d?permalink_comment_id=4291392#gistcomment-4291392

refs



©xgqfrms 2012-2020

www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!


posted @ 2019-11-26 21:30  xgqfrms  阅读(99)  评论(5编辑  收藏  举报