forked from codervivek5/VigyBag
-
Notifications
You must be signed in to change notification settings - Fork 0
/
greet.html
90 lines (81 loc) · 2.24 KB
/
greet.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<!DOCTYPE html>
<html>
<head>
<title>Login Success</title>
<style>
html {
background-image: url("./img/pexels-tim-douglas-6567607.webp");
background-size: cover;
overflow: hidden;
}
body {
font-family: Arial, sans-serif;
display: flex;
flex-direction: column;
justify-content: center;
}
.container {
width: 500px;
margin: 100px auto;
padding: 20px;
background-color: #f9f9f9;
text-align: center;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
h1 {
color: #333;
margin-bottom: 20px;
}
p {
color: #666;
margin-bottom: 10px;
display: block;
}
.abtn {
display: inline-block;
padding: 10px 20px;
background-color: #4caf50;
color: #fff;
text-decoration: none;
border-radius: 5px;
margin-top: 20px;
}
.abtn:hover {
background-color: #a05145;
}
</style>
</head>
<body>
<div class="container">
<h1>Login Successful</h1>
<p>Welcome, <span id="username"></span>!</p>
<p>Start shopping by visiting our website .</p>
<button class="abtn" id="home">Homepage</button>
<button class="abtn" id="logout">Logout</button>
</div>
<script>
// Get the username from the query parameter
const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
const username = urlParams.get("username");
const logout = document.getElementById("logout");
const home = document.getElementById("home");
logout.addEventListener("click", function () {
window.location.href = "/";
});
home.addEventListener("click", function () {
window.location.href = `/?username=${encodeURIComponent(
username
)}`;
});
// Update the welcome message with the username
const usernameElement = document.getElementById("username");
usernameElement.textContent = username;
</script>
</body>
</html>