Skip to content

Commit eb8f01e

Browse files
author
ml-241
authored
Update rive animations small nits (#272)
1 parent cb9c014 commit eb8f01e

File tree

3 files changed

+25
-10
lines changed

3 files changed

+25
-10
lines changed

fern/assets/styles.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -940,6 +940,12 @@ a[href*="changelog"] svg {
940940
pointer-events: none;
941941
}
942942

943+
/* Fade out effect for AI animation */
944+
.rive-container.fade-bottom {
945+
mask: linear-gradient(to bottom, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
946+
-webkit-mask: linear-gradient(to bottom, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
947+
}
948+
943949
.rive-container canvas {
944950
width: 100%;
945951
height: 100%;

fern/products/home/pages/welcome.mdx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,11 @@ import { FernFooter } from "../../../components/FernFooter";
132132
</div>
133133

134134
{/* Rive Animation */}
135-
<div class="rive-container">
136-
<canvas id="docs-rive-canvas"></canvas>
137-
</div>
135+
<a href="/docs/getting-started/overview" style="cursor: pointer; text-decoration: none;">
136+
<div class="rive-container fade-bottom">
137+
<canvas id="docs-rive-canvas"></canvas>
138+
</div>
139+
</a>
138140

139141
<div className="action-buttons-vertical">
140142
<a className="fern-button filled normal primary gap-1 w-fit a-btn" href="/docs/getting-started/overview">
@@ -190,9 +192,11 @@ import { FernFooter } from "../../../components/FernFooter";
190192
</div>
191193

192194
{/* Rive Animation */}
193-
<div class="rive-container">
194-
<canvas id="ai-rive-canvas"></canvas>
195-
</div>
195+
<a href="/ask-fern/getting-started/what-is-ask-fern" style="cursor: pointer; text-decoration: none;">
196+
<div class="rive-container fade-bottom">
197+
<canvas id="ai-rive-canvas"></canvas>
198+
</div>
199+
</a>
196200

197201
<div className="action-buttons">
198202
<a className="fern-button filled normal primary gap-1 a-btn" href="/ask-fern/getting-started/what-is-ask-fern">

fern/rive-animation.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,11 @@
128128

129129
// Setup dynamic cursor changes based on Rive's interactive areas
130130
function setupDynamicCursor(canvas, riveInstance, stateMachine) {
131+
// Skip dynamic cursor if canvas is wrapped in an anchor tag
132+
if (canvas.closest('a')) {
133+
return;
134+
}
135+
131136
canvas.addEventListener('mousemove', (event) => {
132137
try {
133138
const rect = canvas.getBoundingClientRect();
@@ -255,7 +260,7 @@
255260
// Docs Animation
256261
createRiveAnimation({
257262
canvasSelector: '#docs-rive-canvas',
258-
riveUrl: 'https://cdn.prod.website-files.com/67880ff570cdb1a85eee946f/68825994c55f0eece04ce4e2_d261956a0f627eb6b94c39aa9fcc26f0_docs_animation.riv',
263+
riveUrl: 'https://cdn.prod.website-files.com/67880ff570cdb1a85eee946f/68825994c55f0eece04ce4e2_9a50e77828a014e927d67fa21d3edf9d_docs_animation.riv',
259264
aspectRatio: 404/262,
260265
stateMachine: "State Machine 1",
261266
fallbackImages: [
@@ -276,7 +281,7 @@
276281
// AI Animation with custom event handling
277282
createRiveAnimation({
278283
canvasSelector: '#ai-rive-canvas',
279-
riveUrl: 'https://cdn.prod.website-files.com/67880ff570cdb1a85eee946f/68825e97fd6225e1c8a7488c_c2966309b38902c92adfe24c2dc8ba5a_ai_animation.riv',
284+
riveUrl: 'https://cdn.prod.website-files.com/67880ff570cdb1a85eee946f/68825e97fd6225e1c8a7488c_c1ab3eed9babdbd0f2333f092d16e2d1_ai_animation.riv',
280285
aspectRatio: 371/99,
281286
stateMachine: "State Machine 1",
282287
fallbackImages: [
@@ -291,13 +296,13 @@
291296
alt: 'AI Animation Preview'
292297
}
293298
],
294-
eventHandlers: {
299+
/* eventHandlers: {
295300
'Open URL': (eventData) => {
296301
// Custom URL handling for AI animation, URL is defined in the Rive file
297302
console.log('AI animation URL event:', eventData.url);
298303
window.open(eventData.url, '_blank', 'noopener,noreferrer');
299304
}
300-
}
305+
} */
301306
});
302307

303308
// Add additional Rive animations by calling createRiveAnimation() with your config

0 commit comments

Comments
 (0)