Pra3t0r5

Untitled

Nov 12th, 2019
85
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //HTML - JAVASCRIPT PURO
  2. <script type="text/javascript">
  3. //Obtenes las hojas/reglas/propiedades (podes navegarlas)
  4.     var rule = document.styleSheets[1].cssRules[19];
  5.     var sheet = document.styleSheets[1]
  6.     //console.log(sheet)
  7.     //console.log(rule)
  8.  
  9. //ejemplo de cambio dinamico (se ejecuta antes de terminar el renderizado de la pagina
  10.     function change(angulo) {
  11.         rule.deleteRule("50%");
  12.         rule.deleteRule("100%");
  13.  
  14.         var angle1 = Math.floor(Math.random() * (angulo - angulo / 1.2) + angulo / 1.2);
  15.         var angle2 = angulo;
  16.         rule.appendRule("50% { -webkit-transform: rotateX(" + angle1 + "deg);}");
  17.         rule.appendRule("100% { -webkit-transform: rotateX(" + angle2 + "deg);}");
  18.     }
  19. </script>
  20.  
  21. //ANGULAR
  22. import Keyframes from '@keyframes/core';
  23. //...
  24. constructor(private renderer: Renderer2, private http: HttpClient) {
  25.        
  26.         angulo = Math.floor(Math.random() * (angulo - angulo / 1.2) + angulo / 1.2);
  27.  
  28.         Keyframes.define([{
  29.             name: 'x-spin',
  30.             '0%': { transform: 'rotateX(0)' },
  31.             '30%': { transform: 'rotateX(' + angulo / 2 + 'deg)' },
  32.             '100%': { transform: 'rotateX(' + angulo + 'deg)' }
  33.         }]);
  34.     }
  35. //...
  36. ngOnInit(): void {
  37.         const ring = new Keyframes(document.getElementById('ring-1'));
  38.         ring.play(
  39.             'x-spin 4s linear 0s forwards',
  40.  
  41.         );
  42.         setInterval(function () {
  43.             ring.play(
  44.                 'x-spin 4s linear 0s forwards',
  45.  
  46.             );
  47.         }, 6000);
  48.         console.log(document.body)
  49.     }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×