-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
npm.html
58 lines (54 loc) · 1.68 KB
/
npm.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="/style.css">
</head>
<body>
<main>
<header>
<h1>DeVito Converter <small>(Browser version)</small></h1>
<p class="lead">Measure length in Danny DeVitos!</p>
<div>
Meters <input type="text" id="metersInput"> = <input type="text" id="devitosInput"> DeVitos
</div>
</header>
<section>
<h2>Use in Browser</h2>
<p>For use as a npm module see <a href="/npm.html">"NPM version"</a></p>
<h3>External file</h3>
<h4>index.html</h4>
<pre class="html">
<body>
<h1>Hello World! Danny DeVito is <span id="devitoHeight"></span> meters tall!</h1>
<script src="/path/to/devito.js"></script>
<script>
var converter = new DannyDeVito();
var span = document.getElementById(`devitoHeight`);
span.innerHtml = converter.toMeters(1, 0);
</script>
</body>
</pre>
<h3>Inline `<code><script></code>` tag</h3>
<h4>index.html</h4>
<pre class="html">
<body>
<h1>Hello World! Danny DeVito is <span id="devitoHeight"></span> meters tall!</h1>
<script src="/path/to/devito.js"></script>
<script src="/path/to/your/script.js"></script>
</body>
</pre>
<h4>script.js</h4>
<pre class="javascript">
var converter = new DannyDeVito();
var span = document.getElementById(`devitoHeight`);
span.innerHtml = converter.toMeters(1, 0);
</pre>
</section>
</main>
<script src="/dist/index.js"></script>
<script src="/npm.js" type="module"></script>
</body>
</html>