纯css 三维空间旋转效果
代码语言:html
所属分类:三维
代码描述:纯css 三维空间旋转效果
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> html { font-size: 1vh; width: 100%; height: 100%; } body { perspective: 50rem; overflow: hidden; width: 100%; height: 100%; margin: 0; display: flex; flex-wrap: wrap; } body, body *, body *:before, body *:after { transform-style: preserve-3d; box-sizing: border-box; position: absolute; content: ""; left: 0; top: 0; } i { width: calc(100% / 13); height: 100%; position: relative; z-index: 1; } i:nth-of-type(1):hover ~ x { transform: rotateY(-240deg); } i:nth-of-type(2):hover ~ x { transform: rotateY(-230deg); } i:nth-of-type(3):hover ~ x { transform: rotateY(-220deg); } i:nth-of-type(4):hover ~ x { transform: rotateY(-210deg); } i:nth-of-type(5):hover ~ x { transform: rotateY(-200deg); } i:nth-of-type(6):hover ~ x { transform: rotateY(-190deg); } i:nth-of-type(7):hover ~ x { transform: rotateY(-180deg); } i:nth-of-type(8):hover ~ x { transform: rotateY(-170deg); } i:nth-of-type(9):hover ~ x { transform: rotateY(-160deg); } i:nth-of-type(10):hover ~ x { transform: rotateY(-150deg); } i:nth-of-type(11):hover ~ x { transform: rotateY(-140deg); } i:nth-of-type(12):hover ~ x { transform: rotateY(-130deg); } i:nth-of-type(13):hover ~ x { transform: rotateY(-120deg); } x, y { position: absolute; top: -80rem;.........完整代码请登录后点击上方下载按钮下载查看
网友评论0