index.html 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <title>@nengine/dev — walking skeleton</title>
  7. <style>
  8. html,
  9. body {
  10. margin: 0;
  11. height: 100%;
  12. background: #111;
  13. font-family: system-ui, sans-serif;
  14. }
  15. #app {
  16. display: flex;
  17. flex-direction: column;
  18. height: 100%;
  19. }
  20. #hud {
  21. display: flex;
  22. align-items: center;
  23. gap: 16px;
  24. padding: 10px 16px;
  25. background: #202020;
  26. color: #eee;
  27. font-size: 14px;
  28. flex-wrap: wrap;
  29. }
  30. #hud button {
  31. font: inherit;
  32. padding: 6px 14px;
  33. border: 1px solid #555;
  34. border-radius: 4px;
  35. background: #333;
  36. color: #eee;
  37. cursor: pointer;
  38. }
  39. #hud button:hover {
  40. background: #444;
  41. }
  42. #hud button.selected {
  43. background: #2e7d32;
  44. border-color: #66bb6a;
  45. }
  46. #stats-label {
  47. color: #b0bec5;
  48. }
  49. #feedback-label {
  50. min-width: 180px;
  51. }
  52. #seed-picker {
  53. display: flex;
  54. gap: 6px;
  55. align-items: center;
  56. }
  57. #seed-picker button {
  58. padding: 4px 10px;
  59. font-size: 12px;
  60. }
  61. #game {
  62. flex: 1;
  63. min-height: 0;
  64. position: relative;
  65. }
  66. #game canvas {
  67. display: block;
  68. }
  69. .panel {
  70. position: absolute;
  71. background: #263238;
  72. border: 1px solid #455a64;
  73. border-radius: 6px;
  74. color: #eceff1;
  75. padding: 14px 16px;
  76. font-size: 14px;
  77. max-width: 420px;
  78. z-index: 10;
  79. }
  80. #dialogue-panel {
  81. bottom: 90px;
  82. left: 50%;
  83. transform: translateX(-50%);
  84. }
  85. #dialogue-panel .dialogue-text {
  86. margin-bottom: 10px;
  87. line-height: 1.5;
  88. }
  89. #dialogue-panel button {
  90. display: block;
  91. margin: 6px 0;
  92. }
  93. #shop-panel {
  94. top: 80px;
  95. right: 16px;
  96. }
  97. #shop-panel h3 {
  98. margin: 0 0 8px;
  99. font-size: 14px;
  100. color: #ffd54f;
  101. }
  102. #shop-panel h4 {
  103. margin: 8px 0 4px;
  104. font-size: 12px;
  105. color: #90a4ae;
  106. }
  107. #shop-panel .row {
  108. display: flex;
  109. gap: 8px;
  110. align-items: center;
  111. margin: 4px 0;
  112. }
  113. #shop-panel .price {
  114. color: #ffd54f;
  115. }
  116. #shop-panel .owned {
  117. color: #90a4ae;
  118. }
  119. #shop-panel button {
  120. font: inherit;
  121. padding: 3px 10px;
  122. border: 1px solid #555;
  123. border-radius: 4px;
  124. background: #37474f;
  125. color: #eceff1;
  126. cursor: pointer;
  127. }
  128. #inventory-bar {
  129. display: flex;
  130. gap: 16px;
  131. align-items: center;
  132. padding: 6px 16px;
  133. background: #1a1a1a;
  134. color: #cfd8dc;
  135. font-size: 12px;
  136. flex-wrap: wrap;
  137. }
  138. #inventory-gold {
  139. color: #ffd54f;
  140. }
  141. #inventory-stamina {
  142. color: #a5d6a7;
  143. }
  144. #inventory-seed {
  145. color: #80cbc4;
  146. }
  147. .hidden {
  148. display: none;
  149. }
  150. </style>
  151. </head>
  152. <body>
  153. <div id="app">
  154. <div id="hud">
  155. <span id="time-label">booting…</span>
  156. <span id="stats-label"></span>
  157. <span id="feedback-label"></span>
  158. <div id="seed-picker" title="Selected seed for sowing (player.intent select-seed)"></div>
  159. <button id="tool-interact" type="button">Interact</button>
  160. <button id="tool-move" type="button">Move</button>
  161. <button id="advance-day" type="button">Advance day</button>
  162. </div>
  163. <div id="game">
  164. <div id="dialogue-panel" class="panel hidden">
  165. <div id="dialogue-text" class="dialogue-text"></div>
  166. <div id="dialogue-choices"></div>
  167. </div>
  168. <div id="shop-panel" class="panel hidden">
  169. <h3 id="shop-title"></h3>
  170. <h4>Shop sells (buy)</h4>
  171. <div id="shop-sells"></div>
  172. <h4>Shop buys (sell yours)</h4>
  173. <div id="shop-buys"></div>
  174. <button id="shop-close" type="button">Close</button>
  175. </div>
  176. </div>
  177. <div id="inventory-bar">
  178. <span id="inventory-items"></span>
  179. <span id="inventory-gold"></span>
  180. <span id="inventory-stamina"></span>
  181. <span id="inventory-seed"></span>
  182. </div>
  183. </div>
  184. <script type="module" src="/apps/dev/src/main.ts"></script>
  185. </body>
  186. </html>