css实现带凌镜光效图片幻灯片效果代码
代码语言:html
所属分类:幻灯片
代码描述:css实现带凌镜光效图片幻灯片效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> @charset "UTF-8"; @import url("https://fonts.googleapis.com/css2?family=Geist:wght@100..900&display=swap"); * { margin: 0; padding: 0; box-sizing: border-box; } *::before, *::after { box-sizing: border-box; } html, body { overscroll-behavior-x: none; overscroll-behavior-y: none; scroll-behavior: smooth; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } body { font-family: "Geist", sans-serif; font-size: clamp(20px, 5vw, 45px); position: relative; width: 100vw; height: 100vh; text-align: center; overflow: hidden; background-color: #555; color: PaleVioletRed; /* pre display用 */ background-image: url("//repo.bfw.wiki/bfwrepo/image/5d653d54ed035.png"); background-position: center bottom; background-size: cover; } @property --pos-x { syntax: "<length>"; inherits: true; initial-value: 0px; } @property --pos-y { syntax: "<length>"; inherits: true; initial-value: 0px; } @property --angle { syntax: "<angle>"; inherits: true; initial-value: 0deg; } #prism { position: absolute; top: 0; left: 0; width: 100vw; height: 100vh; mix-blend-mode: overlay; --size: 0.025; --opacity: 1; /* start value */ --pos-x-s: 0vw; --pos-y-s: 0vh; --angle-s: 0deg; /* end value */ --pos-x-e: 0vw; --pos-y-e: 0vh; --angle-e: 0deg; --scale: 1; --duration: 2s; --delay: 0s; } #prism > div { position: absolute; top: 0; left: 0; width: calc(((100vmin + 100vmax) / 2) * var(--size)); height: calc(((100vmin + 100vmax) / 2) * var(--size)); background-image: linear-gradient(to bottom in oklch decreasing hue, oklch(0.8 0.2 300deg/var(--opacity)) 24%, oklch(0.8 0.2 300deg/var(--opacity)), oklch(0.8 0.2 300deg/var(--opacity)), oklch(0.95 0.2 270deg/var(--opacity)), oklch(0.95 0.2 270deg/var(--opacity)), oklch(0.95 0.2 240deg/var(--opacity)), oklch(0.95 0.2 240deg/var(--opacity)), oklch(0.95 0.2 210deg/var(--opacity)), oklch(0.95 0.2 210deg/var(--opacity)), oklch(0.95 0.2 180deg/var(--opacity)), oklch(0.95 0.2 180deg/var(--opacity)), oklch(0.95 0.2 150deg/var(--opacity)), oklch(0.95 0.2 150deg/var(--opacity)), oklch(0.95 0.2 120deg/var(--opacity)), oklch(0.95 0.2 120deg/var(--opacity)), oklch(0.95 0.1 90deg/var(--opacity)), oklch(0.95 0.2 90deg/var(--opacity)), oklch(0.95 0.2 60deg/var(--opacity)), oklch(0.95 0.2 60deg/var(--opacity)), oklch(0.95 0.2 30deg/var(--opacity)), oklch(0.95 0.2 30deg/var(--opacity)), oklch(0.8 0.2 0deg/var(--opacity)), oklch(0.8 0.2 0deg/var(--opacity)), oklch(0.8 0.2 0deg/var(--opacity)) 78%); background-position: center; background-repeat: no-repeat; background-size: 100% 100%; -webkit-mask-image: radial-gradient(closest-side circle at center, white 30%, transparent); mask-image: radial-gradient(closest-side circle at center, white 30%, transparent); transform: skew(calc(var(--angle) / 2), var(--angle)) rotate(calc(var(--angle) * -2)) translate3d(var(--pos-x), var(--pos-y), 0) scale3d(var(--scale), var(--scale), 1); transform-origin: center top; -webkit-animation-name: anim; animation-name: anim; -webkit-animation-duration: var(--duration); animation-duration: var(--duration); -webkit-animation-delay: var(--delay); animation-delay: var(--delay); -webkit-animation-timing-function: ease-in-out; animation-timing-function: ease-in-out; -webkit-animation-direction: alternate; animation-direction: alternate; -webkit-animation-iteration-count: infinite; animation-iteration-count: infinite; filter: blur(1px); } #prism > div:nth-child(1) { --pos-x-s: 26.8vw; --pos-y-s: 70.4vh; --angle-s: 10.4deg; --pos-x-e: 32.3vw; --pos-y-e: 77.1vh; --angle-e: 27.5deg; --scale: 1.3; --duration: 10.8s; --delay: -9.09s; --opacity: 0.61; } #prism > div:nth-child(2) { --pos-x-s: 52.8vw; --pos-y-s: 25.6vh; --angle-s: -14deg; --pos-x-e: 55.6vw; --pos-y-e: 32.3vh; --angle-e: -27deg; --scale: 1.95; --duration: 5.3s; --delay: -15.99s; --opacity: 0.57; } #prism > div:nth-child(3) { --pos-x-s: 73.2vw; --pos-y-s: 1vh; --angle-s: 10.9deg; --pos-x-e: 77.9vw; --pos-y-e: 5.9vh; --angle-e: 14.5deg; --scale: 1.68; --duration: 16.4s; --delay: -15.81s; --opacity: 0.58; } #prism > div:nth-child(4) { --pos-x-s: 97.9vw; --pos-y-s: 70.5vh; --angle-s: -12deg; --pos-x-e: 104.6vw; --pos-y-e: 72.8vh; --angle-e: -16.7deg; --sc.........完整代码请登录后点击上方下载按钮下载查看
网友评论0