This repository was archived by the owner on Sep 22, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathwasm.astro
More file actions
91 lines (84 loc) · 2.32 KB
/
Copy pathwasm.astro
File metadata and controls
91 lines (84 loc) · 2.32 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
---
// Copyright © SixtyFPS GmbH <info@slint.dev>
// SPDX-License-Identifier: MIT
import Layout from "~/layouts/PageLayout.astro";
const metadata = {
title: "Slint Material 3 Gallery (Web Assembly version)",
};
---
<Layout metadata={metadata}>
<style>
* {
margin: 0;
padding: 0;
overflow: hidden;
}
.wasm-demo-body {
width: 100vw;
display: flex;
align-items: center;
justify-content: center;
overflow: visible;
}
.canvas-container {
position: relative;
width: 80vw;
max-width: 1000px;
aspect-ratio: 10 / 7;
margin: 2rem auto;
overflow: visible;
z-index: 0;
display: flex;
align-items: center;
justify-content: center;
}
.canvas-container canvas {
display: block;
width: 100%;
height: 100%;
background: black;
}
.canvas-container img {
position: absolute;
top: -5%;
left: -3.8%;
width: 107.4%;
height: 110%;
pointer-events: none;
z-index: 1;
}
@media (max-width: 600px), (pointer: coarse) and (hover: none) {
.canvas-container {
width: 100vw !important;
max-width: 100vw !important;
height: 100vh !important;
max-height: 100vh !important;
aspect-ratio: unset !important;
margin: 0 !important;
}
.canvas-container canvas {
width: 100vw !important;
height: 100vh !important;
}
.canvas-container img {
display: none !important;
}
.hide-on-mobile {
display: none !important;
}
}
</style>
<script type="module">
import init from "https://material.slint.dev/wasm/pkg/gallery_lib.js";
init();
</script>
<h1 class="hide-on-mobile font-bold font-heading text-4xl md:text-5xl leading-tighter tracking-tighter text-center mt-16 mb-8 intersect-once intersect-quarter motion-safe:md:opacity-0 motion-safe:md:intersect:animate-fade">
Slint Material 3 Gallery
</h1>
<div class="wasm-demo-body bg-page dark:bg-dark mb-12 intersect-once intersect-quarter motion-safe:md:opacity-0 motion-safe:md:intersect:animate-fade">
<div class="canvas-container">
<canvas id="canvas"></canvas>
<img src="https://material.slint.dev/wasm/frame-tablet.webp" alt="Tablet Frame" />
</div>
</div>
</Layout>