Skip to content

Commit

Permalink
Merge pull request #73 from basementstudio/mati/new-fixes
Browse files Browse the repository at this point in the history
Bugfixing & UI corrections
  • Loading branch information
julianbenegas authored Jan 9, 2024
2 parents 0810e3b + fd8a066 commit 9b95176
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/tender-items-grin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@bsmnt/scrollytelling": patch
---

Visualizer bugfixing & UI corrections
5 changes: 5 additions & 0 deletions scrollytelling/src/components/debugger/visualizer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,11 @@ export const Visualizer = () => {
});
}, []);

useEffect(() => {
// Force refresh on mount
internalEventEmmiter.emit("timeline:refresh");
}, []);

if (dismiss) return <></>;

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@
align-items: center;

.button {
padding: 4px;
color: var(--color-white);
display: flex;
align-items: center;
height: 24px;
padding: 0px 4px;
border-radius: 4px;
background: var(--color-gray);
border: 1px solid var(--color-gray-light);
Expand Down Expand Up @@ -305,6 +309,7 @@
appearance: none;
cursor: pointer;
background: var(--color-gray);
color: var(--color-white);
border: 1px solid var(--color-gray-light);
height: 24px;
border-radius: 4px;
Expand Down
6 changes: 5 additions & 1 deletion scrollytelling/src/util/emmiter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,14 @@ export class Emitter {

// Return an unsubscribe function
return () => {
this.events[event] = this.events[event]?.filter((i) => cb !== i) ?? [];
this.off(event, cb);
};
}

off(event: string, cb: Callback) {
this.events[event] = this.events[event]?.filter((i) => cb !== i) ?? [];
}

destroy() {
this.events = {};
}
Expand Down

2 comments on commit 9b95176

@vercel
Copy link

@vercel vercel bot commented on 9b95176 Jan 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 9b95176 Jan 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.