svg.js实现大理石纹理瓷砖效果代码

代码语言:html

所属分类:其他

代码描述:svg.js实现大理石纹理瓷砖效果代码

代码标签: svg.js 大理石 纹理 瓷砖

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开


<!DOCTYPE html>
<html lang="en" >

<head>

  <meta charset="UTF-8">
  

  
  
  
<style>
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at center, #878889, #2f353f);
}

.canvas {
  width: 75vmin;
  height: 75vmin;
  background: #f1f0ee;
}
</style>


</head>

<body>
  <svg class="canvas" viewBox="0 0 200 200">
  <defs>
    <filter id="shadow">
      <feOffset dx="0.5" dy="0.5" in="SourceAlpha" result="offset" />
      <feGaussianBlur stdDeviation="1" in="offset" result="blur" />
      <feComponentTransfer in="blur" result="componentTransfer">
        <feFuncA type="linear" slope="0.25" intercept="0" />
      </feComponentTransfer>
      <feBlend mode="normal" in="SourceGraphic" in2="componentTransfer" />
    </filter>
    <filter id="paper">
      <feTurbulence type="fractalNoise" baseFrequency="0.07" numOctaves="5" result="noise" stitch="noStitch" />
      <feDiffuseLighting in="noise" lighting-color="#f1f0ee" surfaceScale="3" result="diffuseLighting">
        <feDistantLight azimuth="45" elevation="40" />
      </feDiffuseLighting>
      <feComposite in="diffuseLighting" in2="SourceAlpha" operator="in" />
    </filter>
  </defs>
</svg>

<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/svg.3.0.js"></script>
  
      <script type="module">

import {
createVoronoiTessellation,
random,
map } from
".........完整代码请登录后点击上方下载按钮下载查看

网友评论0