) and make it cool design and repssoinze and type full codes
Certainly! Below is the updated index.php file incorporating the new modern design styles you provided. This version features a clean, responsive layout with enhanced button styles and a centered content area for a polished appearance.
php
<?php
session_start();
// Check if a user is already logged in
if (isset($_SESSION['admin_id'])) {
header("Location: admin_dashboard.php");
exit();
} elseif (isset($_SESSION['patient_id'])) {
header("Location: patient_dashboard.php");
exit();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Patient Health Record System</title>
<!-- Link to the external CSS file (optional) -->
<link rel="stylesheet" href="css/styles.css">
<style>
/* Custom CSS for modern design */
body {
background-color: #f8f9fa;
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
height: 100vh; /* Full viewport height */
display: flex;
justify-content: center; /* Center horizontally */
align-items: center; /* Center vertically */
}
.container {
background-color: #ffffff;
padding: 40px;
border-radius: 10px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
text-align: center;
max-width: 400px;
width: 90%;
}
.dashboard-header {
background-color: #4F3F02; /* Brown color */
color: #fff;
padding: 20px;
border-radius: 8px;
margin-bottom: 30px;
}
h1 {
font-size: 32px;
margin: 0;
}
p {
font-size: 18px;
margin-bottom: 30px;
color: #333;
}
.login-options a {
display: inline-block;
margin: 10px;
padding: 15px 30px;
border: 1px solid transparent;
border-radius: 5px;
text-decoration: none;
transition: all 0.3s ease;
font-size: 18px; /* Increased font size for better visibility */
cursor: pointer;
}
.btn-primary {
background-color: #D1C287; /* Light golden color */
color: #4F3F02; /* Brown color */
font-weight: bold;
}
.btn-primary:hover {
background-color: #4F3F02; /* Brown color */
color: #fff;
border: 1px solid #D1C287;
}
.btn-secondary {
background-color: #4F3F02; /* Brown color */
color: #fff;
font-weight: bold;
}
.btn-secondary:hover {
background-color: #D1C287; /* Light golden color */
color: #4F3F02; /* Brown color */
border: 1px solid #4F3F02;
}
/* Responsive Design */
@media (max-width: 768px) {
.container {
padding: 30px 20px;
}
h1 {
font-size: 28px;
}
p {
font-size: 16px;
}
.login-options a {
padding: 12px 25px;
font-size: 16px;
margin: 8px;
}
}
@media (max-width: 480px) {
h1 {
font-size: 24px;
}
p {
font-size: 14px;
}
.login-options a {
display: block;
width: 100%;
margin: 10px 0;
}
}
</style>
</head>
<body>
<div class="container">
<div class="dashboard-header">
<h1>Patient Health Record System</h1>
</div>
<p>Please select your login type:</p>
<div class="login-options">
<a href="admin_login.php" class="btn-primary">Admin Login</a>
<a href="patient_login.php" class="btn-secondary">Patient Login</a>
</div>
</div>
</body>
</html>
Explanation of Changes
Structure and Layout:
Container Div: Wrapped the main content inside a .container div to center it and provide padding, background color, and shadow for a card-like appearance.
Dashboard Header: The .dashboard-header div contains the main title with a brown background and white text for contrast.
Styling:
Body: Set to use a light gray background color (#f8f9fa) and configured to center the .container both vertically and horizontally.
Typography: Increased the font sizes for better visibility and adjusted margins for spacing.
Buttons:
Primary Button (.btn-primary): Light golden background with brown text, changing to brown background with white text on hover.
Secondary Button (.btn-secondary): Brown background with white text, changing to light golden background with brown text on hover.
Both buttons have smooth transition effects for hover states and are responsive to different screen sizes.
Responsiveness:
Media Queries: Added breakpoints for tablets (max-width: 768px) and mobile devices (max-width: 480px) to adjust padding, font sizes, and button layouts accordingly.
Mobile Layout: On very small screens, the login buttons stack vertically for better usability.
Accessibility and UX:
Cursor Pointer: Added cursor: pointer; to buttons to indicate they are clickable.
Transitions: Smooth transitions on hover states enhance the user experience by providing visual feedback.
Clean and Modern Design:
Shadow and Border Radius: Applied box-shadow and border-radius to elements to create a modern, clean look.
Color Scheme: Consistent use of brown and light golden colors aligns with the provided design, ensuring aesthetic coherence.
Additional Recommendations
External CSS File: While the new styles are embedded within the <style> tag for clarity, you might consider moving them to an external CSS file (css/styles.css) for better maintainability, especially if these styles are shared across multiple pages.
Font Enhancement: To further enhance the design, consider integrating Google Fonts or another web font service to use more modern typography.
Accessibility Considerations: Ensure sufficient color contrast for readability and consider adding aria labels or roles if necessary to enhance accessibility for users utilizing assistive technologies.
Performance Optimization: Optimize images and assets if you plan to add any in the future to maintain quick load times and a smooth user experience.
This updated index.php should provide a more modern, responsive, and visually appealing interface for your Patient Health Record System's landing page. Feel free to further customize the styles to better fit your specific design preferences or branding requirements.