example.html 1023 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <html>
  2. <!--
  3. SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
  4. SPDX-License-Identifier: MIT
  5. -->
  6. <head>
  7. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  8. <link href="https://fonts.googleapis.com/css?family=Quicksand:400,500,700" rel="stylesheet">
  9. <title>{{ .Title }} | Pion</title>
  10. <style>
  11. body {
  12. font-family: "Quicksand", sans-serif;
  13. font-weight: 400;
  14. margin: 4em 10%;
  15. }
  16. </style>
  17. <link rel="stylesheet" type="text/css" href="demo.css">
  18. </head>
  19. <body>
  20. <h1>{{ .Title }}</h1>
  21. <p><a href="/">< Home</a></p>
  22. <div>
  23. {{ template "demo.html" }}
  24. </div>
  25. </body>
  26. {{ if .JS }}
  27. <script src="demo.js"></script>
  28. {{ else }}
  29. <script src="/wasm_exec.js"></script>
  30. <script>
  31. const go = new Go();
  32. WebAssembly.instantiateStreaming(fetch("demo.wasm"), go.importObject).then((result) => {
  33. go.run(result.instance);
  34. });
  35. </script>
  36. {{ end }}
  37. </html>