Better Snap Scroll Behavior
This commit is contained in:
@@ -130,7 +130,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.stack-section {
|
.stack-section {
|
||||||
height: 100vh;
|
height: 90vh;
|
||||||
}
|
}
|
||||||
.stack {
|
.stack {
|
||||||
padding-top: 60px;
|
padding-top: 60px;
|
||||||
|
|||||||
@@ -9,10 +9,14 @@ export class HomeComponent {
|
|||||||
constructor() {}
|
constructor() {}
|
||||||
|
|
||||||
scrollToElement(element: HTMLElement): void {
|
scrollToElement(element: HTMLElement): void {
|
||||||
|
let block: ScrollLogicalPosition = "start";
|
||||||
|
if (window.innerWidth < 400) {
|
||||||
|
block = "end";
|
||||||
|
}
|
||||||
element.scrollIntoView({
|
element.scrollIntoView({
|
||||||
behavior: "smooth",
|
behavior: "smooth",
|
||||||
block: "start",
|
block: block,
|
||||||
inline: "start"
|
inline: "nearest"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ export class StackSliderComponent implements AfterViewInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private getNumberOfCards(windowWidth: number): number {
|
private getNumberOfCards(windowWidth: number): number {
|
||||||
if (windowWidth <= 412) {
|
if (windowWidth <= 450) {
|
||||||
return 1;
|
return 1;
|
||||||
} else if (windowWidth <= 768) {
|
} else if (windowWidth <= 768) {
|
||||||
return 2;
|
return 2;
|
||||||
|
|||||||
Reference in New Issue
Block a user