T
TyphonJS•2w ago
geoidesic

Get dynamic application width

I think there was a way to do this? I had a look at essential-svelte-esm but couldn't quite grok how to access application width from within my svelte app shell?
3 Replies
geoidesic
geoidesicOP•2w ago
Thought I'd figured it out:
const application = getContext("#external").application;
const position = application.position;

console.log('position width', $position.width);
const application = getContext("#external").application;
const position = application.position;

console.log('position width', $position.width);
But that's not dynamic 😦 But this is dynamic:
const application = getContext("#external").application;
const { top, left, width, height, rotateX, rotateY, rotateZ, scale, zIndex } = application.position.stores;
const application = getContext("#external").application;
const { top, left, width, height, rotateX, rotateY, rotateZ, scale, zIndex } = application.position.stores;
Solved!
TyphonJS (Michael)
TyphonJS (Michael)•2w ago
Yep... You got it! Do check out that side slide layer demo in essential-svelte-esm... I think it might work wonders for that "targeting" idea you tried to implement in chat cards.
geoidesic
geoidesicOP•7d ago
Thanks I will do that when I get a chance.!
Want results from more Discord servers?
Add your server