mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 18:31:52 +00:00
* fix Tor logs actually fetching od logs * chore: update to Angular 18 * chore: update to Angular 19 * bump patchDB * chore: update Angular * chore: fix setup-wizard success page * chore: fix * chore: fix * chore: fix * chore: fix --------- Co-authored-by: Matt Hill <mattnine@protonmail.com> Co-authored-by: Aiden McClelland <me@drbonez.dev>
40 lines
840 B
TypeScript
40 lines
840 B
TypeScript
import {
|
|
ChangeDetectionStrategy,
|
|
Component,
|
|
ElementRef,
|
|
HostBinding,
|
|
HostListener,
|
|
} from '@angular/core'
|
|
|
|
@Component({
|
|
selector: '[ticker]',
|
|
template: '<ng-content />',
|
|
styles: `
|
|
:host {
|
|
max-width: 100%;
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
transition: text-indent 1s;
|
|
|
|
&:hover {
|
|
text-indent: var(--indent, 0);
|
|
text-overflow: clip;
|
|
}
|
|
}
|
|
`,
|
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
})
|
|
export class TickerComponent {
|
|
constructor(private readonly elementRef: ElementRef<HTMLElement>) {}
|
|
|
|
@HostBinding('style.--indent.px')
|
|
indent = 0
|
|
|
|
@HostListener('mouseenter')
|
|
onMouseEnter() {
|
|
const { scrollWidth, clientWidth } = this.elementRef.nativeElement
|
|
this.indent = Math.ceil(clientWidth - scrollWidth)
|
|
}
|
|
}
|