-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
388 lines (347 loc) · 14.6 KB
/
index.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
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>mybrand-shebelle</title>
<link rel="stylesheet" href="mybrand.css">
<link href='https://unpkg.com/boxicons@2.1.4/css/boxicons.min.css' rel='stylesheet'>
</head>
<body>
<section id="home">
<!-- landing page-->
<div class="header">
<h1>S...</h1>
<div class="menu-icon" onclick="toggleMenu()"><i class='bx bx-menu'></i></div>
<nav>
<a href="#home" onclick="hideMenu()">Home<span></spans></a>
<a href="#about"onclick="hideMenu()">About<span></span></a>
<a href="#portfolio"onclick="hideMenu()">Portfolio<span></span></a>
<a href="#blog"onclick="hideMenu()">Blog<span></span></a>
<a href="#contact"onclick="hideMenu()">Contact<span></span></a>
<a href="LOGIN.HTML"onclick="hideMenu()">Sign in<span></span></a>
</nav>
</div>
<div class="wordsContainer">
<h1>I'm MUSABE <span>Shebelle kelvin</span></h1>
<p>this is my portfolio website with some cool articles to try in one place<br>ENJOY!!
</p>
<a href="assets/cv.png" download="cv">DOWNLOAD CV</a>
<form>
<input type="email" id="email" name="email" placeholder="Your email.." onkeyup="validateEmail()">
<span id="emailError"></span>
<button onclick="return validateForm()">Subscribe</button>
</form>
<div class="images">
<img src="assets/shebz.png" class="me">
</div>
</div>
</section>
<section id="about" >
<div class="about">
<div class="heading">
<h1>About me</h1>
</div>
<div class="about-container">
<div class="about-content">
<h2>Crafting Digital Experiences with Passion and Precision </h2>
<p>
As a front-end teen developer, I blend creativity with technology to craft visually stunning and user-friendly websites and applications. With a passion for design and coding, I specialize in HTML, CSS, and JavaScript to bring concepts to life on the web.
</p>
<!-- <button class="about-btn">Read more</button> -->
<a href="about2.html">Read more</a>
</div>
<div class="about-image">
<img src="assets/skills.jpg" alt="">
</div>
</div>
</div>
</section>
<section id="portfolio">
<!-- portfolio page-->
<div class="portfolio-container">
<h2 class="portfolio-header">My Portfolio</h2>
<div class="portfolio-images">
<div class="portfolio-item">
<img src="assets/project1.png" alt="Project 1">
<p>2023 started freecodecamp studies</p>
</div>
<div class="portfolio-item">
<img src="assets/project2.png" alt="Project 2">
<p>2024 joined andela technical program</p>
</div>
<div class="portfolio-item">
<img src="assets/coding.jpg" alt="Project 3">
<p>made a polydrome project </p>
</div>
<div class="portfolio-item">
<img src="assets/roman-numerals.png" alt="Project 4">
<p>2023 made Roman Numeral Converter.</p>
</div>
<div class="portfolio-item">
<img src="assets/cypher.jpg" alt="Project 5">
<p>2023 made a caesar cypher</p>
</div>
<div class="portfolio-item">
<img src="assets/kids-hula-hooping-outside.jpg" alt="Project 5">
<p>2023 joined urugerero program</p>
</div>
<div class="portfolio-description">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi.</p>
</div>
<div class="footer">
<img src="assets/hire-me-high-resolution-logo.png" alt="hire me">
</div>
</div>
</section>
<section id="blog">
<!-- blog page-->
<div class="blog-container">
<a href="blog.html">ALL BLOGS>></a>
<h2 class="blog-header">BLOGS</h2>
<div class="blog-posts">
<!-- <div class="blog-post">
<img src="assets/hacker.png" alt="Blog Image 1" class="blog-image">
<h3 class="blog-title">hacker</h3>
<p class="blog-content">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus.</p>
<a href="single.html" class="read-more-link">Read More</a>
</div>
<div class="blog-post">
<img src="assets/soccer.png" alt="Blog Image 2" class="blog-image">
<h3 class="blog-title">soccer</h3>
<p class="blog-content">Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor.</p>
<a href="single.html" class="read-more-link">Read More</a>
</div>
<div class="blog-post">
<img src="assets/planes.png" alt="PLANES" class="blog-image">
<h3 class="blog-title">PLANES</h3>
<p class="blog-content">Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor.</p>
<a href="single.html" class="read-more-link">Read More</a>
</div>
<div class="blog-post">
<img src="assets/image 4.png" alt="food" class="blog-image">
<h3 class="blog-title">FOODS</h3>
<p class="blog-content">Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor.</p>
<a href="single.html" class="read-more-link">Read More</a>
</div> -->
</div>
<div class="all-rights-reserved">
All Rights Reserved 2024
</div>
</div>
</section>
<section id="contact">
<!-- contact page-->
<div class="contact-container">
<div class="contact-details">
<h3>CONTACT ME</h3>
<p>EMAIL:SHEBELLEKE@GMAIL.COM</p>
<p>PHONE:+250723289329</p>
<p>ADDRESS:kigali-kicukiro-kanombe-kabeza</p>
</div>
<form class="contact-form">
<input type="text" id="name" class="form-input" placeholder="Your Name..." onkeyup="namevalidate()">
<span id="nameError"></span>
<input type="email" id="email2"class="form-input" placeholder="email..." onkeyup="email2validate()">
<span id="email2Error"></span>
<textarea id="message" class="form-textarea" placeholder="Question or Querries" onkeyup="msgvalidate()"></textarea>
<span id="msgError"></span>
<button onclick="return validate2Form()"class="form-button">Send</button>
<span id="submitError"></span>
</form>
</div>
<footer>
<div class="icons">
<a href="" class="element"><img src="assets/fb.png" alt=""></a>
<a href="" class="element"><img src="assets/ig.png" alt=""></a>
<a href="" class="element"><img src="assets/LinkedIn.png" alt=""></a>
<a href="" class="element"><img src="assets/Pinterest.png" alt=""></a>
<a href="" class="element"><img src="assets/YouTube.png" alt=""></a>
<a href="" class="element"><img src="assets/TwitterX.png" alt=""></a>
<a href="" class="element"><img src="assets/Slack New.png" alt=""></a>
</div>
</footer>
</section>
<script>
// navigation bar
function toggleMenu() {
var nav = document.querySelector('nav');
nav.classList.toggle('active');
}
function hideMenu() {
var nav = document.querySelector('nav');
nav.classList.remove('active');
}
// validating the email on subscribe
function validateEmail() {
var email = document.getElementById('email').value;
var emailError = document.getElementById('emailError');
if (email.length == 0) {
emailError.innerHTML = "Email is required";
setTimeout(function(){ emailError.innerHTML = ''; }, 3000);
return false;
}
if (!email.match(/^[^\s@]+@[^\s@]+\.[^\s@]+$/)) {
emailError.innerHTML = 'Email Invalid';
setTimeout(function(){ emailError.innerHTML = ''; }, 3000);
return false;
}
emailError.innerHTML = "<i class='bx bxs-check-circle'></i>";
return true;
}
// subscribe email send function
function validateForm() {
if (validateEmail()) {
// Clear the input field after successful validation
document.getElementById('email').value = "";
return true;
} else {
return false;
}
}
// retrieving blogs from local storage
const blogs = JSON.parse(localStorage.getItem('blogs'));
// Function to create blog posts
function createBlogPost(blog) {
const blogPost = document.createElement('div');
blogPost.classList.add('blog-post');
const image = document.createElement('img');
image.src = blog.image;
image.alt = 'Blog Image';
image.classList.add('blog-image');
const title = document.createElement('h3');
title.textContent = blog.title;
title.classList.add('blog-title');
const content = document.createElement('p');
content.textContent = blog.content;
content.classList.add('blog-content');
// const readMoreLink = document.createElement('a');
// readMoreLink.href = 'single.html';
// readMoreLink.textContent = 'Read More';
// readMoreLink.classList.add('read-more-link');
blogPost.appendChild(image);
blogPost.appendChild(title);
blogPost.appendChild(content);
// blogPost.appendChild(readMoreLink);
return blogPost;
}
// Display blogs
const blogPostsContainer = document.querySelector('.blog-posts');
if (blogs) {
blogs.forEach(blog => {
const blogPost = createBlogPost(blog);
blogPostsContainer.appendChild(blogPost);
});
}
// validating the contact form
var nameError =document.getElementById('nameError');
var email2Error = document.getElementById('email2Error');
var msgError =document.getElementById('msgError');
var submitError = document.getElementById('submitError');
// validating name
function namevalidate(){
var name=document.getElementById('name').value;
if(name.length==0){
nameError.innerHTML='Name is required';
setTimeout(function(){ nameError.innerHTML = ''; }, 3000);
return false;
}
if(!name.match(/^[A-Za-z\s'-]+$/)){
nameError.innerHTML ='write full name';
setTimeout(function(){ nameError.innerHTML = ''; }, 3000);
return false;
}
nameError.innerHTML="<i class='bx bxs-check-circle' ></i>"
return true;
}
// validating emailof contact
function email2validate(){
var email2 = document.getElementById('email2').value;
if (email2.length == 0) {
email2Error.innerHTML = "Email is required";
setTimeout(function(){ email2Error.innerHTML = ''; }, 3000);
return false;
}
if (!email2.match(/^[^\s@]+@[^\s@]+\.[^\s@]+$/)) {
email2Error.innerHTML = 'Email Invalid';
setTimeout(function(){ email2Error.innerHTML = ''; }, 3000);
return false;
}
email2Error.innerHTML = "<i class='bx bxs-check-circle'></i>";
return true;
}
//validating the message
function msgvalidate(){
var message=document.getElementById('message').value;
var required=30;
var left=required-message.length;
if(left>0){
msgError.innerHTML=left + 'more characters required';
setTimeout(function(){ msgError.innerHTML = ''; }, 3000);
return false;
}
msgError.innerHTML="<i class='bx bx-check-circle' ></i>";
return true;
}
function validate2Form(){
if(!namevalidate()|| !email2validate() || !msgvalidate()){
submitError.style.display='block';
submitError.innerHTML="pls Complete";
setTimeout(function(){submitError.style.display = 'none';}, 3000);
return false;
}
sendmessage();
}
function sendmessage() {
var name = document.getElementById('name').value;
var email = document.getElementById('email2').value;
var message = document.getElementById('message').value;
// Create an object to represent the message
var messageObject = {
name: name,
email: email,
message: message
};
// Retrieve existing messages from localStorage
var existingMessages = localStorage.getItem('messages');
// Convert existing messages to an array or initialize an empty array
var messagesArray = JSON.parse(existingMessages) || [];
// Add the new message object to the array
messagesArray.push(messageObject);
// Convert the array back to a JSON string
localStorage.setItem('messages', JSON.stringify(messagesArray));
// clear
document.getElementById('name').value = '';
document.getElementById('email2').value = '';
document.getElementById('message').value = '';
}
// if the user is logged in then change the signintext to dashboardtext
window.onload = function() {
// Check if the user is logged in
var userIsLoggedIn = localStorage.getItem('userIsLoggedIn');
var adminIsLoggedIn = localStorage.getItem('adminIsLoggedIn');
// Get the nav element
var nav = document.querySelector('nav');
if (userIsLoggedIn || adminIsLoggedIn) {
// Create a new anchor element
var anchor = document.createElement('a');
// Remove the "Sign In" anchor
var signInAnchor = document.querySelector('nav a[href="LOGIN.HTML"]');
if (signInAnchor) {
nav.removeChild(signInAnchor);
}
// Set the href attribute and text based on whether it is admin or user login
if (userIsLoggedIn) {
anchor.href = 'userdashboard.html';
anchor.innerText = 'ACCOUNT';
} else if (adminIsLoggedIn) {
anchor.href = 'dashboard.html';
anchor.innerText = 'Dashboard';
}
// Append the anchor element to the nav
nav.appendChild(anchor);
}
};
</script>
</body>
</html>