700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > html 图片切换渐变效果图 CSS3 用CLIP来做图片切换的渐变效果

html 图片切换渐变效果图 CSS3 用CLIP来做图片切换的渐变效果

时间:2020-07-17 02:11:44

相关推荐

html 图片切换渐变效果图 CSS3  用CLIP来做图片切换的渐变效果

CSS

语言:

CSSSCSS

确定

body {

overflow: hidden;

margin: 0;

-webkit-perspective: 600px;

perspective: 600px;

}

.container {

width: 100vw;

height: 100vh;

background: url(http://s3-us-west-/s.cdpn.io/127738/unsplahBg2.jpg) center / cover;

-webkit-perspective: 600px;

perspective: 600px;

-webkit-transition: 1.5s all ease-in-out;

transition: 1.5s all ease-in-out;

}

.clip {

position: absolute;

top: 0;

left: 0;

width: 100vw;

height: 100vh;

background: url(http://s3-us-west-/s.cdpn.io/127738/unsplahBg1.jpg) center / cover;

-webkit-clip-path: circle(0 at 50vw 50vh);

clip-path: circle(0 at 50vw 50vh);

-webkit-transform: translateZ(-100px);

transform: translateZ(-100px);

-webkit-transition: 1.5s all ease-in-out;

transition: 1.5s all ease-in-out;

}

.container.visible .clip {

-webkit-transform: translateZ(0px);

transform: translateZ(0px);

-webkit-clip-path: circle(60vmax at 50vw 50vh);

clip-path: circle(60vmax at 50vw 50vh);

}

.container.visible {

-webkit-transform: translateZ(100px);

transform: translateZ(100px);

}

button {

position: absolute;

left: 50%;

bottom: 20px;

background: white;

border: none;

cursor: pointer;

padding: 5px 10px;

font-size: 1.5em;

-webkit-transform: translateX(-50%);

transform: translateX(-50%);

}

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。