Skip to content
This repository has been archived by the owner on Nov 3, 2024. It is now read-only.

Commit

Permalink
feat: add splash themes to vite config
Browse files Browse the repository at this point in the history
  • Loading branch information
leia-uwu committed Oct 10, 2024
1 parent 4b667a8 commit 1cd12d2
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 4 deletions.
1 change: 0 additions & 1 deletion client/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ a:active {
}

#background {
background-image: url(/img/main_splash.png);
background-repeat: no-repeat;
background-size: cover;
bottom: 0;
Expand Down
11 changes: 9 additions & 2 deletions client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,16 @@
<link rel="icon" href="favicon.ico" type="image/x-icon">
<!-- Fonts -->
<link href="https://fonts.googleapis.com/css?family=Roboto+Condensed:400,700" rel="stylesheet">

<link href="css/app.css" rel="stylesheet">
<link href="css/game.css" rel="stylesheet">

<style type="text/css">
#background {
background-image: url(%VITE_BACKGROUND_IMG%);
}
</style>

</head>
<body>
<div id='preroll-wrapper'>
Expand Down Expand Up @@ -794,7 +801,7 @@ <h2 data-l10n='index-account'>Account</h2>
<div id='social-share-block-wrapper'>
<div id='social-share-block' class='menu-block'>
<div class='btn-social-wrapper'>
<!--
<!--
<a href='https://facebook.com/survev' target='_blank' class='btn-social btn-darken btn-facebook'></a>
<a href='https://twitter.com/survev' target='_blank' class='btn-social btn-darken btn-twitter'></a>
<a href='https://www.instagram.com/survev/' target='_blank' class='btn-social btn-darken btn-instagram'></a>
Expand Down
5 changes: 4 additions & 1 deletion client/src/soundDefs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ export interface ReverbDef {
echoDelay?: number;
echoLowPass?: number;
}

declare const MENU_MUSIC: string;

const Sounds: Record<string, Record<string, SoundDef>> = {
players: {
m9_01: {
Expand Down Expand Up @@ -1791,7 +1794,7 @@ const Sounds: Record<string, Record<string, SoundDef>> = {
},
music: {
menu_music: {
path: "audio/ambient/menu_music_01.mp3",
path: MENU_MUSIC,
volume: 1,
loadPriority: 2,
},
Expand Down
31 changes: 31 additions & 0 deletions client/vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,40 @@ import { version } from "../package.json";
import { Config } from "../server/src/config";
import { GIT_VERSION } from "../server/src/utils/gitRevision";

export const SplashThemes = {
main: {
MENU_MUSIC: "audio/ambient/menu_music_01.mp3",
SPLASH_BG: "/img/main_splash.png",
},
easter: {
MENU_MUSIC: "audio/ambient/menu_music_01.mp3",
SPLASH_BG: "/img/main_splash_easter.png",
},
halloween: {
MENU_MUSIC: "audio/ambient/menu_music_02.mp3",
SPLASH_BG: "/img/main_splash_halloween.png",
},
faction: {
MENU_MUSIC: "audio/ambient/menu_music_01.mp3",
SPLASH_BG: "/img/main_splash_0_7_0.png",
},
snow: {
MENU_MUSIC: "audio/ambient/menu_music_01.mp3",
SPLASH_BG: "/img/main_splash_0_6_10.png",
},
spring: {
MENU_MUSIC: "audio/ambient/menu_music_01.mp3",
SPLASH_BG: "/img/main_splash_7_3.png",
},
};

const selectedTheme = SplashThemes["faction"];

export default defineConfig(({ mode }) => {
process.env = {
...process.env,
VITE_GAME_VERSION: version,
VITE_BACKGROUND_IMG: selectedTheme.SPLASH_BG,
};

const regions = {
Expand Down Expand Up @@ -62,6 +92,7 @@ export default defineConfig(({ mode }) => {
https: data.https,
};
}),
MENU_MUSIC: JSON.stringify(selectedTheme.MENU_MUSIC),
},
plugins: [
mode !== "development"
Expand Down

0 comments on commit 1cd12d2

Please sign in to comment.