leanwebclub/structure-and-scale/dice-library-es-modules/index.html

25 lines
670 B
HTML

<!DOCTYPE html>
<html lang="en" data-bs-theme="dark">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/water.css@2/out/water.css">
<title>Dice Library - ES Modules</title>
</head>
<body>
<h1>Dice Library - ES Modules</h1>
<p>All of the magic here happens in the console.</p>
<script type="module">
// import some functions
import {d6, d20} from './script.js';
// roll some dice
let roll1 = d6();
let roll2 = d20();
console.log(roll1, roll2);
</script>
</body>
</html>