UNPKG
@tbela99/css-parser
Version:
latest (1.4.2)
1.4.2
1.4.1
1.4.0
1.3.4
1.3.3
1.3.2
1.3.1
1.3.0
1.2.0
1.1.1
1.1.1-alpha4
1.1.0
1.0.0
0.9.1
0.9.0
0.8.0
0.7.1
0.7.0
0.6.0
0.5.4
0.5.3
0.5.2
0.5.1
0.5.0
0.4.1
0.4.0
0.3.0
0.2.0
0.1.0
0.0.1
0.0.1-rc7
0.0.1-rc6
0.0.1-rc5
0.0.1-rc4
0.0.1-rc3
0.0.1-rc2
0.0.1-rc1
0.0.1-alpha5
0.0.1-alpha4
0.0.1-alpha3
CSS parser for node and the browser
github.com/tbela99/css-parser
tbela99/css-parser
@tbela99/css-parser
/
dist
/
lib
/
ast
/
transform
/
perspective.js
11 lines
(8 loc)
•
302 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
import
{ identity, multiply }
from
'./utils.js'
;
function
perspective
(
x,
from
) {
const
matrix =
identity
();
// @ts-ignore
matrix[
2
][
3
] =
typeof
x ==
'object'
&& x.
val
==
'none'
?
0
: x ==
0
?
Number
.
NEGATIVE_INFINITY
: -
1
/ x;
return
multiply
(
from
, matrix); }
export
{ perspective };