Skip to content

Commit f6a68db

Browse files
Fixing social media icon pop up and component overlapping in mobile view. (#1443)
* fixing an social media icons popup on scroll to avoid overlapping of components in mobile view & style * updated contribution.md for fix done
1 parent ace6dbf commit f6a68db

4 files changed

Lines changed: 216 additions & 4 deletions

File tree

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ Awesome-github-profiles/
5656
│ ├── profileModal.js # Profile modal functionality
5757
│ ├── retriveprofile.js # Profile retrieval script
5858
│ ├── revealelementsonscroll.js # Reveal elements on scroll
59+
| ├── socialpopicon.js #Reveal social pop icons on scroll
5960
│ └── speechRecognition.js # Speech recognition functionality
6061
├── styles/ # CSS styles
6162
│ ├── blog.css # Blog styles

index.html

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
</div>
7979
</div>
8080
</div>
81-
81+
<!-- Side Social Icons - commented out for new popup design
8282
<div class="side-icons">
8383
<div class="icon-content">
8484
<a href="https://github.com/sanjay-kv" target="_blank" aria-label="GitHub" data-social="github">
@@ -113,6 +113,8 @@
113113
</div>
114114
</div>
115115
116+
-->
117+
116118

117119

118120

@@ -310,6 +312,41 @@ <h5>We focus on quality content for the right people at the right time. What we
310312

311313
</footer>
312314

315+
316+
<!-- Toggle Button for Social Icons -->
317+
<div id="socialToggleBtn" class="social-toggle">
318+
<i class="fas fa-share-alt"></i>
319+
</div>
320+
321+
<!-- Social Icons Popup -->
322+
<div id="socialPopup" class="social-popup">
323+
<div class="icon-content">
324+
<a href="https://github.com/sanjay-kv" target="_blank" aria-label="GitHub">
325+
<i class="fab fa-github"></i>
326+
</a>
327+
</div>
328+
<div class="icon-content">
329+
<a href="https://stream.recodehive.com/github" target="_blank" aria-label="YouTube">
330+
<i class="fab fa-youtube"></i>
331+
</a>
332+
</div>
333+
<div class="icon-content">
334+
<a href="https://twitter.com/sanjay_kv_" target="_blank" aria-label="Twitter">
335+
<i class="fa-brands fa-x-twitter"></i>
336+
</a>
337+
</div>
338+
<div class="icon-content">
339+
<a href="https://www.linkedin.com/in/sanjay-k-v/" target="_blank" aria-label="LinkedIn">
340+
<i class="fab fa-linkedin-in"></i>
341+
</a>
342+
</div>
343+
<div class="icon-content">
344+
<a href="https://www.facebook.com/sanjay.k.viswanathan/" target="_blank" aria-label="Facebook">
345+
<i class="fab fa-facebook-f"></i>
346+
</a>
347+
</div>
348+
</div>
349+
313350
<!-- Scroll to top -->
314351
<button id="scrollToTop" aria-label="Scroll to top">
315352
<svg viewBox="0 0 384 512" xmlns="http://www.w3.org/2000/svg" class="arrow-icon">
@@ -349,6 +386,7 @@ <h2>Join the Recode Hive Community</h2>
349386
<script src="scripts/hamburger.js"></script>
350387
<script src="scripts/revealelementsonscroll.js"></script>
351388
<script src="scripts/speechRecognition.js"></script>
389+
<script src="scripts/socialpopicon.js"></script>
352390
<!-- Added script for new Twitter logo -->
353391
<script src="https://kit.fontawesome.com/856f4a44d7.js" crossorigin="anonymous"></script>
354392
</body>

scripts/socialpopicon.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
const socialToggleBtn = document.getElementById('socialToggleBtn');
2+
const socialPopup = document.getElementById('socialPopup');
3+
4+
// Show toggle button on scroll
5+
window.addEventListener('scroll', () => {
6+
if (window.scrollY > 200) {
7+
document.body.classList.add('scrolled');
8+
} else {
9+
document.body.classList.remove('scrolled');
10+
socialPopup.classList.remove('show');
11+
}
12+
});
13+
14+
// Toggle popup
15+
socialToggleBtn.addEventListener('click', (e) => {
16+
e.stopPropagation(); // prevent closing when clicking button
17+
socialPopup.classList.toggle('show');
18+
});
19+
20+
// Close popup if clicked outside
21+
document.addEventListener('click', (e) => {
22+
if (!socialPopup.contains(e.target) && !socialToggleBtn.contains(e.target)) {
23+
socialPopup.classList.remove('show');
24+
}
25+
});

styles/styles.css

Lines changed: 151 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,13 +1272,15 @@ body.theme-dark .center {
12721272
body.dark-mode .side-icons a {
12731273
color: white !important;
12741274
}
1275-
12761275
@media (max-width: 768px) {
12771276
.side-icons {
12781277
width: 50px;
12791278
height: auto;
12801279
padding: 10px 0;
12811280
gap: 15px;
1281+
display: flex; /* ensure flex layout */
1282+
flex-direction: column; /* stack icons vertically */
1283+
align-items: center; /* center icons horizontally */
12821284
}
12831285

12841286
.icons {
@@ -1297,6 +1299,9 @@ body.dark-mode .side-icons a {
12971299
height: auto;
12981300
padding: 30px 0;
12991301
gap: 10px;
1302+
display: flex;
1303+
flex-direction: column;
1304+
align-items: center;
13001305
}
13011306

13021307
.icons {
@@ -1309,7 +1314,7 @@ body.dark-mode .side-icons a {
13091314
}
13101315

13111316
.footer-description {
1312-
max-width: 600;
1317+
max-width: 600px; /* added missing px */
13131318
text-align: center;
13141319
margin: 0 auto;
13151320
}
@@ -1695,4 +1700,147 @@ body.dark-mode a {
16951700
body.dark-mode a:hover {
16961701
color: #ccc;
16971702
/* Slightly lighter on hover */
1698-
}
1703+
}
1704+
1705+
/* POP UP SOCIAL MEDIA BUTTONS */
1706+
/* Social Toggle Button */
1707+
.social-toggle {
1708+
position: fixed;
1709+
bottom: 80px;
1710+
right: 20px;
1711+
height: 20px;
1712+
width: 20px;
1713+
background-color: #000000;
1714+
color: white;
1715+
padding: 12px;
1716+
border-radius: 50%;
1717+
cursor: pointer;
1718+
z-index: 9999;
1719+
display: none;
1720+
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
1721+
}
1722+
1723+
1724+
.social-toggle i {
1725+
font-size: 18px;
1726+
}
1727+
1728+
body.dark-mode .social-toggle {
1729+
background-color: #ffffff;
1730+
color: #000000;
1731+
}
1732+
1733+
1734+
/* Social Popup */
1735+
.social-popup {
1736+
display: none;
1737+
position: fixed;
1738+
bottom: 140px;
1739+
right: 20px;
1740+
background: transparent;
1741+
padding: 0;
1742+
border-radius: 12px;
1743+
box-shadow: none;
1744+
z-index: 9999;
1745+
flex-direction: column;
1746+
gap: 10px;
1747+
align-items: flex-end;
1748+
}
1749+
1750+
.social-popup.show {
1751+
display: flex;
1752+
}
1753+
1754+
/* Icon container - circle */
1755+
.social-popup .icon-content {
1756+
width: 42px;
1757+
height: 42px;
1758+
border-radius: 50%;
1759+
display: flex;
1760+
justify-content: center;
1761+
align-items: center;
1762+
transition: transform 0.3s ease;
1763+
overflow: hidden;
1764+
}
1765+
1766+
/* Icon styling */
1767+
.social-popup .icon-content i {
1768+
font-size: 18px;
1769+
color: #fff;
1770+
}
1771+
1772+
/* Hover effect */
1773+
.social-popup .icon-content:hover {
1774+
transform: scale(1.15);
1775+
}
1776+
1777+
/* Platform-specific colors */
1778+
.social-popup .icon-content a[aria-label="GitHub"] {
1779+
background-color: #333;
1780+
border-radius: 50%;
1781+
width: 100%;
1782+
height: 100%;
1783+
display: flex;
1784+
justify-content: center;
1785+
align-items: center;
1786+
}
1787+
.social-popup .icon-content a[aria-label="GitHub"]:hover {
1788+
background-color: #444;
1789+
}
1790+
1791+
.social-popup .icon-content a[aria-label="YouTube"] {
1792+
background-color: #FF0000;
1793+
border-radius: 50%;
1794+
width: 100%;
1795+
height: 100%;
1796+
display: flex;
1797+
justify-content: center;
1798+
align-items: center;
1799+
}
1800+
.social-popup .icon-content a[aria-label="YouTube"]:hover {
1801+
background-color: #cc0000;
1802+
}
1803+
1804+
.social-popup .icon-content a[aria-label="Twitter"] {
1805+
background-color: #000000;
1806+
border-radius: 50%;
1807+
width: 100%;
1808+
height: 100%;
1809+
display: flex;
1810+
justify-content: center;
1811+
align-items: center;
1812+
}
1813+
.social-popup .icon-content a[aria-label="Twitter"]:hover {
1814+
background-color: #1a1a1a;
1815+
}
1816+
1817+
.social-popup .icon-content a[aria-label="LinkedIn"] {
1818+
background-color: #0077B5;
1819+
border-radius: 50%;
1820+
width: 100%;
1821+
height: 100%;
1822+
display: flex;
1823+
justify-content: center;
1824+
align-items: center;
1825+
}
1826+
.social-popup .icon-content a[aria-label="LinkedIn"]:hover {
1827+
background-color: #005f91;
1828+
}
1829+
1830+
.social-popup .icon-content a[aria-label="Facebook"] {
1831+
background-color: #1877F2;
1832+
border-radius: 50%;
1833+
width: 100%;
1834+
height: 100%;
1835+
display: flex;
1836+
justify-content: center;
1837+
align-items: center;
1838+
}
1839+
.social-popup .icon-content a[aria-label="Facebook"]:hover {
1840+
background-color: #145dbf;
1841+
}
1842+
1843+
/* Show toggle only when scrolled */
1844+
body.scrolled .social-toggle {
1845+
display: block;
1846+
}

0 commit comments

Comments
 (0)