-
Notifications
You must be signed in to change notification settings - Fork 0
/
create-profile.html
135 lines (126 loc) · 5.69 KB
/
create-profile.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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Create Profile - WeCoders</title>
<link rel="stylesheet" href="create-profile.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
</head>
<body>
<header>
<div class="navbar">
<div class="logo">WeCoders</div>
<nav>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="contest.html">Contests</a></li>
<li><a href="blogs.html">Blogs</a></li>
</ul>
</nav>
<a href="login.html"><button class="login-btn">Login</button></a>
</div>
</header>
<main>
<div class="create-profile-container">
<div class="create-btn-container">
<div class="profile-content-box">
<h1>Create Profile</h1>
<p>Fill out the details below to create your profile.</p>
<div class="profile-editor">
<h2>Profile Editor</h2>
<div class="input-group">
<input type="text" id="name" placeholder="Your Name">
<span class="error-message" id="nameError"></span>
</div>
<div class="input-group">
<input type="text" id="phone" placeholder="1234567890">
<span class="error-message" id="phoneError"></span>
</div>
<div class="input-group">
<textarea id="text" placeholder="Tell us about yourself"></textarea>
<span class="error-message" id="textError"></span>
</div>
</div>
<button id="createProfile" class="create-btn">Create Profile</button>
</div>
</div>
</div>
</main>
<!-- Footer Section -->
<footer>
<div class="footer-container">
<div class="footer-left">
<div class="footer-logo">
<img src="images/1-removebg-preview (1).png" alt="WeCoders Logo">
<p>WeCoders</p>
</div>
<p>Explore upcoming coding contests.</p>
</div>
<div class="footer-middle">
<h4>Competitions</h4>
<ul>
<li><a href="contest.html">Contests</a></li>
<li><a href="challenges.html">Challenges</a></li>
</ul>
<h4>Opportunities</h4>
<ul>
<li><a href="hackathon.html">Hackathons</a></li>
<li><a href="internships.html">Internships</a></li>
<li><a href="jobs.html">Jobs</a></li>
</ul>
</div>
<div class="footer-right">
<h4>Connect</h4>
<ul>
<li><a href="feedback.html">Feedback</a></li>
<li><a href="contact.html">Contact Us</a></li>
<li><a href="about.html">About WeCoders</a></li>
</ul>
<h4>Social</h4>
<div class="footer-social-icons">
<a href="https://www.linkedin.com/in/payal-sinha-b83126279/" target="_blank"><i class="fab fa-linkedin"></i></a>
<a href="https://github.com/payalsinha12" target="_blank"><i class="fab fa-github"></i></a>
<a href="discord://payalsinha01" target="_blank"><i class="fab fa-discord"></i></a>
<a href="https://www.instagram.com/paya.lsinha01/?next=%2F&hl=en" target="_blank"><i class="fab fa-instagram"></i></a>
</div>
</div>
</div>
<div class="footer-bottom">
<p>© 2024 WeCoders licensed.</p>
</div>
</footer>
<script>
document.getElementById('createProfile').addEventListener('click', function() {
// Clear previous error messages
document.getElementById('nameError').textContent = '';
document.getElementById('phoneError').textContent = '';
document.getElementById('textError').textContent = '';
// Get values
const name = document.getElementById('name').value.trim();
const phone = document.getElementById('phone').value.trim();
const text = document.getElementById('text').value.trim();
// Validate inputs
let valid = true;
if (name === '') {
document.getElementById('nameError').textContent = 'Name is required.';
valid = false;
}
if (phone === '' || !/^\d{10}$/.test(phone)) {
document.getElementById('phoneError').textContent = 'A valid phone number is required.';
valid = false;
}
if (text === '') {
document.getElementById('textError').textContent = 'Please provide information about yourself.';
valid = false;
}
// If valid, alert success (or perform actual submission logic)
if (valid) {
alert('Profile created successfully!');
window.location.href = 'index.html'; // Redirect to home page
// You can replace the above line with actual submission logic, e.g., AJAX request or form submission
}
});
</script>
</body>
</html>