ray-angle-interpolation-math-functions.html (1530B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title>ray() angle interpolation with css math functions</title> 6 <link rel="author" title="Daniil Sakhapov" href="mailto:sakhapov@chromium.org"> 7 <link rel="help" href="https://drafts.fxtf.org/motion/#offset-path-property"> 8 <link rel="help" href="https://drafts.csswg.org/css-values/#sign-funcs"> 9 <script src="/resources/testharness.js"></script> 10 <script src="/resources/testharnessreport.js"></script> 11 <script src="/css/support/interpolation-testcommon.js"></script> 12 </head> 13 <style> 14 :root { 15 font-size: 10px; 16 } 17 </style> 18 <body> 19 <script> 20 test_interpolation({ 21 property: 'offset-path', 22 from: 'ray(100deg)', 23 to: 'ray(calc(sign(20rem - 20px) * 180deg))', 24 }, [ 25 {at: -1, expect: 'ray(20deg)'}, 26 {at: 0, expect: 'ray(100deg)'}, 27 {at: 0.125, expect: 'ray(110deg)'}, 28 {at: 0.875, expect: 'ray(170deg)'}, 29 {at: 1, expect: 'ray(180deg)'}, 30 {at: 2, expect: 'ray(260deg)'} 31 ]); 32 33 test_interpolation({ 34 property: 'offset-path', 35 from: 'ray(calc(sign(20rem - 20px) * 100deg))', 36 to: 'ray(calc(sign(20rem - 20px) * 180deg))', 37 }, [ 38 {at: -1, expect: 'ray(20deg)'}, 39 {at: 0, expect: 'ray(100deg)'}, 40 {at: 0.125, expect: 'ray(110deg)'}, 41 {at: 0.875, expect: 'ray(170deg)'}, 42 {at: 1, expect: 'ray(180deg)'}, 43 {at: 2, expect: 'ray(260deg)'} 44 ]); 45 </script> 46 </body> 47 </html>