26 Star 64 Fork 22

Gitee 极速下载/Zeu-js

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
dist
docs
bar-meter.html
configuration.html
digital-clock.html
doc-template.html
docs.css
docs.js
heartbeat.html
hex-grid.html
introduction.html
map.png
menu.js
message-queue.html
network-graph.html
round-fan.html
score-board.html
speed-circle.html
text-box.html
text-meter.html
volume-meter.html
vue.html
examples
src
.babelrc
.eslintrc
.gitignore
.travis.yml
LICENSE
README.md
package-lock.json
package.json
webpack.config.js
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/shzlw/zeu
克隆/下载
text-box.html 3.33 KB
一键复制 编辑 原始数据 按行查看 历史
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>Text Box</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<link rel="stylesheet" href="docs.css">
</head>
<body>
<div class="container-fluid">
<script src="menu.js"></script>
<div class="content p-3">
<div class="container-fluid">
<h2>Text Box</h2>
<hr>
<canvas id="text-box" width="200" height="100"></canvas>
<h5 class="mt-3">Html</h5>
<pre><code><!-- Default view dimension 200 x 100. Flexible view width. -->
<canvas id="text-box" width="200" height="100"></canvas></code></pre>
<h5>JavaScript</h5>
<pre><code>/* Options */
var options = {
// Text
text: {
// Font color.
fontColor: '#dc3547',
// Background color.
bgColor: '#000000',
// Text value.
value: 'ZEU'
},
// Border color at four corners.
borderColor: '#ffa500',
// Wave color.
waveColor: '#28a748',
// Background color. Use rgba() function to have the gradient effect.
bgColor: 'rgba(0, 0, 0, 0.01)'
}
/* Constructor */
var textBox = new zeu.TextBox('text-box', options);
/* Setter */
textBox.value = 'ZEU';
textBox.textColor = '#dc3547';
textBox.textBgColor = '#000000';
textBox.bgColor = 'rgba(0, 0, 0, 0.01)';
textBox.borderColor = '#ffa500';
textBox.waveColor = '#28a748';</code></pre>
<h4>More examples</h4>
<p>
Increase view width to 300. White border and change color based on the value.
</p>
<canvas id="text-box-2" width="300" height="100"></canvas>
</div>
</div>
</div>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.4.0/styles/github.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.4.0/highlight.min.js"></script>
<script src="docs.js"></script>
<script src="../dist/zeu.js"></script>
<script type="text/javascript">
/* Options */
var options = {
// Text
text: {
// Font color.
fontColor: '#dc3547',
// Background color.
bgColor: '#000000',
// Text value.
value: 'ZEU'
},
// Border color at four corners.
borderColor: '#ffa500',
// Wave color.
waveColor: '#28a748',
// Background color. Use rgba() function to have the gradient effect.
bgColor: 'rgba(0, 0, 0, 0.01)'
}
/* Constructor */
var textBox = new zeu.TextBox('text-box', options);
/* Setter */
textBox.value = 'ZEU';
textBox.textColor = '#dc3547';
textBox.textBgColor = '#000000';
textBox.bgColor = 'rgba(0, 0, 0, 0.01)';
textBox.borderColor = '#ffa500';
textBox.waveColor = '#28a748';
var textBox2 = new zeu.TextBox('text-box-2', {
viewWidth: 300,
text: {
fontColor: COLOR.white,
bgColor: COLOR.green,
value: '0'
},
borderColor: COLOR.white,
waveColor: COLOR.black,
bgColor: 'rgba(255, 255, 255, 0.02)'
});
setInterval(function() {
var value = getRandomInt(0, 100);
textBox2.value = value;
if (value <= 30) {
textBox2.textBgColor = COLOR.green;
textBox2.waveColor = COLOR.green;
} else if (value >= 60) {
textBox2.textBgColor = COLOR.red;
textBox2.waveColor = COLOR.white;
} else {
textBox2.textBgColor = COLOR.yellow;
textBox2.waveColor = COLOR.yellow;
}
}, 2000);
</script>
</body>
</html>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors/Zeu-js.git
git@gitee.com:mirrors/Zeu-js.git
mirrors
Zeu-js
Zeu-js
master

搜索帮助