Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const el = document.querySelector(`#el`); // My el with changing opacity
- const args = {
- frequency:1000, //Tried with low and high frequency
- decimalCount:2
- };
- let gn = new GyroNorm();
- gn.init(args).then(function(){
- gn.start(function(data){
- let opacity = data.dm.gx; // my opacity
- el.querySelector(`#fond`).style.opacity = opacity;
- });
- }).catch(function(e){
- // log err
- });
- #el {
- transition: opacity 50ms;
- }
Add Comment
Please, Sign In to add comment