-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from axherrm/feat/navbar-2
feat: Navbar
- Loading branch information
Showing
13 changed files
with
409 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<span [innerHTML]="section.name"></span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
:host { | ||
height: 1.2rem; | ||
width: 1.2rem; | ||
border-radius: 50%; | ||
border: 3px solid rgb(255, 255, 255); | ||
transition: all .6s ease-in-out; | ||
user-select: none; | ||
|
||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
font-size: 0; | ||
|
||
&:not(.extended):hover { | ||
transition: all .1s ease-in-out; | ||
height: 1.5rem; | ||
width: 1.5rem; | ||
border: 5px solid rgb(255, 255, 255); | ||
background: rgba(0, 0, 0, 0.3); | ||
cursor: pointer; | ||
} | ||
|
||
&.active:not(.extended) { | ||
background: #e134e8 !important; | ||
} | ||
&.extended { | ||
position: relative; | ||
transition: all .4s ease-in-out; | ||
width: 20rem; | ||
height: 5rem; | ||
margin: 0 3rem; | ||
border-radius: 20px; | ||
//transform: translateX(-4rem); | ||
font-size: 1.3rem; | ||
&.active { | ||
border: 0; | ||
&::before { | ||
// code from: https://dev.to/afif/border-with-gradient-and-radius-387f | ||
content: ""; | ||
position: absolute; | ||
inset: 0; | ||
border-radius: 20px; | ||
padding: 5px; | ||
margin: -5px; | ||
background: linear-gradient(to right, #a445b2, #fa4299); | ||
-webkit-mask: | ||
linear-gradient(#fff 0 0) content-box, | ||
linear-gradient(#fff 0 0); | ||
-webkit-mask-composite: xor; | ||
mask-composite: exclude; | ||
} | ||
} | ||
&:hover { | ||
width: 21rem; | ||
margin: 0 1rem; | ||
height: 5.3rem; | ||
font-size: 1.4rem; | ||
background: rgba(0, 0, 0, 0.3); | ||
cursor: pointer; | ||
} | ||
span { | ||
display: block; | ||
} | ||
} | ||
} | ||
|
||
span { | ||
display: none; | ||
transition: all .4s ease-in-out; | ||
color: white; | ||
text-align: center; | ||
margin-top: auto; | ||
margin-bottom: auto; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import {Component, EventEmitter, HostBinding, HostListener, Input, Output} from '@angular/core'; | ||
import {Section} from "../../data/model"; | ||
import gsap from "gsap"; | ||
import {ScrollToPlugin} from "gsap/ScrollToPlugin"; | ||
|
||
gsap.registerPlugin(ScrollToPlugin) | ||
|
||
@Component({ | ||
selector: 'navbar-dot', | ||
standalone: true, | ||
imports: [], | ||
templateUrl: './navbar-dot.component.html', | ||
styleUrl: './navbar-dot.component.scss' | ||
}) | ||
export class NavbarDotComponent { | ||
|
||
@Input({required: true}) section: Section; | ||
|
||
// @HostBinding('class.extended') | ||
// @Input() | ||
// extended = false; | ||
|
||
@HostBinding('class.active') | ||
@Input() | ||
active = false; | ||
|
||
// @Output() hover: EventEmitter<void> = new EventEmitter<void>(); | ||
|
||
delayTimeout: any; | ||
|
||
// @HostListener("mouseenter") | ||
// onMouseover() { | ||
// this.delayTimeout = setTimeout(() => this.hover.emit(), 300); | ||
// } | ||
|
||
/** | ||
* In case the hovering stops before delay timeout is over, the hovering is not forwarded. | ||
*/ | ||
// @HostListener("mouseleave") | ||
// onMouseleave() { | ||
// clearTimeout(this.delayTimeout); | ||
// } | ||
|
||
@HostListener("click") | ||
onClick() { | ||
gsap.to(window, { | ||
duration: 2, | ||
scrollTo: { | ||
y: `#${this.section.id}`, | ||
offsetY: 20, | ||
}, | ||
ease: "power1.inOut" | ||
}); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.