Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Let's Connect button functionality to redirect to Linkedin profile #303

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"liveServer.settings.port": 5501
}
"liveServer.settings.port": 5501
}
47 changes: 27 additions & 20 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
window.addEventListener('DOMContentLoaded', () => {
window.addEventListener("DOMContentLoaded", () => {
let scrollPos = 0;
const mainNav = document.getElementById('navbar');
const mainNav = document.getElementById("navbar");
const headerHeight = mainNav.clientHeight;
window.addEventListener('scroll', function() {
const currentTop = document.body.getBoundingClientRect().top * -1;
if ( currentTop < scrollPos) {
// Scrolling Up
if (currentTop > 0 && mainNav.classList.contains('is-fixed')) {
mainNav.classList.add('is-visible');
} else {
console.log(123);
mainNav.classList.remove('is-visible', 'is-fixed');
}
window.addEventListener("scroll", function () {
const currentTop = document.body.getBoundingClientRect().top * -1;
if (currentTop < scrollPos) {
// Scrolling Up
if (currentTop > 0 && mainNav.classList.contains("is-fixed")) {
mainNav.classList.add("is-visible");
} else {
// Scrolling Down
mainNav.classList.remove(['is-visible']);
if (currentTop > headerHeight && !mainNav.classList.contains('is-fixed')) {
mainNav.classList.add('is-fixed');
}
console.log(123);
mainNav.classList.remove("is-visible", "is-fixed");
}
scrollPos = currentTop;
} else {
// Scrolling Down
mainNav.classList.remove(["is-visible"]);
if (
currentTop > headerHeight &&
!mainNav.classList.contains("is-fixed")
) {
mainNav.classList.add("is-fixed");
}
}
scrollPos = currentTop;
});
})
});

// initialization of cardDetailsArray
let cardDetailsArray;
Expand All @@ -36,13 +39,17 @@ function createCard(details) {
cardClone.querySelector(".card-details p").innerHTML = details.quote;

const socialIcons = cardClone.querySelector(".social-icon");
let lets_connect = cardClone.querySelector(".connect");
lets_connect.setAttribute("href", details["linkedin"]);
lets_connect.setAttribute("target", "_blank");
lets_connect.innerHTML = `<span style="display: flex; align-items: center; justify-content: center; width: 100%;">Let's Connect!<i class="uil uil-linkedin" style="font-size: 2rem; margin-left: 0.5rem;"></i></span>`;

// Define the social media platforms and their corresponding icons
//if you have any other in mind add it here and test it out for icons
const socialMedia = [
{ key: "twitter", icon: "uil uil-twitter" },
{ key: "github", icon: "uil uil-github" },
{ key: "linkedin", icon: "uil uil-linkedin" },
// { key: "linkedin", icon: "uil uil-linkedin" },
{ key: "dribbble", icon: "uil uil-dribbble" },
{ key: "behance", icon: "uil uil-behance" },
{ key: "email", icon: "uil uil-envelope" },
Expand Down
Loading