Advertisement
Serafim

Untitled

Aug 14th, 2013
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 0.78 KB | None | 0 0
  1. @function pi(){
  2.   @return 3.14;
  3. }
  4.  
  5. // возведение в степень
  6. @function pow($val, $num){
  7.    $result: $num;
  8.    @for $i from 1 through $num{
  9.      $result: $result * $num;
  10.    }
  11.    @return $result;
  12. }
  13.  
  14.  
  15. @function sin($deg){
  16.   $c: 9; // точность тейлора (кратно 2+1)
  17.   $result: $deg;
  18.  
  19.   @for$i from 3 through $c{
  20.     $result: $result + pow($deg, $i) / тут_факториал_влом_пилить($i);
  21.     $i: $i+1;
  22.   }
  23.   @return $result;
  24. }
  25.  
  26. // и потом фигачишь:
  27. @mixin mrotate($deg){
  28.   @include rotate($deg);
  29.   $rad: ($deg * pi()) / 180;
  30.   $cos: cos($rad);
  31.   $sin: sin($rad);
  32.   filter: progid:DXImageTransform.Microsoft.Matrix(sizingMethod="auto expand", M11=#{$cos}, M12 = #{-$sin}, M21 =#{$sin}, M22 = #{$cos});
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement