Created
October 22, 2018 08:08
-
-
Save Darksecond/788e9062a02f686c6fb185ac1c3a3d37 to your computer and use it in GitHub Desktop.
Proper HTML
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Game</title> | |
<link rel="stylesheet" href="style.css"> | |
</head> | |
<body> | |
<canvas class="flow" width="320" height="180"></canvas> | |
</body> | |
</html> |
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
:root { | |
--aspect-width: 16; | |
--aspect-height: 9; | |
} | |
body { | |
margin: 0; | |
padding: 0; | |
background-color: #111; | |
} | |
.flow { | |
width: 100vw; | |
height: 100vh; | |
position: absolute; | |
top: 50%; | |
left: 50%; | |
transform: translate(-50%, -50%); | |
max-width: calc(100vh*var(--aspect-width)/var(--aspect-height)); | |
max-height: calc(100vw*var(--aspect-height)/var(--aspect-width)); | |
} | |
canvas { | |
background-color: black; | |
image-rendering: pixelated; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment