literyzjs-timeline/demo-test.html

83 lines
1.7 KiB
HTML

<!doctype html>
<html lang="en-GB">
<head>
<meta charset="UTF-8" />
<meta http-equiv="content-type" content="text/html" charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="" />
<meta name="keyword" content="" />
<!-- <script src="http://cdn.hiimray.co.uk/8206c600-707c-469e-8d49-a76ae35782af/bootstrap/5.3.0/dist/js/bootstrap.bundle.min.js"></script> -->
<!-- <link href="http://cdn.hiimray.co.uk/8206c600-707c-469e-8d49-a76ae35782af/bootstrap/5.3.0/dist/css/bootstrap.min.css" rel="stylesheet" /> -->
<link href="bbtimeline.css" rel="stylesheet" />
<script src="bbtimeline.js"></script>
<!-- <link href="bbtimeline.min.css" rel="stylesheet" /> -->
<!-- <script src="bbtimeline.min.js"></script> -->
<title></title>
</head>
<body>
<canvas id="myCanvas"></canvas>
<p>
<button onclick="Clear()">Clear</button>
<button onclick="LoadToday()">Load Today</button>
<button onclick="LoadNext()">Load Next Month</button>
</p>
<style>
body {
padding: 20px;
}
canvas {
border-style: solid;
border-width: 1px;
border-color: #000000;
width: 100%;
height: 300px;
padding: 0;
margin: 0;
}
</style>
<script>
var timeline1 = new BBTimeline("myCanvas");
timeline1.Load();
timeline1.AddEvent("2023-10-05", "title", "description", "link");
timeline1.AddEvent("2023-10-06", "title", "description", "link");
timeline1.AddEvent("2023-10-16", "title", "description", "link");
function Clear()
{
timeline1.Clear(true);
}
function LoadToday()
{
timeline1.Load(new Date());
}
function LoadNext()
{
let date = timeline1.StartDate;
date.setMonth(date.getMonth() + 1);
timeline1.Load(date);
}
</script>
</body>
</html>