UNPKG

1.01 kBHTMLView Raw
1<html>
2<head>
3<script type="text/javascript" src="build/liveshot-min.js"></script>
4</head>
5<body>
6<canvas id="canvas" width="300" height="400"></canvas>
7<script>
8// create the card
9var card = new LiveShot.CardBuilder()
10 .setLane('1')
11 .setName('Martin V. Larsen')
12 .setClub('Rygge')
13 .setClassName('4')
14 .setCategory('A')
15 .setSeriesName('Ligg')
16 .addShotData(.1, 0, 'X.0')
17 .addShotData(-.1, 0, 'X.0')
18 .addShotData(0, .1, 'X.0')
19 .addShotData(0, -.1, 'X.0')
20 .addShotData(0, 0, '*.9')
21 .setSeriesSum('50')
22 .setTotalSum('150')
23 .setMarking(true)
24 .setGaugeSize(0.01599)
25 .setTargetID('NO_DFS_100M')
26 .getCard();
27
28// get a reference to the canvas element
29var canvas = document.getElementById('canvas');
30
31// render the card Megalink style in the canvas
32var renderer = new LiveShot.MegalinkCardRenderer()
33 .setContext(canvas.getContext('2d'))
34 .setRect({x: 0, y: 0, width: 300, height: 400})
35 .setCard(card)
36 .render();
37</script>
38</body>
39</html>