-
Notifications
You must be signed in to change notification settings - Fork 0
/
dashboard.html.bak
176 lines (153 loc) · 5.51 KB
/
dashboard.html.bak
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Student Dashboard</title>
<link href="https://fonts.googleapis.com/css2?family=Inria+Serif:wght@400;700&display=swap" rel="stylesheet">
<style>
/* Add background image and style */
body {
margin: 0;
padding: 0;
background-image: url('plainbg.png');
background-size: cover;
background-position: center;
background-attachment: fixed;
background-repeat: no-repeat;
height: 100vh;
font-family: 'Inria Serif', serif;
color: #333;
display: flex;
flex-direction: column;
align-items: center;
}
.icon {
position: absolute;
top: 10px;
left: 10px;
}
.icon img {
height: 50px;
width: auto;
}
.header {
display: flex;
align-items: center;
padding: 20px;
margin-top: 10px;
background-color: rgba(255, 255, 255, 0.8);
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
border-radius: 10px;
width: 100%;
}
.header h1 {
flex: 1;
text-align: center;
margin: 0;
font-size: 36px;
color: black;
}
.logout-button {
padding: 10px 20px;
background-color: #007BFF;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s, transform 0.2s;
}
.logout-button:hover {
background-color: #0056b3;
transform: translateY(-2px);
}
.dashboard-container {
display: flex;
justify-content: space-around;
padding: 50px 20px;
flex-wrap: wrap;
width: 100%;
max-width: 1200px;
}
.dashboard-card {
border-radius: 15px;
width: 300px;
padding: 20px;
margin: 20px;
text-align: center;
transition: transform 0.3s, box-shadow 0.3s;
color: #fff;
position: relative;
display: block;
}
.card-courses { background-color: #007BFF; }
.card-profile { background-color: #FFC107; }
.dashboard-card img {
width: 80px;
height: auto;
margin-bottom: 15px;
}
.dashboard-card h2 {
margin: 0 0 10px;
font-size: 24px;
}
.dashboard-card p {
font-size: 16px;
}
.dashboard-card:hover {
transform: translateY(-5px);
box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}
</style>
</head>
<body>
<!-- React root element -->
<div id="root"></div>
<!-- Load React and ReactDOM from CDN -->
<script src="https://unpkg.com/react@17/umd/react.development.js" crossorigin></script>
<script src="https://unpkg.com/react-dom@17/umd/react-dom.development.js" crossorigin></script>
<!-- Load Babel to compile JSX -->
<script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
<script type="text/babel">
function getQueryParam(name) {
const urlParams = new URLSearchParams(window.location.search);
return urlParams.get(name);
}
const email = getQueryParam('email');
// React component for the dashboard
function Dashboard() {
return (
<div>
{/* Icon and Welcome Text */}
<div className="icon">
<img src="icon.png" alt="Logo representing skills" />
</div>
{/* Welcome Header Section */}
<div className="header">
<h1>Welcome to Your Dashboard</h1>
<button className="logout-button">Log Out</button>
</div>
{/* Dashboard Cards */}
<div className="dashboard-container">
{/* Courses Card */}
<a href={`encou.html?email=${encodeURIComponent(email)}`} className="dashboard-card card-courses">
<img src="course.png" alt="Courses Icon" />
<h2>My Courses</h2>
<p>View and manage your enrolled courses.</p>
</a>
{/* Profile Card with Redirect */}
<a href={`profile.html?email=${encodeURIComponent(email)}`} className="dashboard-card card-profile">
<img src="profile.png" alt="Profile Icon" />
<h2>My Profile</h2>
<p>Update your personal information and preferences.</p>
</a>
</div>
</div>
);
}
// Render the Dashboard component to the root element
ReactDOM.render(<Dashboard />, document.getElementById('root'));
</script>
</body>
</html>