Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

Commit fa714f2

Browse files
committed
feat: add very simple demo as a smoketest for the build
1 parent 9c350d7 commit fa714f2

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

demo/simple.html

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<title>Literally Canvas Core - Simple Example</title>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width, user-scalable=no" />
7+
<style>
8+
body {
9+
background: #EEE;
10+
}
11+
.literally {
12+
width: 400px;
13+
height: 400px;
14+
position: relative;
15+
}
16+
.literally canvas {
17+
position: absolute;
18+
top: 0px;
19+
left: 0px;
20+
}
21+
</style>
22+
</head>
23+
24+
<body>
25+
<div class="literally"></div>
26+
<script src="../lib/index.js"></script>
27+
28+
<script type="text/javascript">
29+
const LiterallyCanvas = LC.default;
30+
const mainDiv = document.querySelector('.literally');
31+
const lc = new LiterallyCanvas(mainDiv, {
32+
...LiterallyCanvas.defaultOptions,
33+
defaultStrokeWidth: 10,
34+
backgroundColor: '#FFF',
35+
});
36+
window.demoLC = lc;
37+
</script>
38+
</body>
39+
</html>

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
"version": "0.5.2",
44
"description": "HTML5 drawing widget - core lib",
55
"main": "lib/index.js",
6+
"files": [
7+
"lib/*",
8+
"src/*"
9+
],
610
"scripts": {
711
"test": "echo \"Error: no test specified\" && exit 1",
812
"bundle": "gulp bundle",

0 commit comments

Comments
 (0)