|
1 | 1 | <!DOCTYPE html> |
2 | 2 | <html> |
3 | 3 | <head> |
4 | | - <meta charset="utf-8"> |
| 4 | + <meta charset="utf-8" /> |
| 5 | + <meta name="viewport" content="width=device-width, initial-scale=1" /> |
| 6 | + <meta property="og:title" content="keymap-rs + WASM (Nyan Jump!)" /> |
| 7 | + <meta property="og:type" content="object" /> |
| 8 | + <meta property="og:url" content="https://rezigned.com/keymap-rs" /> |
| 9 | + <meta property="og:image" content="https://rezigned.github.io/keymap-rs/preview.png" /> |
5 | 10 | <title>keymap-rs + WASM (Nyan Jump!)</title> |
6 | | - <style> |
7 | | - @font-face { |
8 | | - font-family: 'PixelOperatorMonoRegular'; |
9 | | - src: url('/fonts/PixelOperatorMonoRegular.ttf') format('truetype'); |
10 | | - font-weight: normal; |
11 | | - font-style: normal; |
12 | | - } |
13 | | - body { |
14 | | - display: flex; |
15 | | - align-items: center; |
16 | | - justify-content: center; |
17 | | - flex-direction: column; |
18 | | - min-height: 100vh; |
19 | | - margin: 0; |
20 | | - padding-top: 1.5rem; |
21 | | - background-color: #f0f4f8; /* Soft light blue-gray */ |
22 | | - font-family: 'Silkscreen', cursive; /* Pixel font for everything */ |
23 | | - color: #334e68; /* Dark blue-gray text */ |
24 | | - } |
25 | | - body > * { |
26 | | - width: 600px; |
27 | | - margin: 0 0 2rem; |
28 | | - } |
29 | | - h1, h2 { |
30 | | - font-family: 'Press Start 2P', cursive; /* Pixel font for everything */ |
31 | | - text-align: center; |
32 | | - } |
33 | | - h1 { |
34 | | - color: #243b53; /* Darker blue-gray for title */ |
35 | | - } |
36 | | - h3 { |
37 | | - margin-bottom: 1.5rem; |
38 | | - } |
39 | | - h4 { |
40 | | - margin-bottom: 1.2rem; |
41 | | - } |
42 | | - ul { |
43 | | - line-height: 1.5em; |
44 | | - } |
45 | | - code, p { |
46 | | - font-family: 'Pixel Operator Mono', monospace; |
47 | | - font-family: 'Pixelon', monospace; |
48 | | - font-family: 'PixelOperatorMonoRegular', monospace; |
49 | | - } |
50 | | - .text, p { |
51 | | - color: #5a7184; /* Medium blue-gray */ |
52 | | - } |
53 | | - p { |
54 | | - font-size: 1.2em; |
55 | | - margin: 0 0 1em; |
56 | | - line-height: 1.3em; |
57 | | - } |
58 | | - p code { |
59 | | - color: #f01973; |
60 | | - } |
61 | | - code { |
62 | | - line-height: 1.2em; |
63 | | - } |
64 | | - .game-container { |
65 | | - position: relative; |
66 | | - width: 600px; |
67 | | - height: 300px; |
68 | | - border: 4px solid #9fb3c8; /* Muted blue-gray border */ |
69 | | - box-sizing: content-box; /* Include padding and border in the element's total width and height */ |
70 | | - } |
71 | | - canvas { |
72 | | - background-color: #0c0c1f; /* Dark blue night sky */ |
73 | | - image-rendering: pixelated; /* Ensure pixel art stays sharp */ |
74 | | - image-rendering: -moz-crisp-edges; |
75 | | - image-rendering: -webkit-crisp-edges; |
76 | | - display: block; /* Remove extra space below canvas */ |
77 | | - } |
78 | | - .socials a { |
79 | | - float: right; |
80 | | - margin-left: 0.5em; |
81 | | - } |
82 | | - #score { |
83 | | - margin-top: 1em; |
84 | | - font-size: 1.6em; |
85 | | - text-align: right; |
86 | | - } |
87 | | - #gameOverMessage { |
88 | | - position: absolute; |
89 | | - top: 33%; |
90 | | - left: 50%; |
91 | | - transform: translate(-50%, -50%); |
92 | | - font-size: 3.5em; |
93 | | - color: #ef4444; /* Modern red */ |
94 | | - text-shadow: 2px 2px 0px #dc2626; /* Slightly darker red shadow */ |
95 | | - letter-spacing: 3px; |
96 | | - text-transform: uppercase; |
97 | | - display: none; |
98 | | - z-index: 10; |
99 | | - white-space: nowrap; /* Prevent text wrapping */ |
100 | | - } |
101 | | - .game-container button { |
102 | | - padding: 10px 20px; |
103 | | - font-size: 1em; |
104 | | - cursor: pointer; |
105 | | - color: white; |
106 | | - border-radius: 4px; |
107 | | - transition: background-color 0.1s ease; |
108 | | - font-family: 'Press Start 2P', cursive; |
109 | | - position: absolute; |
110 | | - left: 50%; |
111 | | - transform: translate(-50%, -50%); |
112 | | - z-index: 10; |
113 | | - display: none; |
114 | | - } |
115 | | - #restartButton { |
116 | | - top: calc(50% + 20px); /* Position below game over message */ |
117 | | - border: 2px solid #059669; /* Darker green border */ |
118 | | - background-color: #10b981; /* Modern green */ |
119 | | - box-shadow: 2px 2px 0px #059669; |
120 | | - } |
121 | | - #restartButton:hover { |
122 | | - background-color: #059669; |
123 | | - } |
124 | | - #shareButton { |
125 | | - font-size: 0.7em; |
126 | | - top: calc(50% + 80px); |
127 | | - border: 2px solid #ddd; |
128 | | - background-color: #0E0E0E; |
129 | | - box-shadow: 2px 2px 0px #9b9b9b; |
130 | | - } |
131 | | - #shareButton:hover { |
132 | | - background-color: #282828; |
133 | | - } |
134 | | - .rainbow { |
135 | | - font-family: 'Press Start 2P', cursive; |
136 | | - animation: rainbowColors 4s linear infinite; |
137 | | - opacity: 1; |
138 | | - text-decoration: none; |
139 | | - } |
140 | | - @keyframes rainbowColors { |
141 | | - 0% { color: #ff33aa; } |
142 | | - 40% { color: #ff0000; } |
143 | | - 80% { color: #ff7f00; } |
144 | | - 100% { color: #ff33aa; } |
145 | | - } |
146 | | - </style> |
147 | | - <link href="https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap" rel="stylesheet"> |
148 | | - <link href="https://fonts.googleapis.com/css2?family=Silkscreen:wght@400;700&display=swap" rel="stylesheet"> |
| 11 | + |
| 12 | + <link data-trunk rel="css" href="/index.css" /> |
| 13 | + <link data-trunk rel="copy-dir" href="/public" /> |
| 14 | + |
149 | 15 | <link rel=" stylesheet" href=" https://unpkg.com/@highlightjs/[email protected]/styles/tomorrow-night-blue.min.css" > |
150 | 16 | </head> |
151 | 17 | <body> |
@@ -201,17 +67,11 @@ <h4>EXAMPLE: Key Override</h4> |
201 | 67 | <pre><code class="language-yaml"># Now both 'space' and the 'up' arrow can be used to jump |
202 | 68 | Jump = { keys = ["space", "up"], description = "Jump Jump!" } |
203 | 69 | </code></pre> |
| 70 | + <script src=" https://unpkg.com/@highlightjs/[email protected]/highlight.min.js" ></script> |
| 71 | + <script src=" https://unpkg.com/@highlightjs/[email protected]/languages/rust.min.js" ></script> |
204 | 72 | <script type="module"> |
205 | | - import init, { init_game, get_keymap_as_json } from './pkg/keymap_wasm.js'; |
206 | | - |
207 | | - init().then(() => { |
208 | | - init_game(); |
209 | | - }); |
210 | | - |
211 | 73 | // Initialize syntax highlighting |
212 | 74 | hljs.highlightAll(); |
213 | 75 | </script> |
214 | | - <script src=" https://unpkg.com/@highlightjs/[email protected]/highlight.min.js" ></script> |
215 | | - <script src=" https://unpkg.com/@highlightjs/[email protected]/languages/rust.min.js" ></script> |
216 | 76 | </body> |
217 | 77 | </html> |
0 commit comments