Skip to content

Commit

Permalink
Updated website look.
Browse files Browse the repository at this point in the history
  • Loading branch information
sahailee committed Dec 10, 2020
1 parent 773c922 commit df1dcaf
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 9 deletions.
22 changes: 21 additions & 1 deletion backend/functions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,26 @@ app.use(express.json())

let redirect_uri = REDIRECT_URI

app.get('/success', function(req, res) {
var html = `<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="alert">
<h2>Login Complete. Return to GTA 5.</h2>
<h3>You may close this tab.</h3>
</div>
<div class="container center">
<h1>GTA 5 Spotify Radio Mod</h1>
</div>
</body>
</html>`;
res.writeHead(200, {"Content-Type": "text/HTML"});
res.write(html);
res.end();
});

app.get('/login', function(req, res) {
let querystring = require('querystring')
Expand Down Expand Up @@ -44,7 +64,7 @@ app.get('/callback', function(req, res) {
request.post(authOptions, function(error, response, body) {
var access_token = body.access_token
let uri = FRONTEND_URI
res.redirect(uri + '?access_token=' + access_token)
res.redirect(uri + '/success?access_token=' + access_token)
})
})

Expand Down
14 changes: 6 additions & 8 deletions backend/public/index.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1>Return back to GTA 5.</h1>
<h2>You may close this tab.</h2>
<script>
const urlParams = new URLSearchParams(window.location.search);
const accessToken = urlParams.get("access_token");
</script>
<h2 id="token"></h2>
<div class="container center">
<h1>GTA 5 Spotify Radio Mod</h1>
<br/>
<a href="https://www.gta5-mods.com/scripts/spotify-radio-mod"><button class="btn success">Download</button></a>
</div>
</body>
</html>
46 changes: 46 additions & 0 deletions backend/public/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
html, body {margin: 0; height: 100%; background-color: #317901;}

/* The alert message box */
.alert {
padding: 15px;
background-color: white; /* Red */
color: black;
margin-bottom: 10px;
}
.container {
height: 100%;
}
.center {
margin: 0;
position: absolute;
top: 50%;
left: 50%;
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
h1 {
color: white;
text-align: center;
font-size: 100pt;
}
.btn {
border: 2px solid black;
background-color: white;
color: black;
padding: 14px 28px;
font-size: 30px;
cursor: pointer;
border-radius: 5px;
width: 100%;
}

/* Green */
.success {
border-color: #4CAF50;
color: green;
}

.success:hover {
background-color: #4CAF50;
color: white;
}

0 comments on commit df1dcaf

Please sign in to comment.