robb0wen / tornis Goto Github PK
View Code? Open in Web Editor NEWTornis helps you watch and respond to changes in your browser's viewport ๐ฒ
Home Page: https://tornis.robbowen.digital
License: MIT License
Tornis helps you watch and respond to changes in your browser's viewport ๐ฒ
Home Page: https://tornis.robbowen.digital
License: MIT License
Hi,
Is it possible to add scroll direction to the scroll object?
Hello,
Thanks for the great work on tornis ! ๐
I encounter an error using tornis with a server-side rendering app.
Indeed, tornis use the window
object in his contructor but in ssr mode the window
object is not defined.
I make a workaround with a bridge which give me noop
function in server side and tornis in client side.
const isServer = typeof window === 'undefined'; let tornis = { watchViewport: _.noop, unwatchViewport: _.noop }; if (!isServer) { tornis = require('tornis'); } const { watchViewport, unwatchViewport } = tornis;
It will be great to add a security/condition in the constructor to avoid this kind of problem.
Do you want me to open a PR to fix this issue ?
Based on this descriptor... "Rather than bind directly to native events, Tornis throttles them and captures only the bare minimum - the updated values. An optimised render loop with the requestAnimationFrame api updates the store and provides the new state to any subscribed functions. This means that your code only runs when the store has changed, and when the browser is ready to render." is the rAF itself the 'throttle' (meaning conceptually throttle) or it is using vanillaJS throttle?
I am wondering on a few of the demo examples there is >1 second latency on some variables updating most notably the velocity measurements. I stop touch/mouse movement and more than a second later it finishes updating. This could be huge in touch events. Is that due to how the velocity is calculated? Any ideas on added performance overhead using this abstraction in something like scroll usin rAF? Ever used in conjunction with a batch read/write lib like FastDOM?
Thanks so much, super interesting library.
Hello and thanks for the great work on Tornis! ๐
I would love if this project had Type Definitions in order to include it in projects using TypeScript, but I don't know your thoughts on the topic, so please let me know. I have a fork of the project and I would love to contribute with that if its something you would like and add value to the library of course.
Hi there, I'm excited to use this super handy tool.
I was just wondering how it would perform if the package was invoked several times across components in a Gatsby/Next/Nuxt kind of SPA. Would these create performance issues at all?
Or is there a better way to handle this?
I noticed in package.json
that Babel's version is rather obsolete. The same is about:
...
"babel-core": "^6.26.3",
"babel-preset-env": "^1.7.0",
...
Is it possible update them without breaking library itself?
First of all, thanks for this library, it is what I need for a little project :)
I'm integrating Tornis in Wordpress, and for testing I've imported the entire demo page in Elementor.
All is working fine, except for document height, that's not correctly detected on first load of page (value = 0).
It will be detected ONLY if you resize the window after loading, or zoom in/out.
I've tried to disable all the non essential js on Wordpress, but nothing changes.
The only workaround I've found is to modify the code and use jQuery ( document ).height(); to pass the correct value.
It's not a big problem and I don't know if it's related to how Wordpress renders the page, but maybe is a little thing that can be fixed :)
Hello,
Is it possible to add the key module
in the package.json file to expose the es5 build ?
It will allow us to build our app in es5 mode.
Example : "module": "dist/tornis.es5.js",
Thanks,
Florent.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.