js随机生成可交互的Truchet 图块代码
代码语言:html
所属分类:其他
代码描述:js随机生成可交互的Truchet 图块代码
代码标签: js 随机 生成 可 交互 Truchet 图块 代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> @import url(https://fonts.bunny.net/css?family=darker-grotesque:300,600,800); *{ box-sizing: border-box; } body{ background-color: black; padding: 0; margin: 0; min-height: 100svh; display: flex; align-items: center; place-content: center; font-family: 'Darker Grotesque', sans-serif; } .wrapper{ --clr: steelblue; position: relative; width: min(calc(100% - 1rem), 80vw); height: 25vw; display: grid; place-content: center; overflow: hidde } .wrapper > div{ position: absolute; inset: 0; width: 100%; height: 100%; display: grid; /*outline: 1px dashed white;*/ } .wrapper > div > span{ background: linear-gradient(45deg,var(--clr) 50%, #0000 50%, #0000 1px); aspect-ratio: 1; transition: transform 300ms ease-in-out; filter: drop-shadow(1px 1px 2px rgba(0 0 0 /0.5)); } h1{ color: white; font-size: clamp(1.2rem, 3.5vw - .2rem , 12rem); font-weight: 300; z-index: 10; margin: 0; padding: 0; text-transform: uppercase; /* -webkit-text-stroke: 3px hotpink;*/ position: absolute; bottom: 100%; right: calc(100% + 1px); line-height: 1; rotate: -90deg; transform-origin:bottom right; text-wrap: nowrap; } @media (max-width: 800px){ h1{ rotate: 0deg; left: 0; right: auto; } } </style> </head> <body translate="no"> &.........完整代码请登录后点击上方下载按钮下载查看
网友评论0