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

Commit ad9626b

Browse files
Merge pull request #10 from literallycanvas/docs/simple-example
docs: ✏️ add some more functionality to the simple example
2 parents 4e3e39d + 728237d commit ad9626b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

demo/simple.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,28 @@
1212
width: 400px;
1313
height: 400px;
1414
position: relative;
15+
margin-bottom: 8px;
1516
}
1617
.literally canvas {
1718
position: absolute;
1819
top: 0px;
1920
left: 0px;
2021
}
22+
button { background-color: rgb(199, 199, 199); margin-bottom: 8px; }
2123
</style>
2224
</head>
2325

2426
<body>
2527
<div class="literally"></div>
28+
<button onclick="demoLC.setColor('primary', '#000000')">Black</button>
29+
<button onclick="demoLC.setColor('primary', '#ff0000')">Red</button>
30+
<button onclick="demoLC.setColor('primary', '#00ff00')">Green</button>
31+
<button onclick="demoLC.setColor('primary', '#0000ff')">Blue</button>
32+
<br>
33+
<button onclick="demoLC.trigger('setStrokeWidth', 10)">10px</button>
34+
<button onclick="demoLC.trigger('setStrokeWidth', 20)">20px</button>
35+
<button onclick="demoLC.trigger('setStrokeWidth', 30)">30px</button>
36+
2637
<script src="../dist/bundle.js"></script>
2738

2839
<script type="text/javascript">

0 commit comments

Comments
 (0)