forked from CopilotKit/CopilotKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcustom-scroll-button.component.ts
More file actions
62 lines (59 loc) · 1.58 KB
/
Copy pathcustom-scroll-button.component.ts
File metadata and controls
62 lines (59 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import { Component, Input, Output, EventEmitter } from "@angular/core";
import { CommonModule } from "@angular/common";
@Component({
selector: "custom-scroll-button",
standalone: true,
imports: [CommonModule],
template: `
<button
type="button"
(click)="handleClick()"
[class]="inputClass"
[class.hover]="isHovered"
(mouseenter)="isHovered = true"
(mouseleave)="isHovered = false"
style="
position: fixed;
bottom: 100px;
right: 20px;
width: 60px;
height: 60px;
border-radius: 50%;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border: 3px solid white;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
cursor: pointer;
pointer-events: auto;
display: flex;
align-items: center;
justify-content: center;
transition: transform 0.2s;
z-index: 1000;
"
[style.transform]="isHovered ? 'scale(1.1)' : 'scale(1)'"
>
<span style="color: white; font-size: 24px; pointer-events: none">⬇️</span>
</button>
`,
styles: [
`
button.hover {
transform: scale(1.1);
}
`,
],
})
export class CustomScrollButtonComponent {
@Input() onClick?: () => void;
@Input() inputClass?: string;
@Output() clicked = new EventEmitter<void>();
isHovered = false;
handleClick() {
// Emit the clicked event for the slot system to handle
this.clicked.emit();
// Also call onClick if provided for backward compatibility
if (this.onClick) {
this.onClick();
}
}
}