Guest User

Untitled

a guest
Dec 19th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. const el = document.querySelector(`#el`); // My el with changing opacity
  2.  
  3.  
  4. const args = {
  5. frequency:1000, //Tried with low and high frequency
  6. decimalCount:2
  7. };
  8.  
  9.  
  10. let gn = new GyroNorm();
  11.  
  12. gn.init(args).then(function(){
  13. gn.start(function(data){
  14.  
  15. let opacity = data.dm.gx; // my opacity
  16. el.querySelector(`#fond`).style.opacity = opacity;
  17.  
  18. });
  19. }).catch(function(e){
  20. // log err
  21. });
  22.  
  23. #el {
  24. transition: opacity 50ms;
  25. }
Add Comment
Please, Sign In to add comment