Skip to content

Commit bfc8e94

Browse files
committed
added reCAPTCHA to recommendations take 1
1 parent 57f45ea commit bfc8e94

1 file changed

Lines changed: 40 additions & 18 deletions

File tree

index.html

Lines changed: 40 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ <h1>Kevin Lin</h1>
2121
<p class="position">Software Engineer/Frontend Developer</p>
2222
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
2323
</header>
24-
24+
2525
<section id="toc" class="toc">
2626
<h2>Table of Contents</h2>
2727
<nav>
@@ -166,7 +166,8 @@ <h3>DIYeSk8Guide</h3>
166166
<a href="#" data-target="img5"><img src="pictures/DIYeSk8Guide - Guru.png" alt="Guru"></a>
167167
<a href="#" data-target="img6"><img src="pictures/DIYeSk8Guide - Gallery.png" alt="Gallery"></a>
168168
</div>
169-
<p><a href="https://diyesk8guide.com" target="_blank" class="button">Explore the Application <i class="fas fa-external-link-alt"></i></a></p>
169+
<p><a href="https://diyesk8guide.com" target="_blank" class="button">Explore the Application <i
170+
class="fas fa-external-link-alt"></i></a></p>
170171
<p><a href="https://github.com/codeviith/capstone-project-diyesk8guide" target="_blank" class="button">View
171172
on GitHub <i class="fas fa-external-link-alt"></i></a>
172173
</p>
@@ -252,17 +253,14 @@ <h2>GitHub Contributions</h2>
252253
</div>
253254
</div>
254255
<div class="github-button">
255-
<p><a href="https://github.com/codeviith" target="_blank" class="button">View Github Profile <i class="fas fa-external-link-alt"></i></a></p>
256+
<p><a href="https://github.com/codeviith" target="_blank" class="button">View Github Profile <i
257+
class="fas fa-external-link-alt"></i></a></p>
256258
</div>
257259
</section>
258260

259261
<section id="testimonials" class="fade-in">
260262
<h2>Recommendations & Testimonials</h2>
261-
<div class="testimonial">
262-
<!-- <p>"Testimonials goes here." - Jane Doe, Project Manager</p> -->
263-
</div>
264-
<!-- Add more testimonials as needed -->
265-
<div class="recommendation">
263+
<div id="recommendations" class="recommendation">
266264
<ul>
267265
<li>
268266
<p>
@@ -289,8 +287,15 @@ <h2>Recommendations & Testimonials</h2>
289287
</p>
290288
<br>
291289
<p>Ben Cavins - Software Engineering Instructor, Flatiron School</p>
290+
<button type="button" class="button" onclick="showEmail('ben-email')">Show Ben's Email</button>
291+
<p id="ben-email" style="display:none;">Email: ben-example@gmail.com</p>
292292
</li>
293293
<br>
294+
<!-- Add more recommendations as needed -->
295+
</ul>
296+
</div>
297+
<div id="testimonials" class="testimonial">
298+
<ul>
294299
<li>
295300
<p>
296301
"I am associated with Kevin through Flatiron School Career Services. Aside from being a great
@@ -307,11 +312,13 @@ <h2>Recommendations & Testimonials</h2>
307312
</p>
308313
<br>
309314
<p>Anne Glisten - Career Coach Specialist, Flatiron School</p>
315+
<button type="button" class="button" onclick="showEmail('anne-email')">Show Anne's Email</button>
316+
<p id="anne-email" style="display:none;">Email: anne-example@gmail.com</p>
310317
</li>
311318
<br>
319+
<!-- Add more testimonials as needed -->
312320
</ul>
313321
</div>
314-
<!-- Add more recommendations as needed -->
315322
</section>
316323

317324
<section id="hobbies" class="fade-in">
@@ -335,7 +342,7 @@ <h2>Sports & Hobbies</h2>
335342
<section id="contact" class="fade-in">
336343
<h2>Contact</h2>
337344
<!-- reCAPTCHA v2 -->
338-
<form id="contactForm" onsubmit="return showContactInfo()">
345+
<form id="contactForm" onsubmit="return verifyRecaptcha(event)">
339346
<div class="g-recaptcha" data-sitekey="6Lfh4vUpAAAAAMI2Qq5ompdWU6AUDN4V4m7psohc"></div>
340347
<br>
341348
<button type="submit" class="button">Verify to See Contact Info</button>
@@ -359,14 +366,17 @@ <h2>Contact</h2>
359366
<p>Email: <a href="mailto:kclin128@gmail.com">kclin128@gmail.com</a></p>
360367
</li>
361368
<li>
362-
<p>LinkedIn: <a href="https://www.linkedin.com/in/kevinlin128/" target="_blank">View LinkedIn <i class="fas fa-external-link-alt"></i></a>
369+
<p>LinkedIn: <a href="https://www.linkedin.com/in/kevinlin128/" target="_blank">View LinkedIn <i
370+
class="fas fa-external-link-alt"></i></a>
363371
</p>
364372
</li>
365373
<li>
366-
<p>Github: <a href="https://github.com/codeviith/" target="_blank">View Github <i class="fas fa-external-link-alt"></i></a></p>
374+
<p>Github: <a href="https://github.com/codeviith/" target="_blank">View Github <i
375+
class="fas fa-external-link-alt"></i></a></p>
367376
</li>
368377
<li>
369-
<p>Blog: <a href="https://hashnode.com/@codeviith" target="_blank">View Blog <i class="fas fa-external-link-alt"></i></a></p>
378+
<p>Blog: <a href="https://hashnode.com/@codeviith" target="_blank">View Blog <i
379+
class="fas fa-external-link-alt"></i></a></p>
370380
</li>
371381
</ul>
372382
</div>
@@ -456,24 +466,36 @@ <h2>Contact</h2>
456466
}
457467
});
458468

459-
///////////// reCAPTCHA code for contact section /////////////
469+
///////////// reCAPTCHA code for contact section and testimonials /////////////
460470

461471
////// reCAPTCHA v2 //////
462-
function showContactInfo() {
472+
function verifyRecaptcha(event) {
463473
event.preventDefault();
464474

465-
var response = grecaptcha.getResponse(); // Code to get reCAPTCHA response
475+
var response = grecaptcha.getResponse(); // code to get reCAPTCHA response
466476

467-
if (response.length == 0) { // Code to check if reCAPTCHA is verified
477+
if (response.length == 0) { // code to check if reCAPTCHA is verified
468478
alert("Please verify that you are not a robot.");
469479
return false;
470-
} else { // Code to show contact information
480+
} else { // Code to show contact and recommendation information
471481
document.getElementById('contactInfo').style.display = 'block';
472482
document.getElementById('contactForm').style.display = 'none';
483+
document.getElementById('recommendations').classList.add('verified');
484+
document.getElementById('testimonials').classList.add('verified');
473485
return true;
474486
}
475487
}
476488

489+
function showEmail(emailId) {
490+
var recommendations = document.getElementById('recommendations');
491+
492+
if (recommendations.classList.contains('verified')) {
493+
document.getElementById(emailId).style.display = 'block';
494+
} else {
495+
alert("Please verify that you are not a robot using the reCAPTCHA in the contact section.");
496+
}
497+
}
498+
477499
////// reCAPTCHA v3 //////
478500
// function handleFormSubmit(event) {
479501
// event.preventDefault();

0 commit comments

Comments
 (0)