html
html
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Popular Courses</title>
<link
href="https://fonts.googleapis.com/css2?
family=Poppins:wght@500&family=Roboto:wght@400;700&display=swap"
rel="stylesheet"
/>
<link
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css2?
family=Poppins:wght@500&family=Roboto:wght@400;700&display=swap"
rel="stylesheet"
/>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
/* Body setup */
body {
font-family: 'Roboto', sans-serif;
min-height: 100vh;
display: flex;
flex-direction: column;
justify-content: space-between; /* This ensures space between header and footer */
align-items: center;
color: #fff;
overflow-y: auto; /* Enable scrolling */
padding: 20px 15px;
position: relative;
}
/* Header Container */
.header {
position: fixed;
top: 0px;
left: 0;
right: 0;
display: flex;
justify-content: flex-end; /* Align content to the right */
align-items: center;
gap: 20px;
padding: 10px 20px;
background: rgba(0, 0, 0, 0.8); /* Semi-transparent background */
z-index: 10;
}
.animate-btn {
padding: 1px 20px;
font-size: 18px;
color: #fff;
background: transparent;
border: 2px solid #ff6ec7;
border-radius: 50px;
cursor: pointer;
position: relative;
overflow: hidden;
transition: all 0.3s ease;
font-weight: 500;
letter-spacing: 1px;
text-transform: uppercase;
box-shadow: 0 5px 20px rgba(255, 110, 199, 0.4);
display: flex;
justify-content: center;
align-items: center;
}
.animate-btn:hover {
background: #ff6ec7;
color: #fff;
transform: scale(1.05);
box-shadow: 0 10px 30px rgba(255, 110, 199, 0.6), 0 0 20px rgba(255, 110, 199,
0.8);
}
.animate-btn:hover::before {
content: "";
position: absolute;
top: 50%;
left: 50%;
width: 300%;
height: 300%;
background: rgba(255, 110, 199, 0.15);
border-radius: 50%;
transform: translate(-50%, -50%) scale(0);
animation: ripple 0.8s ease-out forwards;
}
@keyframes ripple {
to {
transform: translate(-50%, -50%) scale(1);
opacity: 0;
}
}
.animate-btn:active {
transform: scale(0.98) translateY(3px);
box-shadow: 0 5px 20px rgba(255, 110, 199, 0.4);
}
.animate-btn:hover {
text-shadow: 0 0 25px rgba(255, 110, 199, 0.8), 0 0 50px rgba(255, 110, 199, 0.6);
}
.animate-btn {
animation: fadeIn 1s ease-out;
}
@keyframes fadeIn {
0% {
opacity: 0;
transform: translateY(10px);
}
100% {
opacity: 1;
transform: translateY(0);
}
}
/* Profile Logo */
.profile-logo {
width: 32px;
height: 28px;
background-color: #fff;
border-radius: 50%;
overflow: hidden;
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
}
.profile-logo img {
width: 100%;
height: 100%;
object-fit: cover;
}
.dropdown-menu ul {
list-style-type: none;
padding: 10px 0;
margin: 0;
}
.dropdown-menu li {
padding: 8px 20px;
cursor: pointer;
}
.dropdown-menu li:hover {
background-color: #ff6ec7;
}
/* Footer Section */
/* Footer Section */
footer {
width: 100%;
background-color: rgba(0, 0, 0, 0.8);
color: #fff;
text-align: center;
padding: 15px;
position: fixed;
bottom: 0;
display: flex;
justify-content: space-between;
align-items: center;
padding: 5px 20px;
height: 65px;
}
.social-buttons {
display: flex;
justify-content: center;
gap: 10px;
}
.social-button {
background-color: #222;
padding: 12px;
border-radius: 8px;
color: #fff;
font-size: 20px;
cursor: pointer;
transition: all 0.3s ease-in-out;
}
.social-button:hover {
background-color: #ff6ec7;
transform: translateY(-5px);
}
footer p {
color: #fff;
}
footer a {
color: #ff6ec7;
text-decoration: none;
}
/* Card Styles */
.card-container {
display: grid;
grid-template-columns: repeat(6, 1fr); /* 6 cards per row */
gap: 20px;
max-width: 1200px;
width: 100%;
padding-top: 50px; /* Give space for header */
padding-bottom: 120px; /* Give space for footer */
}
.card {
background-color: rgba(0, 0, 0, 0.5); /* Transparent black background */
padding: 15px;
border-radius: 12px;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
text-align: center;
transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card:hover {
transform: translateY(-8px);
box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}
.card i {
font-size: 40px;
color: #ff6ec7;
margin-bottom: 10px;
}
.card h3 {
font-size: 18px;
font-weight: 500;
margin-bottom: 8px;
}
.card p {
font-size: 13px;
color: #ddd; /* Lighter text for better contrast on dark background */
line-height: 1.5;
}
.card:hover h3 {
color: #ff6ec7;
}
@keyframes textGlow {
0% {
text-shadow: 0 0 10px rgba(255, 110, 199, 1), 0 0 20px rgba(255, 110, 199, 0.8);
}
50% {
text-shadow: 0 0 25px rgba(0, 198, 255, 1), 0 0 50px rgba(0, 198, 255, 0.8);
}
100% {
text-shadow: 0 0 10px rgba(255, 110, 199, 1), 0 0 20px rgba(255, 110, 199, 0.8);
}
}
.learning-section-container h1 {
font-size: 28px;
color: white;
}
.popular-courses-text {
font-size: 32px;
color: white;
margin-top: 10px;
}
/* Courses Container */
.categories-container {
display: flex;
justify-content: center;
gap: 30px;
margin-top: 10px;
position: relative;
padding-bottom: 20px;
margin-bottom: 20px;
margin-left: 25%; /* Optional: adjust space from the left */
margin-right: -60%; /* Optional: adjust space from the right */
}
.course-item {
font-size: 18px;
font-weight: 500;
text-transform: uppercase;
cursor: pointer;
color: #555;
padding-bottom: 10px;
transition: color 0.3s ease;
color:white;
width:190px
.course-item:hover {
color: #ff6ec7;
}
.course-card {
width: 250px;
padding: 20px;
background-color: rgba(0, 0, 0, 0.5);
border-radius: 15px;
color: #fff;
text-align: center;
font-size: 16px;
transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.course-card:hover {
transform: translateY(-5px);
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}
.course-title {
font-size: 18px;
font-weight: 600;
color: #ff6ec7;
margin-bottom: 10px;
}
.course-description {
font-size: 14px;
margin-bottom: 15px;
color: #fff;
line-height: 1.4;
}
.btn-read-more {
background-color: #ff6ec7;
color: white;
padding: 8px 15px;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 14px;
}
.btn-read-more:hover {
background-color: #e55ea3;
}
/* Modal Styles */
.modal {
display: none;
position: fixed;
z-index: 1;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
background-color: rgba(0, 0, 0, 0.4);
padding-top: 60px;
}
.modal-content {
background-color: #fff;
margin: 5% auto;
padding: 20px;
border-radius: 10px;
width: 80%;
max-width: 600px;
}
.modal-header {
font-size: 24px;
font-weight: bold;
color: #333;
}
.modal-body {
font-size: 16px;
color: #555;
margin-top: 10px;
}
.modal-footer {
margin-top: 20px;
text-align: right;
}
.btn-close {
background-color: #ff6ec7;
color: white;
padding: 10px 20px;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 16px;
}
.btn-close:hover {
background-color: #e55ea3;
}
.btn-subscribe {
background-color: #4CAF50;
color: white;
padding: 12px 25px;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 16px;
text-transform: uppercase;
}
.btn-subscribe:hover {
background-color: #45a049;
}
.modal-body ul {
list-style: none;
padding-left: 0;
font-size: 14px;
}
.modal-body li {
margin-bottom: 8px;
}
/* Popup styles */
.popup {
display: none; /* Hidden by default */
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.7); /* Semi-transparent background */
justify-content: center;
align-items: center;
z-index: 20;
}
.popup-content {
background-color: #fff;
padding: 20px;
border-radius: 5px;
width: 50%;
text-align: center;
color: #333;
position: relative; /* For positioning the close button */
}
.popup h2 {
margin-bottom: 20px;
}
.popup .close-btn {
position: absolute;
top: 10px;
right: 10px;
font-size: 24px;
cursor: pointer;
color: #333; /* Ensure it's visible */
}
.popup .close-btn:hover {
color: #ff6ec7;
}
</style>
</head>
<body>
<!-- Header Container with Profile Logo and Buttons -->
<div class="header">
<div class="button-container">
<button class="animate-btn" onclick="window.location.href = '#';">
Subscriptions
</button>
<button class="animate-btn" onclick="window.location.href = '#';">
Live Sessions
</button>
<button
class="animate-btn"
onclick="window.location.href = 'index.html';"
>
Back
</button>
</div>
<div class="learning-section-container">
<!-- Start Learning Heading -->
<h1>Start Learning</h1>
<div class="popular-courses-text">Popular Courses</div>
<div class="course-card">
<div class="course-title">API Testing</div>
<div class="course-description">
This course covers the essential concepts of API testing...
</div>
<button
class="btn-read-more"
onclick="showCourseDetails('api-testing')"
>
Read More
</button>
</div>
<div class="course-card">
<div class="course-title">Test Cases & Reporting</div>
<div class="course-description">
Learn how to design effective test cases...
</div>
<button
class="btn-read-more"
onclick="showCourseDetails('test-cases')"
>
Read More
</button>
</div>
<div class="course-card">
<div class="course-title">Basics of Automation</div>
<div class="course-description">
Get introduced to the world of test automation...
</div>
<button
class="btn-read-more"
onclick="showCourseDetails('automation')"
>
Read More
</button>
</div>
</div>
</div>
<script>
// Global variable to hold course fee
let courseFee = 0;
// Loop through the selected category and create the course cards
categories[category].forEach(course => {
const card = document.createElement('div');
card.classList.add('course-card');
card.style = "border: 1px solid #ccc; padding: 20px; margin: 10px; width: 200px;";
card.innerHTML = `
<div class="course-title">${course.title}</div>
<div class="course-description">${course.description}</div>
<button class="btn-read-more" onclick="showCourseDetails('${course.id}')">Read
More</button>
`;
cardsContainer.appendChild(card);
});
}
// Show modal
modal.style.display = "block";
}
// Close modal
function closeModal() {
document.getElementById("courseModal").style.display = "none";
}
</script>
<script type="module">
// Import Firebase SDK
import { initializeApp } from "https://www.gstatic.com/firebasejs/9.6.0/firebase-
app.js";
import { getAuth, onAuthStateChanged, signOut } from
"https://www.gstatic.com/firebasejs/9.6.0/firebase-auth.js";
import { getFirestore, doc, getDoc } from
"https://www.gstatic.com/firebasejs/9.6.0/firebase-firestore.js";
// Firebase configuration
const firebaseConfig = {
apiKey: "AIzaSyDxQJaEO2Ymbi6Tm5dMU3ua63xZcXSsrmQ",
authDomain: "appium-automation-8c6d1.firebaseapp.com",
projectId: "appium-automation-8c6d1",
storageBucket: "appium-automation-8c6d1.firebasestorage.app",
messagingSenderId: "935809559227",
appId: "1:935809559227:web:1880b574e3ff0ecad1579e",
measurementId: "G-J4CT0HJGDY"
};
// Initialize Firebase
const app = initializeApp(firebaseConfig);
const auth = getAuth(app);
const db = getFirestore(app);
// Listen for authentication state changes (when page loads, check if the user is
logged in)
onAuthStateChanged(auth, async (user) => {
if (user) {
// User is signed in, fetch user data from Firestore
const userDocRef = doc(db, "users", user.uid);
const userDoc = await getDoc(userDocRef);
if (userDoc.exists()) {
const userData = userDoc.data();
const userName = `${userData.firstName} ${userData.lastName}`; // Combine firstName
and lastName
profileIcon.addEventListener('click', () => {
// Toggle visibility of the dropdown menu
dropdownMenu.style.display = dropdownMenu.style.display === 'block' ? 'none' :
'block';
});
// Close the dropdown menu if the user clicks outside of the profile icon or the
dropdown menu
document.addEventListener('click', (event) => {
// Check if the click was outside of the profile icon or dropdown menu
if (!profileIcon.contains(event.target) && !dropdownMenu.contains(event.target)) {
// Close the dropdown menu
dropdownMenu.style.display = 'none';
}
});
// View Profile functionality
const viewProfileBtn = document.getElementById('viewProfileBtn');
const profilePopup = document.getElementById('profilePopup');
const popupContent = document.getElementById('popupContent');
const closePopupBtn = document.getElementById('closePopupBtn');
if (userDoc.exists()) {
const userData = userDoc.data();
const userName = `${userData.firstName} ${userData.lastName}`;
const userEmail = userData.email;
const userMobile = userData.mobile;
// Close the popup when the user clicks the close button
closePopupBtn.addEventListener('click', () => {
profilePopup.style.display = 'none'; // Hide the popup
});
// Logout functionality
const logoutBtn = document.getElementById('logoutBtn');
logoutBtn.addEventListener('click', () => {
signOut(auth).then(() => {
console.log("User logged out");
document.getElementById('profileName').textContent = 'Guest';
dropdownMenu.style.display = 'none'; // Close the dropdown after logging out
window.location.href = 'index.html'; // Redirect to index.html after logout
}).catch((error) => {
console.error("Error logging out:", error);
});
});
</script>
</body>
</html>