Skip to content

Commit 74b5795

Browse files
committed
feat: Config option for enabling/disabling logo
Also adds relevant docs for new config options
1 parent 0ab7015 commit 74b5795

4 files changed

Lines changed: 13 additions & 5 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ The config can be found in `web/config.js`. This holds a plethora of configurati
4444
| BACKGROUND_IMAGES | An array of file names for images present in the `web/backgrounds` folder. | `BACKGROUND_IMAGES = ["1.jpg","2.jpg"]`
4545
| ENABLE_CURSOR | Whether to enable the cursor while in the loading screen | `ENABLE_CURSOR = false`
4646
| ENABLE_GFM_MARKDOWN | Whether to enable the `Github Flavored Markdown` spec for the parser | `ENABLE_GFM_MARKDOWN = true`
47+
| ENABLE_SERVER_LOGO | Whether to enable the server logo | `ENABLE_SERVER_LOGO = true`
48+
| SERVER_LOGO_POSITION | Where to place logo if enabled | `SERVER_LOGO_POSITION = 'top-left'`
4749

4850
## Customize
4951

web/assets/script.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {
33
BACKGROUND_CHANGE_INTERVAL,
44
BACKGROUND_IMAGES,
55
ENABLE_CURSOR,
6-
SERVER_LOGO_POSITION
6+
SERVER_LOGO_POSITION, ENABLE_SERVER_LOGO
77
} from '../config.js'
88

99
import { parsedMdTips } from "./markdown_parser.js";
@@ -124,7 +124,9 @@ const startBackgroundInterval = () => {
124124
/*
125125
Set Initial element class for server logo placement
126126
*/
127-
const setServerLogoPosition = () => {
127+
const setupServerLogo = () => {
128+
if (!ENABLE_SERVER_LOGO) return;
129+
logoEl.css('visibility', 'visible')
128130
logoEl.addClass(SERVER_LOGO_POSITION)
129131
}
130132

@@ -133,7 +135,7 @@ const setServerLogoPosition = () => {
133135
window.addEventListener('DOMContentLoaded', () => {
134136
startBackgroundInterval()
135137
setRandomTip()
136-
setServerLogoPosition()
138+
setupServerLogo()
137139
spinnerEl.fadeIn()
138140
})
139141

web/assets/styles.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ a[onclick] {
7474
}
7575

7676
#server-logo {
77-
background: url("./images/logo.png");
78-
background-repeat: no-repeat;
77+
background: url("./images/logo.png") no-repeat;
78+
visibility: hidden;
7979
background-size: contain;
8080
position: absolute;
8181
width: 15vh;

web/config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,9 @@ export const ENABLE_CURSOR = true
4949
// Enable github flavored markdown
5050
export const ENABLE_GFM_MARKDOWN = false
5151

52+
// Enable or disable the included server logo to change this
53+
// logo simply switch the `logo.png` file with the image of your choice
54+
export const ENABLE_SERVER_LOGO = true
55+
5256
// Define server logo placement ['top-left', 'top-right', 'bottom-right', 'center']
5357
export const SERVER_LOGO_POSITION = 'center'

0 commit comments

Comments
 (0)