brick-engine-js 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/docs/GAME_DEVELOPER_GUIDE.html +1 -1
- package/dist/docs/brick-engine-guide.html +1 -1
- package/dist/docs/getting-started.html +1 -1
- package/dist/docs/jsdoc_standard.html +1 -1
- package/dist/docs/publishing.html +1 -1
- package/dist/docs/reference/interfaces/modules/Session.html +1 -1
- package/dist/docs/reference/modules/GameMenu.html +1 -1
- package/dist/docs/reference/modules/GameSession.html +1 -1
- package/dist/docs/reference/modules/InitialStateSnapshot.html +1 -1
- package/dist/docs/reference/modules/SessionModal.html +1 -1
- package/dist/docs/testing_best_practices.html +1 -1
- package/package.json +7 -1
- package/.env.local.example +0 -2
- package/.github/workflows/publish.yml +0 -73
- package/.prettierignore +0 -2
- package/.prettierrc.json +0 -8
- package/eslint.config.mjs +0 -29
- package/public/CNAME +0 -1
- package/public/docs/GAME_DEVELOPER_GUIDE.html +0 -727
- package/public/docs/brick-engine-guide.html +0 -610
- package/public/docs/diagrams/lifecycle.mmd +0 -19
- package/public/docs/documentation_style_guide.html +0 -994
- package/public/docs/getting-started.html +0 -648
- package/public/docs/images/lifecycle.svg +0 -1
- package/public/docs/index.html +0 -593
- package/public/docs/jsdoc_standard.html +0 -656
- package/public/docs/publishing.html +0 -573
- package/public/docs/reference/enums/Color.html +0 -533
- package/public/docs/reference/enums/ControlEventType.html +0 -505
- package/public/docs/reference/enums/ControlKey.html +0 -529
- package/public/docs/reference/enums/FontAlignment.html +0 -545
- package/public/docs/reference/enums/FontSize.html +0 -517
- package/public/docs/reference/enums/Sound.html +0 -558
- package/public/docs/reference/enums/StateProperty.html +0 -525
- package/public/docs/reference/helpers/CellHelper.html +0 -520
- package/public/docs/reference/helpers/ControlInputHandlerHelper.html +0 -569
- package/public/docs/reference/helpers/CoordinateHelper.html +0 -703
- package/public/docs/reference/helpers/RelativeValuesHelper.html +0 -560
- package/public/docs/reference/interfaces/Debuggable.html +0 -501
- package/public/docs/reference/interfaces/GameModules.html +0 -544
- package/public/docs/reference/interfaces/Initializable.html +0 -495
- package/public/docs/reference/interfaces/RendererInitializable.html +0 -517
- package/public/docs/reference/interfaces/StateSyncable.html +0 -542
- package/public/docs/reference/interfaces/modules/Control.html +0 -648
- package/public/docs/reference/interfaces/modules/Grid.html +0 -1256
- package/public/docs/reference/interfaces/modules/Renderer.html +0 -522
- package/public/docs/reference/interfaces/modules/RendererComposite.html +0 -577
- package/public/docs/reference/interfaces/modules/Score.html +0 -669
- package/public/docs/reference/interfaces/modules/Session.html +0 -585
- package/public/docs/reference/interfaces/modules/State.html +0 -897
- package/public/docs/reference/interfaces/modules/Text.html +0 -668
- package/public/docs/reference/interfaces/modules/Time.html +0 -684
- package/public/docs/reference/modules/Debugger.html +0 -579
- package/public/docs/reference/modules/DisplayRenderer.html +0 -557
- package/public/docs/reference/modules/Game.html +0 -909
- package/public/docs/reference/modules/GameControl.html +0 -716
- package/public/docs/reference/modules/GameGrid.html +0 -1910
- package/public/docs/reference/modules/GameHudGrid.html +0 -508
- package/public/docs/reference/modules/GameMenu.html +0 -538
- package/public/docs/reference/modules/GameRenderer.html +0 -589
- package/public/docs/reference/modules/GameScore.html +0 -664
- package/public/docs/reference/modules/GameSession.html +0 -533
- package/public/docs/reference/modules/GameSound.html +0 -636
- package/public/docs/reference/modules/GameState.html +0 -922
- package/public/docs/reference/modules/GameText.html +0 -701
- package/public/docs/reference/modules/GameTime.html +0 -696
- package/public/docs/reference/modules/HudRenderer.html +0 -568
- package/public/docs/reference/modules/InitialStateSnapshot.html +0 -557
- package/public/docs/reference/modules/SessionModal.html +0 -520
- package/public/docs/reference/types/Axis.html +0 -505
- package/public/docs/reference/types/Cell.html +0 -514
- package/public/docs/reference/types/ControlCallback.html +0 -488
- package/public/docs/reference/types/Coordinate.html +0 -510
- package/public/docs/reference/types/GameEntry.html +0 -514
- package/public/docs/reference/types/GameEvent.html +0 -514
- package/public/docs/reference/types/Piece.html +0 -506
- package/public/docs/reference/types/RendererMetrics.html +0 -514
- package/public/docs/reference/types/Vector.html +0 -509
- package/public/docs/testing_best_practices.html +0 -770
- package/public/favicon.ico +0 -0
- package/public/fonts/digital-7.monoitalic.ttf +0 -0
- package/public/images/cell.svg +0 -32
- package/public/images/close.png +0 -0
- package/public/images/games.png +0 -0
- package/public/images/github.png +0 -0
- package/public/images/letter-a.png +0 -0
- package/public/images/letter-d.png +0 -0
- package/public/images/letter-j.png +0 -0
- package/public/images/letter-s.png +0 -0
- package/public/images/letter-w.png +0 -0
- package/public/images/meta-image.png +0 -0
- package/public/images/number-1.png +0 -0
- package/public/images/number-2.png +0 -0
- package/public/images/number-3.png +0 -0
- package/public/images/number-4.png +0 -0
- package/public/images/number-5.png +0 -0
- package/public/images/number-6.png +0 -0
- package/public/images/splash.gif +0 -0
- package/public/index.html +0 -15
- package/public/sounds/sound_00.wav +0 -0
- package/public/sounds/sound_01.wav +0 -0
- package/public/sounds/sound_02.wav +0 -0
- package/public/sounds/sound_03.wav +0 -0
- package/public/sounds/sound_04.wav +0 -0
- package/public/sounds/sound_05.wav +0 -0
- package/public/sounds/sound_06.wav +0 -0
- package/public/sounds/sound_07.wav +0 -0
- package/public/sounds/sound_08.wav +0 -0
- package/public/sounds/sound_09.wav +0 -0
- package/public/sounds/sound_10.wav +0 -0
- package/public/sounds/sound_11.wav +0 -0
- package/public/sounds/sound_12.wav +0 -0
- package/public/sounds/sound_13.wav +0 -0
- package/public/sounds/sound_14.wav +0 -0
- package/public/sounds/sound_15.wav +0 -0
- package/public/style/body.css +0 -86
- package/public/style/buttons.css +0 -233
- package/public/style/debugger.css +0 -117
- package/public/style/sessionModal.css +0 -155
- package/public/style/sourceCodeAndCommands.css +0 -74
- package/public/style/splash.css +0 -13
- package/public/style/theme.css +0 -137
- package/scripts/generate-diagrams.sh +0 -20
- package/scripts/generate-docs.js +0 -111
- package/src/client-game.d.ts +0 -1
- package/src/config/configs.test.ts +0 -20
- package/src/config/configs.ts +0 -197
- package/src/config/env.test.ts +0 -59
- package/src/config/env.ts +0 -7
- package/src/config/styles.ts +0 -5
- package/src/core/Game.test.ts +0 -167
- package/src/core/Game.ts +0 -307
- package/src/core/InitialStateSnapshot.test.ts +0 -51
- package/src/core/InitialStateSnapshot.ts +0 -46
- package/src/core/helpers/CellHelper.test.ts +0 -33
- package/src/core/helpers/CellHelper.ts +0 -21
- package/src/core/helpers/ControlInputHandlerHelper.test.ts +0 -116
- package/src/core/helpers/ControlInputHandlerHelper.ts +0 -68
- package/src/core/helpers/CoordinateHelper.test.ts +0 -113
- package/src/core/helpers/CoordinateHelper.ts +0 -82
- package/src/core/helpers/InterfaceIdentifierHelper.test.ts +0 -122
- package/src/core/helpers/InterfaceIdentifierHelper.ts +0 -43
- package/src/core/helpers/RelativeValuesHelper.test.ts +0 -47
- package/src/core/helpers/RelativeValuesHelper.ts +0 -29
- package/src/core/module/control/GameControl.test.ts +0 -82
- package/src/core/module/control/GameControl.ts +0 -142
- package/src/core/module/control/GameControlKeyBinding.test.ts +0 -59
- package/src/core/module/control/GameControlKeyBinding.ts +0 -92
- package/src/core/module/grid/GameGrid.test.ts +0 -83
- package/src/core/module/grid/GameGrid.ts +0 -610
- package/src/core/module/grid/GameHudGrid.test.ts +0 -22
- package/src/core/module/grid/GameHudGrid.ts +0 -40
- package/src/core/module/grid/engines/GridAnalysisEngine.test.ts +0 -157
- package/src/core/module/grid/engines/GridAnalysisEngine.ts +0 -124
- package/src/core/module/grid/engines/GridLineEngine.test.ts +0 -132
- package/src/core/module/grid/engines/GridLineEngine.ts +0 -165
- package/src/core/module/grid/engines/GridMovementEngine.test.ts +0 -125
- package/src/core/module/grid/engines/GridMovementEngine.ts +0 -113
- package/src/core/module/grid/engines/GridRegionEngine.test.ts +0 -136
- package/src/core/module/grid/engines/GridRegionEngine.ts +0 -52
- package/src/core/module/grid/engines/GridTransformEngine.test.ts +0 -98
- package/src/core/module/grid/engines/GridTransformEngine.ts +0 -70
- package/src/core/module/renderer/DisplayRenderer.test.ts +0 -86
- package/src/core/module/renderer/DisplayRenderer.ts +0 -152
- package/src/core/module/renderer/GameRenderer.test.ts +0 -103
- package/src/core/module/renderer/GameRenderer.ts +0 -144
- package/src/core/module/renderer/HudRenderer.test.ts +0 -108
- package/src/core/module/renderer/HudRenderer.ts +0 -203
- package/src/core/module/score/GameScore.test.ts +0 -71
- package/src/core/module/score/GameScore.ts +0 -188
- package/src/core/module/session/GameSession.test.ts +0 -176
- package/src/core/module/session/GameSession.ts +0 -103
- package/src/core/module/sound/GameSound.test.ts +0 -117
- package/src/core/module/sound/GameSound.ts +0 -229
- package/src/core/module/state/GameState.test.ts +0 -101
- package/src/core/module/state/GameState.ts +0 -339
- package/src/core/module/text/GameText.test.ts +0 -87
- package/src/core/module/text/GameText.ts +0 -150
- package/src/core/module/time/GameTime.test.ts +0 -86
- package/src/core/module/time/GameTime.ts +0 -144
- package/src/core/types/Interfaces.ts +0 -59
- package/src/core/types/Types.ts +0 -124
- package/src/core/types/enums.ts +0 -113
- package/src/core/types/modules.ts +0 -841
- package/src/index.test.ts +0 -15
- package/src/index.ts +0 -9
- package/src/main.test.ts +0 -137
- package/src/main.ts +0 -77
- package/src/menu/GameMenu.test.ts +0 -157
- package/src/menu/GameMenu.ts +0 -124
- package/src/menu/GameMenuSingleton.test.ts +0 -26
- package/src/menu/GameMenuSingleton.ts +0 -13
- package/src/menu/GameRepository.test.ts +0 -46
- package/src/menu/GameRepository.ts +0 -47
- package/src/menu/manager/GameManager.test.ts +0 -68
- package/src/menu/manager/GameManager.ts +0 -50
- package/src/types/global.d.ts +0 -8
- package/src/types/interfaces.ts +0 -5
- package/src/view/Debugger.test.ts +0 -152
- package/src/view/Debugger.ts +0 -124
- package/src/view/GameView.test.ts +0 -95
- package/src/view/GameView.ts +0 -244
- package/src/view/SessionModal.test.ts +0 -141
- package/src/view/SessionModal.ts +0 -73
- package/src/view/components/layout/ButtonLayout.test.ts +0 -28
- package/src/view/components/layout/ButtonLayout.ts +0 -63
- package/src/view/components/layout/ContainerLayout.test.ts +0 -48
- package/src/view/components/layout/ContainerLayout.ts +0 -50
- package/src/view/components/layout/FrameLayout.test.ts +0 -24
- package/src/view/components/layout/FrameLayout.ts +0 -25
- package/src/view/components/ui/BigButton.test.ts +0 -28
- package/src/view/components/ui/BigButton.ts +0 -31
- package/src/view/components/ui/Button.test.ts +0 -30
- package/src/view/components/ui/Button.ts +0 -30
- package/src/view/components/ui/Canvas.test.ts +0 -32
- package/src/view/components/ui/Canvas.ts +0 -34
- package/src/view/components/ui/SmallButton.test.ts +0 -48
- package/src/view/components/ui/SmallButton.ts +0 -32
- package/src/view/theme/applyColors.test.ts +0 -47
- package/src/view/theme/applyColors.ts +0 -38
- package/src/view/theme/dimensions.test.ts +0 -34
- package/src/view/theme/dimensions.ts +0 -53
- package/tsconfig.json +0 -16
- package/vitest.config.ts +0 -14
- package/webpack.config.js +0 -133
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
#modal-background {
|
|
2
|
-
position: absolute;
|
|
3
|
-
inset: 0;
|
|
4
|
-
background-color: rgba(0, 0, 0, 0.5);
|
|
5
|
-
z-index: 999;
|
|
6
|
-
display: flex;
|
|
7
|
-
justify-content: center;
|
|
8
|
-
align-items: center;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
#modal-background.hidden {
|
|
12
|
-
display: none;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
#session-modal {
|
|
16
|
-
width: 80%;
|
|
17
|
-
max-width: 500px;
|
|
18
|
-
height: 44%;
|
|
19
|
-
max-height: 360px;
|
|
20
|
-
min-width: 320px;
|
|
21
|
-
min-height: 280px;
|
|
22
|
-
position: relative;
|
|
23
|
-
overflow: hidden;
|
|
24
|
-
|
|
25
|
-
display: flex;
|
|
26
|
-
flex-direction: column;
|
|
27
|
-
align-items: center;
|
|
28
|
-
box-sizing: border-box;
|
|
29
|
-
padding: 1rem 0;
|
|
30
|
-
|
|
31
|
-
background-color: var(--main-color);
|
|
32
|
-
|
|
33
|
-
border-radius: var(--border-radius);
|
|
34
|
-
border: var(--border);
|
|
35
|
-
|
|
36
|
-
box-shadow:
|
|
37
|
-
calc(var(--width) * -0.03) calc(var(--width) * 0.03) var(--dispersion) black,
|
|
38
|
-
calc(var(--width) * -0.02) calc(var(--width) * 0.02) var(--dispersion) var(--color-shadow-reflexion) inset,
|
|
39
|
-
calc(var(--width) * 0.01) calc(var(--width) * -0.01) var(--dispersion) var(--color-shadow) inset;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
#session-modal-frame {
|
|
43
|
-
border: var(--border);
|
|
44
|
-
border-radius: var(--border-radius);
|
|
45
|
-
|
|
46
|
-
position: relative;
|
|
47
|
-
|
|
48
|
-
width: 90%;
|
|
49
|
-
flex: 1;
|
|
50
|
-
margin: 1rem 0;
|
|
51
|
-
min-height: 0;
|
|
52
|
-
|
|
53
|
-
display: flex;
|
|
54
|
-
justify-content: center;
|
|
55
|
-
align-items: center;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
#session-modal-frame > p {
|
|
59
|
-
position: absolute;
|
|
60
|
-
top: 0;
|
|
61
|
-
transform: translateY(-50%);
|
|
62
|
-
|
|
63
|
-
text-align: center;
|
|
64
|
-
|
|
65
|
-
font-family: 'retro-gamming';
|
|
66
|
-
font-weight: bold;
|
|
67
|
-
font-size: clamp(1rem, calc(var(--height) * 0.03), 1.4rem);
|
|
68
|
-
|
|
69
|
-
background-color: var(--main-color);
|
|
70
|
-
padding: 0 calc(var(--width) * 0.02);
|
|
71
|
-
|
|
72
|
-
text-shadow:
|
|
73
|
-
calc(var(--width) * -0.003) calc(var(--width) * 0.003) 0 var(--color-shadow),
|
|
74
|
-
calc(var(--width) * 0.002) calc(var(--width) * -0.002) 0 var(--color-shadow-reflexion);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
#session-modal-screen {
|
|
78
|
-
width: 90%;
|
|
79
|
-
height: 80%;
|
|
80
|
-
|
|
81
|
-
border: var(--border);
|
|
82
|
-
box-shadow:
|
|
83
|
-
calc(var(--width) * -0.01) calc(var(--width) * 0.01) var(--dispersion) var(--color-shadow),
|
|
84
|
-
calc(var(--width) * 0.01) calc(var(--width) * -0.01) var(--dispersion) var(--color-shadow-reflexion);
|
|
85
|
-
|
|
86
|
-
background-image: url('../images/cell.svg');
|
|
87
|
-
background-size: 3.7%;
|
|
88
|
-
background-repeat: repeat;
|
|
89
|
-
|
|
90
|
-
display: flex;
|
|
91
|
-
justify-content: center;
|
|
92
|
-
align-items: center;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
#session-modal-screen > p {
|
|
96
|
-
text-align: center;
|
|
97
|
-
|
|
98
|
-
font-family: 'retro-gamming';
|
|
99
|
-
font-size: 1.5rem;
|
|
100
|
-
|
|
101
|
-
padding: 0 calc(var(--width) * 0.02);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
#session-modal-screen > p > span {
|
|
105
|
-
font-size: 1.8rem;
|
|
106
|
-
padding: 0 calc(var(--width) * 0.02);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
#session-modal-buttons {
|
|
110
|
-
width: 100%;
|
|
111
|
-
padding-bottom: 0.5rem;
|
|
112
|
-
|
|
113
|
-
display: flex;
|
|
114
|
-
justify-content: center;
|
|
115
|
-
align-items: center;
|
|
116
|
-
|
|
117
|
-
gap: clamp(1rem, 5vw, 2.5rem);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
.session-modal-button:active {
|
|
121
|
-
box-shadow:
|
|
122
|
-
calc(var(--width) * -0.005) calc(var(--width) * 0.005) var(--dispersion) var(--color-shadow),
|
|
123
|
-
calc(var(--width) * -0.004) calc(var(--width) * 0.004) var(--dispersion) var(--button-color-reflexion) inset;
|
|
124
|
-
transform: translate(calc(var(--width) * -0.005), calc(var(--width) * 0.005));
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
.session-modal-button {
|
|
128
|
-
width: 35%;
|
|
129
|
-
max-width: 150px;
|
|
130
|
-
padding: 0.8rem 0;
|
|
131
|
-
|
|
132
|
-
border: var(--border);
|
|
133
|
-
border-radius: var(--border-radius);
|
|
134
|
-
|
|
135
|
-
background-color: var(--button-color);
|
|
136
|
-
box-shadow:
|
|
137
|
-
calc(var(--width) * -0.015) calc(var(--width) * 0.015) var(--dispersion) var(--color-shadow),
|
|
138
|
-
calc(var(--width) * -0.0175) calc(var(--width) * 0.0175) var(--dispersion) var(--button-color-reflexion) inset;
|
|
139
|
-
|
|
140
|
-
font-family: 'retro-gamming';
|
|
141
|
-
color: white;
|
|
142
|
-
text-align: center;
|
|
143
|
-
|
|
144
|
-
user-select: none;
|
|
145
|
-
|
|
146
|
-
font-size: 1rem;
|
|
147
|
-
|
|
148
|
-
text-shadow:
|
|
149
|
-
calc(var(--width) * -0.003) calc(var(--width) * 0.003) 0 var(--button-color-shadow),
|
|
150
|
-
calc(var(--width) * 0.002) calc(var(--width) * -0.002) 0 var(--button-color-reflexion);
|
|
151
|
-
|
|
152
|
-
transition:
|
|
153
|
-
transform var(--button-animation-duration),
|
|
154
|
-
box-shadow var(--button-animation-duration);
|
|
155
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
#source-code {
|
|
2
|
-
position: absolute;
|
|
3
|
-
top: 2%;
|
|
4
|
-
right: 2%;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
#controls {
|
|
8
|
-
position: absolute;
|
|
9
|
-
top: 2%;
|
|
10
|
-
left: 2%;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
#source-code,
|
|
14
|
-
#controls {
|
|
15
|
-
background-color: var(--main-color);
|
|
16
|
-
padding: 0.75rem;
|
|
17
|
-
border-radius: 1.5rem;
|
|
18
|
-
cursor: pointer;
|
|
19
|
-
box-sizing: content-box;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
#source-code > #source-code-button,
|
|
23
|
-
#controls > #controls-button {
|
|
24
|
-
display: flex;
|
|
25
|
-
justify-content: center;
|
|
26
|
-
align-items: center;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
#source-code > #source-code-button > img,
|
|
30
|
-
#controls > #controls-button > img {
|
|
31
|
-
width: 2.5rem;
|
|
32
|
-
filter: invert();
|
|
33
|
-
}
|
|
34
|
-
#source-code:hover,
|
|
35
|
-
#controls:hover {
|
|
36
|
-
background-color: var(--color-shadow-reflexion);
|
|
37
|
-
}
|
|
38
|
-
#source-code:active,
|
|
39
|
-
#controls:active {
|
|
40
|
-
filter: brightness(1.15);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
#source-code::after,
|
|
44
|
-
#controls::after {
|
|
45
|
-
font-family: 'retro-gamming';
|
|
46
|
-
padding: 0.5rem;
|
|
47
|
-
width: 6rem;
|
|
48
|
-
background-color: white;
|
|
49
|
-
text-align: center;
|
|
50
|
-
border-radius: 0.25rem;
|
|
51
|
-
border: 1px black solid;
|
|
52
|
-
box-shadow: 0.25rem 0.25rem black;
|
|
53
|
-
opacity: 0;
|
|
54
|
-
transition: 0.25s opacity;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
#source-code:hover::after,
|
|
58
|
-
#controls:hover::after {
|
|
59
|
-
opacity: 1;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
#source-code::after {
|
|
63
|
-
content: 'source code';
|
|
64
|
-
position: absolute;
|
|
65
|
-
top: 75px;
|
|
66
|
-
left: -65px;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
#controls::after {
|
|
70
|
-
content: 'Controls';
|
|
71
|
-
position: absolute;
|
|
72
|
-
top: 75px;
|
|
73
|
-
left: 15px;
|
|
74
|
-
}
|
package/public/style/splash.css
DELETED
package/public/style/theme.css
DELETED
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
@font-face {
|
|
2
|
-
font-family: retro-gamming;
|
|
3
|
-
src: url(./../fonts/digital-7.monoitalic.ttf);
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
* {
|
|
7
|
-
margin: 0;
|
|
8
|
-
padding: 0;
|
|
9
|
-
box-sizing: content-box;
|
|
10
|
-
user-select: none;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
body {
|
|
14
|
-
width: 100vw;
|
|
15
|
-
height: 100vh;
|
|
16
|
-
|
|
17
|
-
display: flex;
|
|
18
|
-
justify-content: center;
|
|
19
|
-
align-items: center;
|
|
20
|
-
|
|
21
|
-
background: rgb(0, 158, 247);
|
|
22
|
-
background: linear-gradient(300deg, rgb(48, 179, 255) 0%, rgba(0, 158, 247, 1) 100%);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
#version {
|
|
26
|
-
font-family: 'retro-gamming';
|
|
27
|
-
font-size: 1rem;
|
|
28
|
-
color: white;
|
|
29
|
-
position: absolute;
|
|
30
|
-
bottom: 1rem;
|
|
31
|
-
right: 1rem;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
@media only screen and (max-width: 600px) {
|
|
35
|
-
#source-code,
|
|
36
|
-
#controls {
|
|
37
|
-
display: none;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
body,
|
|
41
|
-
#container {
|
|
42
|
-
width: 100% !important;
|
|
43
|
-
height: 100vh !important;
|
|
44
|
-
/* height: 100dvh !important; */
|
|
45
|
-
border-radius: 0px !important;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
#frame > canvas {
|
|
49
|
-
width: 85% !important;
|
|
50
|
-
height: auto !important;
|
|
51
|
-
aspect-ratio: 9/10 !important;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
#frame {
|
|
55
|
-
width: 85% !important;
|
|
56
|
-
padding: 7.5%¨ !important;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
#small-button-container {
|
|
60
|
-
margin-top: 3.5%;
|
|
61
|
-
}
|
|
62
|
-
#direction-vertical-container,
|
|
63
|
-
#direction-horizontal-container {
|
|
64
|
-
gap: calc(var(--width) * 0.13);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
#large-button-container {
|
|
68
|
-
flex-shrink: 1.75;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.sm-btn {
|
|
72
|
-
width: var(--sm-button-size-mobile) !important;
|
|
73
|
-
height: var(--sm-button-size-mobile) !important;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.btn {
|
|
77
|
-
width: var(--button-size-mobile) !important;
|
|
78
|
-
height: var(--button-size-mobile) !important;
|
|
79
|
-
margin: var(--button-size-mobile-spacing) !important;
|
|
80
|
-
font-size: var(--button-size-mobile-font-size) !important;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.lg-btn {
|
|
84
|
-
width: var(--lg-button-size-mobile) !important;
|
|
85
|
-
height: var(--lg-button-size-mobile) !important;
|
|
86
|
-
font-size: var(--lg-button-size-mobile-font-size) !important;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.sm-btn-p {
|
|
90
|
-
font-size: var(--sm-button-size-mobile-font-size) !important;
|
|
91
|
-
line-height: var(--sm-button-size-mobile-line-height) !important;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
@media only screen and (max-width: 990px) {
|
|
96
|
-
#wasd {
|
|
97
|
-
width: 10.5rem !important;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.key {
|
|
101
|
-
width: 3rem !important;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.key-description {
|
|
105
|
-
font-size: 1.5rem !important;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.command {
|
|
109
|
-
gap: 0.5rem !important;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
@media only screen and (max-width: 815px) {
|
|
114
|
-
#controls-tutorial {
|
|
115
|
-
gap: 0rem;
|
|
116
|
-
flex-direction: column !important;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
@media only screen and (max-width: 750px) {
|
|
121
|
-
.key-description {
|
|
122
|
-
font-size: 1.2rem !important;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
@media only screen and (max-width: 650px) {
|
|
127
|
-
#wasd {
|
|
128
|
-
width: 9rem !important;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
.key {
|
|
132
|
-
width: 2.5rem !important;
|
|
133
|
-
}
|
|
134
|
-
.key-description {
|
|
135
|
-
font-size: 1rem !important;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
# Create output directory if it doesn't exist
|
|
4
|
-
mkdir -p docs/images
|
|
5
|
-
|
|
6
|
-
# Loop through all .mmd files in docs/diagrams
|
|
7
|
-
for file in docs/diagrams/*.mmd; do
|
|
8
|
-
# Check if file exists (in case of no matches)
|
|
9
|
-
[ -e "$file" ] || continue
|
|
10
|
-
|
|
11
|
-
# Extract filename without extension
|
|
12
|
-
filename=$(basename "$file" .mmd)
|
|
13
|
-
|
|
14
|
-
echo "Generating ${filename}.svg..."
|
|
15
|
-
|
|
16
|
-
# Run mermaid-cli to generate SVG
|
|
17
|
-
npx -y @mermaid-js/mermaid-cli -i "$file" -o "docs/images/${filename}.svg"
|
|
18
|
-
done
|
|
19
|
-
|
|
20
|
-
echo "All diagrams generated successfully."
|
package/scripts/generate-docs.js
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
const asciidoctor = require('asciidoctor')();
|
|
2
|
-
const fs = require('fs');
|
|
3
|
-
const path = require('path');
|
|
4
|
-
|
|
5
|
-
const DOCS_DIR = path.join(__dirname, '../docs');
|
|
6
|
-
const PUBLIC_DOCS_DIR = path.join(__dirname, '../public/docs');
|
|
7
|
-
const README_FILE = path.join(__dirname, '../README.adoc');
|
|
8
|
-
|
|
9
|
-
function getAllFiles(dirPath, arrayOfFiles) {
|
|
10
|
-
if (!fs.existsSync(dirPath)) return [];
|
|
11
|
-
|
|
12
|
-
const files = fs.readdirSync(dirPath);
|
|
13
|
-
arrayOfFiles = arrayOfFiles || [];
|
|
14
|
-
|
|
15
|
-
files.forEach(function (file) {
|
|
16
|
-
const fullPath = path.join(dirPath, file);
|
|
17
|
-
if (fs.statSync(fullPath).isDirectory()) {
|
|
18
|
-
arrayOfFiles = getAllFiles(fullPath, arrayOfFiles);
|
|
19
|
-
} else {
|
|
20
|
-
if (file.endsWith('.adoc')) {
|
|
21
|
-
arrayOfFiles.push(fullPath);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
return arrayOfFiles;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Copies a directory recursively.
|
|
31
|
-
*/
|
|
32
|
-
function copyDir(src, dest) {
|
|
33
|
-
if (!fs.existsSync(src)) return;
|
|
34
|
-
fs.mkdirSync(dest, { recursive: true });
|
|
35
|
-
const entries = fs.readdirSync(src, { withFileTypes: true });
|
|
36
|
-
|
|
37
|
-
for (let entry of entries) {
|
|
38
|
-
const srcPath = path.join(src, entry.name);
|
|
39
|
-
const destPath = path.join(dest, entry.name);
|
|
40
|
-
|
|
41
|
-
if (entry.isDirectory()) {
|
|
42
|
-
copyDir(srcPath, destPath);
|
|
43
|
-
} else {
|
|
44
|
-
fs.copyFileSync(srcPath, destPath);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// Ensure public/docs exists and is clean
|
|
50
|
-
if (fs.existsSync(PUBLIC_DOCS_DIR)) {
|
|
51
|
-
fs.rmSync(PUBLIC_DOCS_DIR, { recursive: true, force: true });
|
|
52
|
-
}
|
|
53
|
-
fs.mkdirSync(PUBLIC_DOCS_DIR, { recursive: true });
|
|
54
|
-
|
|
55
|
-
// 1. Convert README.adoc to index.html
|
|
56
|
-
if (fs.existsSync(README_FILE)) {
|
|
57
|
-
console.log(`Converting README.adoc -> index.html`);
|
|
58
|
-
const indexPath = path.join(PUBLIC_DOCS_DIR, 'index.html');
|
|
59
|
-
asciidoctor.convertFile(README_FILE, {
|
|
60
|
-
to_file: indexPath,
|
|
61
|
-
safe: 'safe',
|
|
62
|
-
makedirs: true,
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
// Fix links in index.html:
|
|
66
|
-
// - Replace 'href="docs/' with 'href="' (since index.html is in /public/docs)
|
|
67
|
-
// - Ensure .adoc links are changed to .html
|
|
68
|
-
let content = fs.readFileSync(indexPath, 'utf8');
|
|
69
|
-
content = content.replace(/href="docs\//g, 'href="');
|
|
70
|
-
content = content.replace(/\.adoc/g, '.html');
|
|
71
|
-
|
|
72
|
-
fs.writeFileSync(indexPath, content);
|
|
73
|
-
console.log('Fixed links in index.html');
|
|
74
|
-
} else {
|
|
75
|
-
console.warn('README.adoc not found at root.');
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
// 2. Convert files in docs/
|
|
79
|
-
if (fs.existsSync(DOCS_DIR)) {
|
|
80
|
-
const files = getAllFiles(DOCS_DIR).filter(f => !f.startsWith(path.join(DOCS_DIR, 'images')) && !f.startsWith(path.join(DOCS_DIR, 'diagrams')));
|
|
81
|
-
console.log(`Found ${files.length} .adoc files in docs/ to process.`);
|
|
82
|
-
|
|
83
|
-
files.forEach(file => {
|
|
84
|
-
const relativePath = path.relative(DOCS_DIR, file);
|
|
85
|
-
const destPath = path.join(PUBLIC_DOCS_DIR, relativePath.replace(/\.adoc$/, '.html'));
|
|
86
|
-
|
|
87
|
-
const destDir = path.dirname(destPath);
|
|
88
|
-
if (!fs.existsSync(destDir)) {
|
|
89
|
-
fs.mkdirSync(destDir, { recursive: true });
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
console.log(`Converting: ${relativePath} -> ${path.relative(process.cwd(), destPath)}`);
|
|
93
|
-
asciidoctor.convertFile(file, { to_file: destPath, safe: 'safe', makedirs: true });
|
|
94
|
-
|
|
95
|
-
// Fix internal links in reference files that might use docs/ prefix
|
|
96
|
-
let content = fs.readFileSync(destPath, 'utf8');
|
|
97
|
-
// If a file in reference/modules/ links to docs/reference/enums/
|
|
98
|
-
// Asciidoctor might have kept 'docs/reference/' if it wasn't a proper xref.
|
|
99
|
-
content = content.replace(/href="docs\//g, 'href="../../'); // Roughly 2 levels up
|
|
100
|
-
// Note: This is a bit naive but should solve the reported issue if it occurs in modules.
|
|
101
|
-
|
|
102
|
-
fs.writeFileSync(destPath, content);
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
// 3. Copy images and diagrams for full documentation support
|
|
107
|
-
console.log('Copying images and diagrams...');
|
|
108
|
-
copyDir(path.join(DOCS_DIR, 'images'), path.join(PUBLIC_DOCS_DIR, 'images'));
|
|
109
|
-
copyDir(path.join(DOCS_DIR, 'diagrams'), path.join(PUBLIC_DOCS_DIR, 'diagrams'));
|
|
110
|
-
|
|
111
|
-
console.log('Documentation generation complete.');
|
package/src/client-game.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
declare module '@client-game';
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import configs from './configs';
|
|
3
|
-
|
|
4
|
-
describe('configs', () => {
|
|
5
|
-
it('should export an object containing configuration values', () => {
|
|
6
|
-
// [ARRANGE & ACT]
|
|
7
|
-
const configSnapshot = configs;
|
|
8
|
-
|
|
9
|
-
// [ASSERT]
|
|
10
|
-
expect(configSnapshot).toBeDefined();
|
|
11
|
-
expect(configSnapshot.game).toBeDefined();
|
|
12
|
-
expect(configSnapshot.screenLayout).toBeDefined();
|
|
13
|
-
expect(configSnapshot.colors).toBeDefined();
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
it('should have read-only immutable structure based on as const declaration', () => {
|
|
17
|
-
// [ASSERT]
|
|
18
|
-
expect(configs.colors.background).toBe('rgb(172, 189, 173)');
|
|
19
|
-
});
|
|
20
|
-
});
|