Skip to content

Commit

Permalink
Improve resize action examples
Browse files Browse the repository at this point in the history
  • Loading branch information
techniq committed Oct 10, 2023
1 parent 72136d3 commit 94707cd
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/routes/docs/actions/observer/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
console.log(e.detail);
e.target.innerText = JSON.stringify(e.detail.contentRect, null, 2);
}}
class="resize overflow-auto bg-red-50"
class="resize overflow-auto whitespace-pre outline outline-gray-200 rounded"
/>
</Preview>

Expand All @@ -36,7 +36,7 @@
on:resize={(e) => {
e.target.innerText = JSON.stringify(e.target.getBoundingClientRect(), null, 2);
}}
class="resize overflow-auto bg-red-50"
class="resize overflow-auto whitespace-pre outline outline-gray-200 rounded"
/>
</Preview>

Expand All @@ -49,13 +49,11 @@
e.target.style.setProperty('--nodeWidth', e.detail.contentRect.width);
e.target.style.setProperty('--nodeHeight', e.detail.contentRect.height);
e.target.style.setProperty('--color', e.detail.contentRect.width % 255);
//e.target.style.setProperty('--rotate', e.detail.contentRect.width % 5 + 'deg');
}}
class="text-white"
style:background-color="rgb(var(--color), 0, 0)"
style:transform="rotate(var(--rotate))"
style:background-color="hsl(var(--color), 100%, 70%)"
class="resize overflow-auto p-2 rounded"
>
Inspect element as well
Resize and watch me change colors
</div>
</Preview>

Expand Down

1 comment on commit 94707cd

@vercel
Copy link

@vercel vercel bot commented on 94707cd Oct 10, 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.