Skip to content

Commit

Permalink
Merge pull request #61 from basementstudio/mati/fixes
Browse files Browse the repository at this point in the history
Mobile fixes
  • Loading branch information
matiasperz authored Oct 16, 2023
2 parents 104dd47 + 642ea58 commit 00f347f
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changeset/great-forks-smash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@bsmnt/scrollytelling": patch
---

- Fix visualizer size and content issues on mobile viewports
14 changes: 10 additions & 4 deletions scrollytelling/src/components/debugger/visualizer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -463,8 +463,10 @@ export const Visualizer = () => {
);
})}
</Select>
<div className={s['actions']}>

<button
className={s["scrollToRoot"]}
className={clsx(s["button"], s["scrollToRoot"])}
onClick={() => {
const triggerElement = root?.tween?.scrollTrigger?.trigger;
if (triggerElement) {
Expand All @@ -486,8 +488,12 @@ export const Visualizer = () => {
stroke-linejoin="round"
/>
</svg>
SCROLL TO ROOT

<span className={s['text']}>
SCROLL TO ROOT
</span>
</button>
</div>
</div>

<div className={s["actions"]}>
Expand Down Expand Up @@ -631,8 +637,8 @@ export const Visualizer = () => {
</main>
<footer className={s["footer"]}>
<span>
Visualizer -{" "}
<span className={s["version"]}>v.{libPackage.version}</span>
Visualizer
<span className={s["version"]}> (v.{libPackage.version})</span>
</span>
<span>
made with 🖤 by{" "}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,22 +57,27 @@
align-items: center;

.button {
height: 24px;
width: 24px;
padding: 4px;
border-radius: 4px;
background: var(--color-gray);
border: 1px solid var(--color-gray-light);

svg {
width: 100%;
width: 14px;
height: 14px;
}
}

.scrollToRoot {
display: flex;
align-items: center;
padding-left: 8px;
padding-right: 8px;
gap: 0 8px;
padding: 0 8px;

.text {
transform: translateY(0.05em);
}
}
}
}
Expand Down Expand Up @@ -331,5 +336,15 @@
.root {
left: 50%;
transform: translateX(-50%);

.version {
display: none;
}

.scrollToRoot {
.text {
display: none;
}
}
}
}

1 comment on commit 00f347f

@vercel
Copy link

@vercel vercel bot commented on 00f347f Oct 16, 2023

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.