Skip to content
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
12 changes: 9 additions & 3 deletions frontend/src/components/navbar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class Navbar extends Component {
return (
<NavbarItem active={false} key={path}>
<Link to="http://gsoc.cloudcv.org" target="_blank">
{path}
<span className="hover-underline-animation">{path}</span>
</Link>
</NavbarItem>
);
Expand All @@ -74,7 +74,7 @@ class Navbar extends Component {
return (
<NavbarItem active={false} key={path}>
<Link to="http://gci.cloudcv.org" target="_blank">
{path}
<span className="hover-underline-animation">{path}</span>
</Link>
</NavbarItem>
);
Expand All @@ -83,7 +83,13 @@ class Navbar extends Component {
let formattedPath = path.toLowerCase().replace(/ /g, "-");
return (
<NavbarItem active={active} key={path}>
<Link to={`/${formattedPath}`}>{path === "" ? "Home" : path}</Link>
<Link to={`/${formattedPath}`}>
{path === "" ? (
<span className="hover-underline-animation">{"Home"}</span>
) : (
<span className="hover-underline-animation">{path}</span>
)}
</Link>
</NavbarItem>
);
});
Expand Down
26 changes: 26 additions & 0 deletions frontend/src/styles/partials/_navbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@
color: $secondary-color;
}



a {
display: block;
padding: 0.5 * $gutter-width 0 0.5 * $gutter-width 0;
Expand Down Expand Up @@ -136,3 +138,27 @@
}
}

.hover-underline-animation {
display: inline-block;
position: relative;

margin-top: -80px;
}

.hover-underline-animation::after {
content: '';
position: absolute;
width: 100%;
transform: scaleX(0);
height: 2px;
bottom: 0;
left: 0;
background-color: $secondary-color;
transform-origin: bottom right;
transition: transform 0.25s ease-out;
}

.hover-underline-animation:hover::after {
transform: scaleX(1);
transform-origin: bottom left;
}