Skip to content

Commit

Permalink
Working web examples are here!
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkauzh committed Jan 5, 2025
1 parent a06b46c commit 2e41806
Show file tree
Hide file tree
Showing 9 changed files with 625 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ nav:
- 🌱 Beginner:
- 🚀 Getting Started: "tutorials/beginner/new-project.md"
- 🎨 Rendering: "tutorials/beginner/rendering.md"
- Examples:
- 🏠 Home: "examples/index.md"
- 📚 Shapes: "examples/1/index.html"
- 📚 Images: "examples/2/index.html"
- 📚 Combined: "examples/3/index.html"

- Roadmap:
- 📅 Upcoming: "roadmap/index.md"
- 🛣️ V1: "roadmap/v1.md"
Expand Down
17 changes: 17 additions & 0 deletions website/examples/1/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Go WASM App</title>
<script src="../wasm_exec.js"></script>
</head>
<body>
<script>
const go = new Go();
WebAssembly.instantiateStreaming(fetch("main.wasm"), go.importObject).then((result) => {
go.run(result.instance);
});
</script>
</body>
</html>
Binary file added website/examples/1/main.wasm
Binary file not shown.
17 changes: 17 additions & 0 deletions website/examples/2/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Go WASM App</title>
<script src="../wasm_exec.js"></script>
</head>
<body>
<script>
const go = new Go();
WebAssembly.instantiateStreaming(fetch("main.wasm"), go.importObject).then((result) => {
go.run(result.instance);
});
</script>
</body>
</html>
Binary file added website/examples/2/main.wasm
Binary file not shown.
17 changes: 17 additions & 0 deletions website/examples/3/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Go WASM App</title>
<script src="../wasm_exec.js"></script>
</head>
<body>
<script>
const go = new Go();
WebAssembly.instantiateStreaming(fetch("main.wasm"), go.importObject).then((result) => {
go.run(result.instance);
});
</script>
</body>
</html>
Binary file added website/examples/3/main.wasm
Binary file not shown.
7 changes: 7 additions & 0 deletions website/examples/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# 🔍 Examples
Hey and welcome to the examples section! Here you can find a list of examples that demonstrate how to use Vuelto in different scenarios. All of these work in the web!

## 🧩 All examples
- [Shapes example](1/index.html)
- [Images example](2/index.html)
- [Combined example](3/index.html)
Loading

0 comments on commit 2e41806

Please # to comment.