将图片变成滚形弯曲效果
代码语言:html
所属分类:三维
代码描述:将图片变成滚形弯曲效果
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> #btn--yp { box-sizing: content-box; position: fixed; z-index: 9; bottom: 1em; right: 1em; border: solid 1em transparent; width: 4.625em; height: 3.25em; background: url(http://repo.bfw.wiki/bfwrepo/icon/5d834ea6be5b9.png) 50%/cover content-box; font: 16px/ 1.25 trebuchet ms, sans-serif; text-indent: 200vw; text-shadow: none; filter: grayscale(1) drop-shadow(0 0 1px #e8e0e0); transition: .5s; white-space: nowrap; } #btn--yp:before { box-sizing: inherit; position: absolute; left: 0; bottom: 100%; margin: 1em -.5em; padding: .5em; width: 100%; border-radius: 5px; background: #e8e0e0; color: #000; text-align: center; text-decoration: none; text-indent: 0vw; white-space: normal; animation: float 1s ease-in-out infinite alternate; content: attr(data-txt); } #btn--yp:hover, #btn--yp:focus { outline: none; filter: grayscale(0) drop-shadow(0 0 1px crimson); } @keyframes float { to { transform: translateY(0.75em); } } * { margin: 0; padding: 0; } body { overflow: hidden; height: 100vh; background: repeating-linear-gradient(45deg, #303030 0 2px, #262626 0 7px); } div { position: absolute; transform-style: preserve-3d; } .slices { top: 50%; left: 50%; transform: translatey(-20vh) perspective(100vmin) rotatey(calc(var(--val)/100*var(--n-slices)*1turn/var(--n-poly))); } .slice { margin: -31.25vw -12.5vw; width: 25vw; height: 62.5vw; transform: rotatey(calc(var(--i)*-1turn/var(--n-poly))) translatez(calc(-.5*25vw/var(--tan))) scalex(1.0025); background: url(http://repo.bfw.wiki/bfwrepo/image/5f00690c87808.png) calc(var(--i)*-25vw)/calc(var(--n-slices)*25vw) 100%; filter: contrast(0.65); transition: filter .3s; } .slice::before { position: absolute; top: 100%; right: 0; left: 0; height: 100%; transform: scaley(-1); background: inherit; --mask: linear-gradient(transparent, rgba(255, 0, 0, 0.1), rgba(255, 0, 0, 0.5)); -webkit-mask: var(--mask); .........完整代码请登录后点击上方下载按钮下载查看
网友评论0