1
1
mirror of https://github.com/neosubhamoy/neosubhamoy-portfolio.git synced 2025-12-20 03:29:35 +05:30

(feature): implemented dynamic socials rendering on home and projects page

This commit is contained in:
2023-11-02 13:43:42 +05:30
parent 7e18620bd8
commit 146c634870
3 changed files with 28 additions and 5 deletions

View File

@@ -27,4 +27,27 @@ function fetch_projects_by_year($conn, $year) {
$result = $conn -> query($sql);
return $result;
}
//function to fetch social link of the given platform
function fetch_social_link($conn, $platform_name) {
$sql = "SELECT link FROM socials WHERE platform = '$platform_name'";
$result = $conn -> query($sql);
if($result -> num_rows > 0){
$row = $result -> fetch_assoc();
return $row['link'];
}
else {
return "#";
}
}
//function to fetch social icon of the given platform
function fetch_social_icon($conn, $platform_name) {
$sql = "SELECT icon FROM socials WHERE platform = '$platform_name'";
$result = $conn -> query($sql);
if($result -> num_rows > 0){
$row = $result -> fetch_assoc();
return $row['icon'];
}
}
?>

View File

@@ -24,10 +24,10 @@ require './core/query_functions.php';
<h3 class="text-lg mt-1 mb-3 lg:mt-1 lg:mb-2 lg:whitespace-nowrap">Based on <span class="text-accent_primary font-bold">Kolkata</span>, <span class="font-bold">India</span></h3>
<div class="w-full flex justify-start items-center my-7 lg:my-6">
<button class="px-5 py-1 font-bold bg-accent_primary text-bg_primary rounded-full hover:shadow-lg hover:shadow-accent_secondary_transparent hover:bg-accent_secondary hover:rounded-lg transition transform duration-500" onclick="location.href='contact.php'">Hire Me</button>
<i class="fa-brands fa-facebook text-accent_primary text-2xl cursor-pointer ml-8 mr-3 hover:scale-125 hover:text-accent_secondary transition transform duration-300" onclick="window.open('https://www.facebook.com/profile.php?id=100076097318726')"></i>
<i class="fa-brands fa-instagram text-accent_primary text-2xl cursor-pointer mx-3 hover:scale-125 hover:text-accent_secondary transition transform duration-300" onclick="window.open('https://instagram.com/neo_subhamoy')"></i>
<i class="fa-brands fa-twitter text-accent_primary text-2xl cursor-pointer mx-3 hover:scale-125 hover:text-accent_secondary transition transform duration-300" onclick="window.open('https://twitter.com/neo_subhamoy')"></i>
<i class="fa-brands fa-linkedin text-accent_primary text-2xl cursor-pointer mx-3 hover:scale-125 hover:text-accent_secondary transition transform duration-300" onclick="window.open('https://www.linkedin.com/in/neo-subhamoy')"></i>
<i class="text-accent_primary text-2xl cursor-pointer ml-8 mr-3 hover:scale-125 hover:text-accent_secondary transition transform duration-300 <?php echo fetch_social_icon($conn, 'Facebook')?>" onclick="window.open('<?php echo fetch_social_link($conn, 'Facebook') ?>')"></i>
<i class="text-accent_primary text-2xl cursor-pointer mx-3 hover:scale-125 hover:text-accent_secondary transition transform duration-300 <?php echo fetch_social_icon($conn, 'Instagram')?>" onclick="window.open('<?php echo fetch_social_link($conn, 'Instagram') ?>')"></i>
<i class="text-accent_primary text-2xl cursor-pointer mx-3 hover:scale-125 hover:text-accent_secondary transition transform duration-300 <?php echo fetch_social_icon($conn, 'Twitter')?>" onclick="window.open('<?php echo fetch_social_link($conn, 'Twitter') ?>')"></i>
<i class="text-accent_primary text-2xl cursor-pointer mx-3 hover:scale-125 hover:text-accent_secondary transition transform duration-300 <?php echo fetch_social_icon($conn, 'Linkedin')?>" onclick="window.open('<?php echo fetch_social_link($conn, 'Linkedin') ?>')"></i>
</div>
<div class="scrollinfo hidden lg:block">
<div class="mb-7 mt-10 2xl:mb-10 2xl:mt-16"><div class="border-l-[1px] border-accent_primary_transparent h-20 ml-[0.59rem]"></div></div>

View File

@@ -24,7 +24,7 @@ $years = create_project_years_array($conn);
<h2 class="text-lg mt-3 mb-1 lg:mt-2 lg:mb-1 lg:whitespace-nowrap">I'm just obsessed with <span class="text-accent_primary font-bold">side projects</span> and <span class="text-accent_primary font-bold">open-source</span> stuffs</h2>
<h3 class="text-lg mt-1 mb-3 lg:mt-1 lg:mb-2 lg:whitespace-nowrap">You can <span class="text-accent_primary font-bold">explore</span> some of <span class="text-accent_primary font-bold">them</span> below</h3>
<div class="w-full flex justify-start items-center my-7 lg:my-6">
<button class="px-5 py-1 font-bold bg-accent_primary text-bg_primary rounded-full hover:shadow-lg hover:shadow-accent_secondary_transparent hover:bg-accent_secondary hover:rounded-lg transition transform duration-500" onclick="window.open('https://github.com/neosubhamoy', '_blank')"><i class="fa-brands fa-github text-bg_primary"></i> Github</button>
<button class="px-5 py-1 font-bold bg-accent_primary text-bg_primary rounded-full hover:shadow-lg hover:shadow-accent_secondary_transparent hover:bg-accent_secondary hover:rounded-lg transition transform duration-500" onclick="window.open('<?php echo fetch_social_link($conn, 'Github') ?>', '_blank')"><i class="text-bg_primary <?php echo fetch_social_icon($conn, 'Github') ?>"></i> Github</button>
<button class="group px-5 py-1 bg-bg_secondary text-accent_secondary_transparent rounded-full font-light hover:bg-bg_third hover:text-accent_secondary hover:rounded-lg mx-7 transition transform duration-500"><i class="fa-solid fa-magnifying-glass text-accent_primary mr-2"></i> Search a project . . . <span class="text-bg_primary bg-accent_secondary_transparent text-[10px] font-normal px-1 rounded-sm mr-1 ml-3 group-hover:bg-accent_secondary transition transform duration-500">ALT</span>+<span class="text-bg_primary bg-accent_secondary_transparent text-[10px] font-normal px-1 rounded-sm mx-1 group-hover:bg-accent_secondary transition transform duration-500">K</span></button>
</div>
</div>