Skip to content

Commit 0f1576e

Browse files
committed
feat: update SongCanvas styles and improve WASM instance cleanup
1 parent 6072e8c commit 0f1576e

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

web/public/nbs-player-rs.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/public/nbs_player_rs.wasm

-1.11 KB
Binary file not shown.

web/src/modules/song/components/client/SongCanvas.tsx

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ export const SongCanvas = ({ song }: { song: SongViewDtoType }) => {
4040

4141
const argumentsData = {
4242
font_id: 1, // Math.floor(Math.random() * 6),
43-
window_width: fullscreen_window_width,
44-
window_height: fullscreen_window_height,
43+
window_width: Number((fullscreen_window_width / 2).toFixed(0)),
44+
window_height: Number((fullscreen_window_height / 2).toFixed(0)),
4545
theme: {
46-
background_color: '#7EC850', // Grass-like green
47-
accent_color: '#FF6A00', // Orange (like Minecraft's iconic dirt/wood)
46+
background_color: '#18181B', // Grass-like green
47+
accent_color: '#002FA3', // Orange (like Minecraft's iconic dirt/wood)
4848
text_color: '#F0F0F0', // Light gray
49-
white_key_color: '#F5F5DC', // Beige (like sand)
50-
black_key_color: '#3B2F2F', // Dark brown (like wood)
49+
white_key_color: '#F0F0F0', // Beige (like sand)
50+
black_key_color: '#1A1A1A', // Dark brown (like wood)
5151
white_text_key_color: '#1A1A1A', // Dark gray
5252
black_text_key_color: '#F0F0F0', // Light gray
5353
},
@@ -125,10 +125,13 @@ export const SongCanvas = ({ song }: { song: SongViewDtoType }) => {
125125

126126
// Clear global Module reference
127127
if (window.Module) {
128-
if (window.Module.delete) window.Module.delete();
129128
delete window.Module;
130129
}
131130

131+
if (window.wasmInstance) {
132+
window.wasmInstance.delete();
133+
}
134+
132135
// Force garbage collection
133136
if (window.gc) window.gc();
134137
};
@@ -145,6 +148,11 @@ export const SongCanvas = ({ song }: { song: SongViewDtoType }) => {
145148
width={1280}
146149
height={720}
147150
className='w-full h-full rounded-xl'
151+
style={{
152+
// no filter
153+
filter: 'none',
154+
imageRendering: 'pixelated',
155+
}}
148156
/>
149157
</div>
150158
);

0 commit comments

Comments
 (0)