Skip to content

Commit 06e6124

Browse files
committed
feat(logo): add configurable logo name
1 parent 51e0f10 commit 06e6124

File tree

5 files changed

+11
-5
lines changed

5 files changed

+11
-5
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,10 @@ The config can be found in `web/config.js`. This holds a plethora of configurati
4646
| ENABLE_GFM_MARKDOWN | Whether to enable the `Github Flavored Markdown` spec for the parser | `ENABLE_GFM_MARKDOWN = true`
4747
| ENABLE_SERVER_LOGO | Whether to enable the server logo | `ENABLE_SERVER_LOGO = true`
4848
| SERVER_LOGO_POSITION | Where to place logo if enabled | `SERVER_LOGO_POSITION = 'top-left'`
49+
| SERVER_LOGO_FILE_NAME | The name of your logo file within "logo/" directory | `SERVER_LOGO_FILE_NAME = 'logo.png'`
4950
| MUSIC_ENABLED | Enable loading music | `MUSIC_ENABLED = true `
5051
| MUSIC_START_VOLUME | The volume for loading music (0 - 1.0) | `MUSIC_START_VOLUME = 0.5`
51-
| MUSIC_FILE_NAME | The name of the music file to play in the "music/" folder | `MUSIC_FILE_NAME = music.mp3`
52+
| MUSIC_FILE_NAME | The name of the music file to play in the "music/" folder | `MUSIC_FILE_NAME = 'music.mp3'`
5253

5354
## Customize
5455

web/assets/script.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
ENABLE_CURSOR,
66
SERVER_LOGO_POSITION,
77
ENABLE_SERVER_LOGO,
8-
MUSIC_ENABLED
8+
MUSIC_ENABLED, SERVER_LOGO_FILE_NAME
99
} from '../config.js'
1010

1111
import { parsedMdTips } from "./markdown_parser.js";
@@ -130,6 +130,9 @@ const startBackgroundInterval = () => {
130130
*/
131131
const setupServerLogo = () => {
132132
if (!ENABLE_SERVER_LOGO) return;
133+
const logoLocation = `./logo/${SERVER_LOGO_FILE_NAME}`
134+
logoEl.css('background', `url(${logoLocation})`)
135+
logoEl.css('background-size', 'contain')
133136
logoEl.css('visibility', 'visible')
134137
logoEl.addClass(SERVER_LOGO_POSITION)
135138
}

web/assets/styles.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,8 @@ a[onclick] {
7777
}
7878

7979
#server-logo {
80-
background: url("./images/logo.png") no-repeat;
8180
visibility: hidden;
82-
background-size: contain;
81+
background-repeat: no-repeat;
8382
position: absolute;
8483
width: 15vh;
8584
height: 15vh;

web/config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,7 @@ export const ENABLE_GFM_MARKDOWN = false
6464
export const ENABLE_SERVER_LOGO = true
6565

6666
// Define server logo placement ['top-left', 'top-right', 'bottom-right', 'center']
67-
export const SERVER_LOGO_POSITION = 'top-right'
67+
export const SERVER_LOGO_POSITION = 'center'
68+
69+
// The name of your logo file within "logo/" directory
70+
export const SERVER_LOGO_FILE_NAME = 'logo.png'

0 commit comments

Comments
 (0)