{ "version": 3, "sources": ["src/app/shared/components/scroll-top/scroll-top.component.ts", "src/app/shared/components/scroll-top/scroll-top.component.html"], "sourcesContent": ["import { ChangeDetectionStrategy, Component, OnInit, ViewEncapsulation, signal } from '@angular/core';\r\nimport { ScrollBarService } from '@shared/scroll/scrollbar.service';\r\nimport { NgScrollbar } from 'ngx-scrollbar';\r\nimport { expoAnimations } from '@shared/animations/expo-animations';\r\nimport { CommonModule } from '@angular/common';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { Router } from '@angular/router';\r\n\r\n@Component({\r\n selector: 'scroll-top',\r\n templateUrl: './scroll-top.component.html',\r\n styleUrls: ['./scroll-top.component.scss'],\r\n animations: [expoAnimations],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n standalone: true,\r\n imports: [\r\n CommonModule,\r\n MatIconModule\r\n ]\r\n})\r\nexport class ScrollTopComponent implements OnInit {\r\n\r\n scrollBar: NgScrollbar;\r\n visible = signal(false);\r\n isNewsCaroulselPage: boolean = false; //Dichiaro isNewsCaroulselPage come false, poichè diventerà true quando il router sarà su hall page\r\n\r\n constructor(\r\n private scrollBarService: ScrollBarService,\r\n private router: Router\r\n ) { }\r\n\r\n ngOnInit(): void{\r\n this.scrollBar = this.scrollBarService.mainScrollbar;\r\n this.scrollBar.viewport.nativeElement.addEventListener('scroll', (ev: MouseEvent) => {\r\n this.visible.set(this.scrollBar.viewport.scrollTop > 200);\r\n\r\n //Se isNewsCaroulselPage avrà il router.url che includerà /online-fair oppure /hall metterò isNewsCaroulselPage=true altrimenti metterò false\r\n if(this.router.url.includes('/online-fair') || this.router.url.includes('/hall') && !this.router.url.includes('/stand'))\r\n {\r\n this.isNewsCaroulselPage = true;\r\n }\r\n else{\r\n this.isNewsCaroulselPage = false;\r\n }\r\n \r\n });\r\n }\r\n\r\n scrollToTop(): void{\r\n this.scrollBar.scrollTo({top: 0, duration: 300});\r\n }\r\n}\r\n", "@if (visible()) {\r\n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A,EAAA,SAAA,EAAA,CAAA,KAAA,oBAAA,EAAA,WAAA,UAAA,WAAA,cAAA,OAAA,OAAA,UAAA,UAAA,WAAA,aAAA,iBAAA,OAAA,EAAA,QAAA,SAAA,EAAA,CAAA,UAAA,yBAAA,EAAA,aAAA,WAAA,iBAAA,eAAA,eAAA,kBAAA,iBAAA,CAAA,EAAAC,SAAA,SAAAC,EAAAC,EAAA,CAAAD,EAAA,GCrB/BE,EAAA,EAAAC,EAAA,EAAA,EAAA,MAAA,CAAA,OAAAC,EAAAH,EAAA5B,QAAA,EAAA,EAAA,EAAA,iBDiBIgC,EAAYC,EACZC,EAAaC,CAAA,EAAAC,OAAA,CAAA;;CAAA,EAAAC,cAAA,EAAAC,KAAA,CAAAC,UANH,CAACC,CAAc,CAAC,EAAAC,gBAAA,CAAA,CAAA,EASxB,IAAO7C,EAAP8C,SAAO9C,CAAkB,GAAA", "names": ["\u0275\u0275elementStart", "\u0275\u0275listener", "\u0275\u0275restoreView", "_r1", "ctx_r1", "\u0275\u0275nextContext", "\u0275\u0275resetView", "scrollToTop", "\u0275\u0275element", "\u0275\u0275elementEnd", "\u0275\u0275property", "undefined", "isNewsCaroulselPage", "ScrollTopComponent", "constructor", "scrollBarService", "router", "visible", "signal", "ngOnInit", "scrollBar", "mainScrollbar", "viewport", "nativeElement", "addEventListener", "ev", "set", "scrollTop", "url", "includes", "scrollTo", "top", "duration", "\u0275\u0275directiveInject", "ScrollBarService", "Router", "selectors", "standalone", "features", "\u0275\u0275StandaloneFeature", "decls", "vars", "consts", "template", "rf", "ctx", "\u0275\u0275template", "ScrollTopComponent_Conditional_0_Template", "\u0275\u0275conditional", "CommonModule", "NgClass", "MatIconModule", "MatIcon", "styles", "encapsulation", "data", "animation", "expoAnimations", "changeDetection", "_ScrollTopComponent"] }