<!-- Bootstrap 5 CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- Google Fonts - Roboto -->
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&display=swap" rel="stylesheet">
<!-- Ionicons -->
<script type="module" src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.esm.js"></script>
<script nomodule src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.js"></script>
<style>
body {
font-family: 'Roboto', sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
padding: 40px 20px;
}
.registration-container {
max-width: 500px;
width: 100%;
}
.registration-card {
background: white;
border-radius: 20px;
padding: 50px 40px;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
animation: fadeInUp 0.6s ease;
}
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(30px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.form-header {
text-align: center;
margin-bottom: 40px;
}
.form-icon {
width: 80px;
height: 80px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto 20px;
box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}
.form-icon ion-icon {
font-size: 40px;
color: white;
}
.form-header h2 {
font-weight: 700;
color: #333;
margin-bottom: 10px;
}
.form-header p {
color: #666;
font-size: 0.95rem;
}
/* Floating Label Styles */
.form-floating-custom {
position: relative;
margin-bottom: 25px;
}
.form-floating-custom input,
.form-floating-custom select,
.form-floating-custom textarea {
width: 100%;
padding: 18px 45px 18px 15px;
border: 2px solid #e0e0e0;
border-radius: 12px;
font-size: 1rem;
transition: all 0.3s ease;
background: white;
}
.form-floating-custom input:focus,
.form-floating-custom select:focus,
.form-floating-custom textarea:focus {
outline: none;
border-color: #667eea;
box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}
.form-floating-custom label {
position: absolute;
left: 15px;
top: 50%;
transform: translateY(-50%);
font-size: 1rem;
color: #999;
pointer-events: none;
transition: all 0.3s ease;
background: white;
padding: 0 5px;
}
.form-floating-custom textarea + label {
top: 20px;
transform: translateY(0);
}
.form-floating-custom input:focus + label,
.form-floating-custom input:not(:placeholder-shown) + label,
.form-floating-custom select:focus + label,
.form-floating-custom select:not([value=""]) + label,
.form-floating-custom textarea:focus + label,
.form-floating-custom textarea:not(:placeholder-shown) + label {
top: -1px;
font-size: 0.75rem;
color: #667eea;
font-weight: 500;
}
.input-icon {
position: absolute;
right: 15px;
top: 50%;
transform: translateY(-50%);
font-size: 20px;
color: #999;
transition: color 0.3s ease;
}
.form-floating-custom input:focus ~ .input-icon,
.form-floating-custom select:focus ~ .input-icon {
color: #667eea;
}
/* Password Toggle */
.password-toggle {
position: absolute;
right: 15px;
top: 50%;
transform: translateY(-50%);
cursor: pointer;
font-size: 20px;
color: #999;
transition: color 0.3s ease;
}
.password-toggle:hover {
color: #667eea;
}
/* Checkbox */
.form-check {
margin-bottom: 25px;
}
.form-check-input {
width: 20px;
height: 20px;
margin-top: 0;
cursor: pointer;
border: 2px solid #e0e0e0;
}
.form-check-input:checked {
background-color: #667eea;
border-color: #667eea;
}
.form-check-input:focus {
box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}
.form-check-label {
margin-left: 8px;
color: #666;
font-size: 0.95rem;
cursor: pointer;
}
.form-check-label a {
color: #667eea;
text-decoration: none;
font-weight: 500;
}
.form-check-label a:hover {
text-decoration: underline;
}
/* Submit Button */
.btn-submit {
width: 100%;
padding: 16px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
border: none;
border-radius: 12px;
font-weight: 600;
font-size: 1.1rem;
cursor: pointer;
transition: all 0.3s ease;
display: flex;
align-items: center;
justify-content: center;
gap: 10px;
}
.btn-submit:hover {
transform: translateY(-2px);
box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}
.btn-submit:active {
transform: translateY(0);
}
/* Divider */
.divider {
text-align: center;
margin: 30px 0;
position: relative;
}
.divider::before {
content: '';
position: absolute;
top: 50%;
left: 0;
right: 0;
height: 1px;
background: #e0e0e0;
}
.divider span {
background: white;
padding: 0 15px;
color: #999;
position: relative;
font-size: 0.9rem;
}
/* Social Buttons */
.social-login {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 15px;
}
.btn-social {
padding: 12px;
border: 2px solid #e0e0e0;
border-radius: 12px;
background: white;
cursor: pointer;
transition: all 0.3s ease;
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
font-weight: 500;
color: #333;
}
.btn-social:hover {
border-color: #667eea;
background: #f8f9ff;
}
.btn-social ion-icon {
font-size: 20px;
}
.btn-google ion-icon {
color: #ea4335;
}
.btn-facebook ion-icon {
color: #1877f2;
}
/* Login Link */
.login-link {
text-align: center;
margin-top: 25px;
color: #666;
font-size: 0.95rem;
}
.login-link a {
color: #667eea;
text-decoration: none;
font-weight: 600;
}
.login-link a:hover {
text-decoration: underline;
}
/* Responsive */
@media (max-width: 576px) {
.registration-card {
padding: 40px 30px;
}
.social-login {
grid-template-columns: 1fr;
}
}
</style>
<div class="registration-container">
<div class="registration-card">
<div class="form-header">
<div class="form-icon">
<ion-icon name="person-add"></ion-icon>
</div>
<h2>Create Account</h2>
<p>Join us today and get started</p>
</div>
<form id="registrationForm">
<!-- Full Name -->
<div class="form-floating-custom">
<input type="text" id="fullName" placeholder=" " required>
<label for="fullName">Full Name</label>
<ion-icon name="person-outline" class="input-icon"></ion-icon>
</div>
<!-- Email -->
<div class="form-floating-custom">
<input type="email" id="email" placeholder=" " required>
<label for="email">Email Address</label>
<ion-icon name="mail-outline" class="input-icon"></ion-icon>
</div>
<!-- Phone -->
<div class="form-floating-custom">
<input type="tel" id="phone" placeholder=" ">
<label for="phone">Phone Number (Optional)</label>
<ion-icon name="call-outline" class="input-icon"></ion-icon>
</div>
<!-- Password -->
<div class="form-floating-custom">
<input type="password" id="password" placeholder=" " required>
<label for="password">Password</label>
<ion-icon name="eye-outline" class="password-toggle" id="togglePassword"></ion-icon>
</div>
<!-- Confirm Password -->
<div class="form-floating-custom">
<input type="password" id="confirmPassword" placeholder=" " required>
<label for="confirmPassword">Confirm Password</label>
<ion-icon name="eye-outline" class="password-toggle" id="toggleConfirmPassword"></ion-icon>
</div>
<!-- Country -->
<div class="form-floating-custom">
<select id="country" required>
<option value=""></option>
<option value="us">United States</option>
<option value="uk">United Kingdom</option>
<option value="ca">Canada</option>
<option value="au">Australia</option>
<option value="pk">Pakistan</option>
<option value="in">India</option>
<option value="other">Other</option>
</select>
<label for="country">Country</label>
<ion-icon name="globe-outline" class="input-icon"></ion-icon>
</div>
<!-- Terms & Conditions -->
<div class="form-check">
<input class="form-check-input" type="checkbox" id="terms" required>
<label class="form-check-label" for="terms">
I agree to the <a href="#">Terms & Conditions</a>
</label>
</div>
<!-- Submit Button -->
<button type="submit" class="btn-submit">
Create Account
<ion-icon name="arrow-forward"></ion-icon>
</button>
</form>
<!-- Divider -->
<div class="divider">
<span>Or sign up with</span>
</div>
<!-- Social Login -->
<div class="social-login">
<button class="btn-social btn-google">
<ion-icon name="logo-google"></ion-icon>
Google
</button>
<button class="btn-social btn-facebook">
<ion-icon name="logo-facebook"></ion-icon>
Facebook
</button>
</div>
<!-- Login Link -->
<div class="login-link">
Already have an account? <a href="#">Sign In</a>
</div>
</div>
</div>
<!-- Bootstrap 5 JS Bundle -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<script>
// Password Toggle Functionality
const togglePassword = document.getElementById('togglePassword');
const password = document.getElementById('password');
togglePassword.addEventListener('click', function() {
const type = password.getAttribute('type') === 'password' ? 'text' : 'password';
password.setAttribute('type', type);
this.setAttribute('name', type === 'password' ? 'eye-outline' : 'eye-off-outline');
});
const toggleConfirmPassword = document.getElementById('toggleConfirmPassword');
const confirmPassword = document.getElementById('confirmPassword');
toggleConfirmPassword.addEventListener('click', function() {
const type = confirmPassword.getAttribute('type') === 'password' ? 'text' : 'password';
confirmPassword.setAttribute('type', type);
this.setAttribute('name', type === 'password' ? 'eye-outline' : 'eye-off-outline');
});
// Form Submission
document.getElementById('registrationForm').addEventListener('submit', function(e) {
e.preventDefault();
// Password validation
if (password.value !== confirmPassword.value) {
alert('Passwords do not match!');
return;
}
// Password strength check
if (password.value.length < 8) {
alert('Password must be at least 8 characters long!');
return;
}
// Collect form data
const formData = {
fullName: document.getElementById('fullName').value,
email: document.getElementById('email').value,
phone: document.getElementById('phone').value,
password: password.value,
country: document.getElementById('country').value,
terms: document.getElementById('terms').checked
};
console.log('Form submitted:', formData);
alert('Registration successful! Check console for details.');
// Reset form
this.reset();
});
</script>
No comments yet. Be the first!