-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(add) index.html for github pages WASM preview
- Loading branch information
1 parent
c435aed
commit f022e5a
Showing
1 changed file
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Document</title> | ||
</head> | ||
<body> | ||
<div id="center"> | ||
<h1> Tetris game made with Slint </h1> | ||
<canvas id="canvas"></canvas> | ||
<script type="module"> | ||
// import the generated file. | ||
import init from './pkg/tetris_slint.js'; | ||
|
||
document.getElementById("canvas").focus(); | ||
|
||
init(); | ||
</script> | ||
<footer> | ||
<a href="https://github.com/GaspardCulis/slint-tetris"> | ||
View Source Code on GitHub</a> | ||
</footer> | ||
</div> | ||
</body> | ||
<style> | ||
body { | ||
padding: 0px; | ||
margin: 0px; | ||
max-width: none; | ||
|
||
background-color: whitesmoke; | ||
} | ||
|
||
canvas { | ||
border-radius: 10px; | ||
box-shadow: 0px 0px 8px 8px rgba(0, 0, 0, 0.2); | ||
|
||
align-self: center; | ||
} | ||
|
||
#center { | ||
display: flex; | ||
justify-content: space-between; | ||
align-content: stretch; | ||
align-items: stretch; | ||
flex-direction: column; | ||
width: 100vw; | ||
height: 100vh; | ||
padding: 0px; | ||
margin: 0px; | ||
} | ||
|
||
h1 { | ||
text-align: center; | ||
} | ||
|
||
footer { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
|
||
padding: 2rem; | ||
|
||
background-color: black; | ||
} | ||
|
||
a { | ||
color: yellow; | ||
} | ||
|
||
</style> | ||
</html> |