div+Css实现图片分解碎片化动画效果代码
代码语言:html
所属分类:动画
代码描述:div+Css实现图片分解碎片化动画效果代码,使用了svg的mask-composit实现。
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> @font-face { src: url("//repo.bfw.wiki/bfwrepo/font/MetaVariableDemo-Set.woff2") format("woff2"); font-family: "Meta"; font-style: normal; font-weight: normal; } body { min-height: 100vh; margin: 0; display: grid; place-content: center; font-family: "Meta", system-ui; background-color: #1f2020; } svg { width: 0; height: 0; } .card { width: 80vw; min-height: 80vh; color: #ba0c2e; display: grid; place-content: center; box-sizing: border-box; position: relative; } .card:before { content: ""; position: absolute; inset: 1em; z-index: -1; background-color: #f9f6ef; background-image: url(//repo.bfw.wiki/bfwrepo/image/5d6539613d08b.png); background-size: cover; filter: url(#squiggly-0); } .card { --mask: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 150 150" preserveAspectRatio="none"><filter id="noise"><feTurbulence baseFrequency="0.05" seed="170"></feTurbulence><feColorMatrix type="hueRotate" values="80"></feColorMatrix><feColorMatrix type="matrix" values="0 1 0 0 0 0 0 0 1 0 0 0 1 0 0 1 1 0 1 0" /><feDisplacementMap scale="10" in="SourceGraphic" result="dip" /><feGaussianBlur in="dip" stdDeviation="5" result="blur"/><feturbulence basefrequency="0.02" numoctaves="3" result="noise" seed="1"></feturbulence>.........完整代码请登录后点击上方下载按钮下载查看
网友评论0