Skip to content

Commit 021c800

Browse files
authored
Merge pull request #310 from WatWowMap/landing-page-adjustments
Homepage Adjustments
2 parents 317ac1a + 268dabe commit 021c800

File tree

6 files changed

+50
-12
lines changed

6 files changed

+50
-12
lines changed

package-lock.json

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

src/configs/config.example.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@
33
"port": 8080,
44
"title": "MapJS",
55
"headerTitle": "MapJS - NodeJS Map Replacement",
6-
"homePage": true,
76
"locale": "en",
87
"style": "dark",
98
"sessionSecret": "98ki^e72~!@#(85o3kXLI*#c9wu5l!Z",
9+
"homepage": {
10+
"enabled": false,
11+
"title": "Welcome to MapJS",
12+
"descriptionLine1": "The best place to find Pokemon, Raids, Quests, and more!",
13+
"descriptionLine2": "Please login or join our Discord for more info...",
14+
"discordInvite": "https://discord.gg/yourInvite"
15+
},
1016
"map": {
1117
"startLat": 0,
1218
"startLon": 0,
@@ -46,7 +52,6 @@
4652
},
4753
"discord": {
4854
"enabled": false,
49-
"invite": "https://discord.gg/invite_link",
5055
"logChannelId": "",
5156
"status": "Map Status: Online",
5257
"botToken": "",

src/configs/default.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@
2222
"url": "",
2323
"maxScouts": 15
2424
},
25+
"homepage": {
26+
"enabled": false,
27+
"title": "Welcome to MapJS",
28+
"descriptionLine1": "The best place to find Pokemon, Raids, Quests, and more!",
29+
"descriptionLine2": "Please login or join our Discord for more info...",
30+
"discordInvite": "https://discord.gg/yourInvite"
31+
},
2532
"map": {
2633
"startLat": 0,
2734
"startLon": 0,

src/routes/ui.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ if (config.discord.enabled) {
1717
});
1818

1919
router.get('/logout', (req, res) => {
20-
if (config.homePage) {
20+
if (config.homepage.enabled) {
2121
res.redirect('/home');
2222
} else {
2323
res.redirect('/login');
@@ -32,10 +32,13 @@ router.get(['/', '/index'], async (req, res) => {
3232
res.render('index', data);
3333
});
3434

35-
if (config.homePage) {
35+
if (config.homepage.enabled) {
3636
router.get('/home', (req, res) => {
3737
const data = {};
38-
data.discord_invite = config.discord.invite;
38+
data.discord_invite = config.homepage.discordInvite;
39+
data.map_title = config.homepage.title;
40+
data.description_1 = config.homepage.descriptionLine1;
41+
data.description_2 = config.homepage.descriptionLine2;
3942
res.render('home', data);
4043
});
4144
}

src/views/blocked.mustache

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,22 @@
2727
#transbox {
2828
background-color:rgba(255,255,255,0.8);
2929
padding:20px;
30+
border-radius: 20px;
3031
}
3132
3233
.title {
3334
text-align:center;
3435
font-size: 2em;
3536
color: #3C5FA3;
37+
font-weight: bold;
38+
font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
3639
}
3740
3841
.container {
3942
width: 90%;
4043
margin: 0 auto;
4144
padding: 30px;
45+
border-radius: 10px;
4246
}
4347
4448
.clearfix:after {
@@ -56,6 +60,8 @@
5660
margin-left: 10px;
5761
margin-bottom: 10px;
5862
white-space: pre-wrap;
63+
font-weight: bold;
64+
font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
5965
}
6066
6167
.make-center {
@@ -66,6 +72,7 @@
6672
.square_btn{
6773
display: inline-block;
6874
padding: 7px 20px;
75+
border: solid 3px black;
6976
border-radius: 25px;
7077
text-decoration: none;
7178
color: #FFF;
@@ -78,17 +85,22 @@
7885
background-image: -webkit-linear-gradient(45deg, #7289da 0%, #3659d8 100%);
7986
background-image: linear-gradient(45deg, #7289da 0%, #3659d8 100%);
8087
}
88+
89+
a {
90+
font-weight: bold;
91+
font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
92+
}
8193
</style>
8294
</head>
8395
<body>
8496
<div class="container clearfix background">
8597
<div id="transbox">
8698
<title>Access denied</title>
87-
<div class="title">Access denied!</div>
99+
<div class="title">Access denied!</div><br>
88100
<div class="description">{{username}} has been blocked for being a member of {{guild_name}}.
89101
Please join our discord for more info.</div>
90102
<div class="make-center">
91-
<a href="/login" class="square_btn">Login</a><a href="{{discord_invite}}" class="square_btn">Join Our Discord</a>
103+
<a href="/login" class="square_btn">Login</a>&nbsp;&nbsp;<a href="{{discord_invite}}" class="square_btn">Join Our Discord</a>
92104
</div>
93105
</div>
94106
</div>

src/views/home.mustache

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,22 @@
2727
#transbox {
2828
background-color:rgba(255,255,255,0.8);
2929
padding:20px;
30+
border-radius: 20px;
3031
}
3132
3233
.title {
3334
text-align:center;
3435
font-size: 2em;
3536
color: #3C5FA3;
37+
font-weight: bold;
38+
font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
3639
}
3740
3841
.container {
3942
width: 90%;
4043
margin: 0 auto;
4144
padding: 30px;
45+
border-radius: 10px;
4246
}
4347
4448
.clearfix:after {
@@ -56,6 +60,8 @@
5660
margin-left: 10px;
5761
margin-bottom: 10px;
5862
white-space: pre-wrap;
63+
font-weight: bold;
64+
font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
5965
}
6066
6167
.make-center {
@@ -66,6 +72,7 @@
6672
.square_btn{
6773
display: inline-block;
6874
padding: 7px 20px;
75+
border: solid 3px black;
6976
border-radius: 25px;
7077
text-decoration: none;
7178
color: #FFF;
@@ -78,17 +85,21 @@
7885
background-image: -webkit-linear-gradient(45deg, #7289da 0%, #3659d8 100%);
7986
background-image: linear-gradient(45deg, #7289da 0%, #3659d8 100%);
8087
}
88+
89+
a {
90+
font-weight: bold;
91+
font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
92+
}
8193
</style>
8294
</head>
8395
<body>
8496
<div class="container clearfix background">
8597
<div id="transbox">
8698
<title>Welcome</title>
87-
<div class="title">Welcome</div>
88-
<div class="description">The best place to find pokemon.</div>
89-
<div class="description">Please login or join discord for more info...</div>
99+
<div class="title">{{map_title}}</div><br>
100+
<div class="description">{{description_1}}<br><br>{{description_2}}</div>
90101
<div class="make-center">
91-
<a href="/login" class="square_btn">Login</a><a href="{{discord_invite}}" class="square_btn">Join Our Discord</a>
102+
<a href="/login" class="square_btn">Login</a>&nbsp;&nbsp;<a href="{{discord_invite}}" class="square_btn">Join Our Discord</a>
92103
</div>
93104
</div>
94105
</div>

0 commit comments

Comments
 (0)