Skip to content

Commit f891179

Browse files
authored
fix(logo): make GSSoC logo responsive and prevent navbar overlap (#717)
1 parent ef29450 commit f891179

1 file changed

Lines changed: 71 additions & 5 deletions

File tree

index.html

Lines changed: 71 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,67 @@
7373
margin: 8px 0;
7474
font-size: 24px;
7575
}
76-
.icon-container i {
77-
transition: transform 0.2s ease;
78-
}
76+
.icon-container i {
77+
transition: transform 0.2s ease;
78+
}
7979
.icon-container i:hover {
8080
transform: scale(1.2);
8181
}
8282
.navbar-light .navbar-toggler-icon {
83-
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(0,0,0,0.5)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
84-
}
83+
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(0,0,0,0.5)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
84+
}
85+
86+
/* Added: make the GSSOC logo responsive and centered */
87+
.gssocContainer {
88+
text-align: center;
89+
display: flex;
90+
flex-direction: column;
91+
align-items: center;
92+
gap: 6px;
93+
}
94+
95+
.gssoc-logo {
96+
width: 140px; /* base size for small screens */
97+
max-width: 35%; /* responsive cap */
98+
height: auto;
99+
display: block;
100+
object-fit: contain;
101+
margin: 0 auto;
102+
border-radius: 8px; /* subtle rounding if needed */
103+
}
104+
105+
/* Slightly larger logo on medium+ screens */
106+
@media (min-width: 768px) {
107+
.gssoc-logo {
108+
width: 180px;
109+
max-width: 220px;
110+
}
111+
}
112+
113+
/* preserve existing animation hover behaviour (if any) */
114+
115+
/* ===== Navbar-safe spacing (prevents fixed-top overlap) =====
116+
Uses a CSS variable that we set from JS to the real navbar height.
117+
*/
118+
:root {
119+
--navbar-height: 72px; /* fallback */
120+
}
121+
122+
/* push page content below fixed navbar and make anchor scrolling correct */
123+
body {
124+
padding-top: var(--navbar-height);
125+
scroll-padding-top: var(--navbar-height);
126+
}
127+
128+
/* small-screen fallback */
129+
@media (max-width: 576px) {
130+
:root { --navbar-height: 56px; }
131+
}
132+
133+
/* small visual spacing inside hero */
134+
.heroSection {
135+
padding-top: 0.5rem;
136+
}
85137
</style>
86138
</head>
87139

@@ -701,5 +753,19 @@ <h5 data-aos-duration="650" data-aos="fade-left" class="footer-title">Contact Us
701753
});
702754

703755
</script>
756+
<script>
757+
// filepath: c:\Users\manog\CodeClip-GSSOC\CodeClip\index.html
758+
// Ensure CSS var matches the actual navbar height (updates on resize)
759+
document.addEventListener('DOMContentLoaded', function () {
760+
const setNavHeight = () => {
761+
const nav = document.querySelector('.navbar.fixed-top, .navbar');
762+
if (nav) {
763+
document.documentElement.style.setProperty('--navbar-height', nav.offsetHeight + 'px');
764+
}
765+
};
766+
setNavHeight();
767+
window.addEventListener('resize', setNavHeight);
768+
});
769+
</script>
704770
</body>
705771
</html>

0 commit comments

Comments
 (0)