1 Star 0 Fork 4

小蚂蚁/timeline

forked from losting/timeline 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
index.html 1.15 KB
一键复制 编辑 原始数据 按行查看 历史
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="https://github.com/thelostword" />
<title>timeline</title>
</head>
<body>
<canvas id="Timeline"></canvas>
<div>
<p>current time:</p>
<strong id="TimeValue"></strong>
</div>
<script type="module">
import TimeLine, { format } from './dist/timeline.es.js';
const timeline = new TimeLine('#Timeline', {
fill: false,
zoom: 4,
});
timeline.draw({
currentTime: 1651827817000,
areas: [{
startTime: 1651827433000,
endTime: 1651829413000,
bgColor: '#f897aa'
},{
startTime: 1651829533000,
endTime: 1651832533000,
}],
});
const TimeValue = document.querySelector('#TimeValue');
TimeValue.textContent = format(timeline.getCurrentTime(), 'YYYY-MM-DD HH:mm:ss');
timeline.on('dragged', (timestamp) => {
TimeValue.textContent = format(timestamp, 'YYYY-MM-DD HH:mm:ss');
});
console.log(timeline);
</script>
</body>
</html>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
TypeScript
1
https://gitee.com/rencp_home/timeline.git
git@gitee.com:rencp_home/timeline.git
rencp_home
timeline
timeline
main

搜索帮助