26个字母多边形图案效果
代码语言:html
所属分类:布局界面
代码描述:26个字母多边形图案效果
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> @import url('https://fonts.googleapis.com/css?family=Roboto+Slab:700&display=swap'); html { width: 100%; height: 100vh; display: flex; align-items: center; justify-content: center; } svg { filter: drop-shadow(-1px 6px 6px rgba(0,0,0,0.4)); } text { font-family: 'Roboto Slab', serif; text-transform: uppercase; font-size: 17em; font-weight: 700; } </style> </head> <body translate="no"> <svg width="300" height="300"> <defs> <clipPath id="letter"> <text x="50%" y="80%" text-anchor="middle"></text> </clipPath> </defs> <g clip-path="url(#letter)"> <polygon id="shape-0" points="0,0 0,300 300,300 300,0" /> <polygon id="shape-1" /> <polygon id="shape-2" /> </g> </svg> <script> const letters = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']; function randomizeLetter() { let randomLetter = letters[Math.floor(letters.length * Math.random())]; document.querySelector('#letter text').innerHTML = randomLetter; } function randomi.........完整代码请登录后点击上方下载按钮下载查看
网友评论0