paper-full+lodash实现可自定义的canvas文字句子拆分分散效果代码
代码语言:html
所属分类:其他
代码描述:paper-full+lodash实现可自定义的canvas文字句子拆分分散效果代码
代码标签: paper-full lodash 自定义 canvas 文字 句子 拆分 分散
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
* {
margin: 0;
padding: 0;
border: none;
font-family: serif;
font-size: 20px;
line-height: 1rem;
box-sizing: border-box;
}
html,
body {
width: 100%;
}
body {
padding: 3rem 0;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
gap: 1rem;
background: #ddd;
}
canvas,
input,
.controls {
border-radius: 0.25rem;
}
div, label {
display: flex;
}
label {
font-family: sans-serif;
font-size: 0.9rem;
font-variant-caps: all-small-caps;
}
.input-text {
flex-direction: column;
gap: 0.2rem;
width: 512px;
color: #777;
}
.input-text input {
width: 100%;
padding: 0.5rem 0.8rem;
background: #fff;
box-shadow: 0 0.25rem 0.333rem #0002
}
.controls {
width: 512px;
padding: 1rem;
flex-direction: column;
gap: 1.5rem;
background: #fff;
box-shadow: 0 0.25rem 0.333rem #0002
}
.controls > div {
justify-content: space-between;
}
.controls label {
gap: 0.5rem;
}
.input-colors,
.input-colors > label,
.input-sizes > label {
align-items: center;
}
input[type=color] {
padding: 0 0.1rem;
border: 1px solid #0004;
}
</style>
</head>
<body>
<canvas width=512 height=512></canvas>
<label class=input-text>
input some text here
<input id=input type=text spellcheck=false value="The beautiful thing about learning is nobody can take it away from you."/>
</label>
<div class=controls>
<div class=input-sizes>
<label>
font size
<input id=fontsize type=range min=30 max=60 value=50 />
</label>
<label>
space size
<input id=spacesize type=range min=6 max=16 value=9 />
</label>
</div>
<div class=input-colors>
<label>
<input id=bgcolor type=color value=#0000ff />
bg color
</label>
<label>
<input id=paintcolor type=color value=#ffffff />
.........完整代码请登录后点击上方下载按钮下载查看
网友评论0