Skip to content

Commit e71d5e8

Browse files
committed
added resize and mutation observer
1 parent d9bd8d4 commit e71d5e8

File tree

5 files changed

+249
-176
lines changed

5 files changed

+249
-176
lines changed

docs/src/components/ForesightPreview/index.tsx

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,6 @@ export default function ForesightPreview(): ReactNode {
2727
</div>
2828
<div className={styles.descriptionText}>
2929
Hover over or move your cursor toward any button to see how Foresight predicts user intent.
30-
{debugMode && (
31-
<p>
32-
Debug mode is active - you can see the trajectory visualization and adjust settings in
33-
the panel.
34-
</p>
35-
)}
3630
</div>
3731
<section className={styles.features}>
3832
<InteractiveButton color="#3498db" label="Button 1" name="button-name" />
@@ -42,10 +36,6 @@ export default function ForesightPreview(): ReactNode {
4236
<InteractiveButton color="#9b59b6" label="Button 5" />
4337
<InteractiveButton color="#1abc9c" label="Button 6" />
4438
</section>
45-
<div className={styles.statsPanel}>
46-
<p>Move your cursor toward a button to see intent prediction in action.</p>
47-
<p>The callback will trigger before you physically hover the element.</p>
48-
</div>
4939
</div>
5040
)
5141
}
@@ -66,6 +56,7 @@ function InteractiveButton({ color, label, name }: InteractiveButtonProps) {
6656
buttonRef.current,
6757
() => {
6858
setActivated(true)
59+
unregister()
6960
setTimeout(() => setActivated(false), 1000)
7061
},
7162
40, // Add hit slop of 40px around the button

docs/src/components/ForesightPreview/styles.module.css

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,11 @@
5555
display: flex;
5656
flex-wrap: wrap;
5757
align-items: center;
58-
justify-content: center;
58+
justify-content: space-between;
5959
gap: 1.5rem;
6060
padding: 3rem 0;
6161
width: 100%;
6262
min-height: 300px;
63-
background-color: #fff;
64-
border-radius: 8px;
65-
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
6663
}
6764

6865
.previewButton {
@@ -86,16 +83,6 @@
8683
animation: pulse 1s cubic-bezier(0.4, 0, 0.6, 1);
8784
}
8885

89-
.statsPanel {
90-
margin-top: 2rem;
91-
padding: 1.5rem;
92-
background-color: #ffffff;
93-
border: 1px solid #e9ecef;
94-
border-radius: 8px;
95-
color: #495057;
96-
text-align: center;
97-
}
98-
9986
@keyframes pulse {
10087
0%,
10188
100% {

js.foresight-0.0.14.tgz

59.1 KB
Binary file not shown.

0 commit comments

Comments
 (0)