UNPKG

awv3

Version:
2,025 lines (2,024 loc) 693 kB
{ "type": "Program", "start": 0, "end": 5409, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 150, "column": 0 } }, "sourceType": "module", "body": [ { "type": "ImportDeclaration", "start": 0, "end": 26, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 26 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 7, "end": 12, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 12 } }, "local": { "type": "Identifier", "start": 7, "end": 12, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 12 } }, "name": "THREE" } } ], "importKind": "value", "source": { "type": "Literal", "start": 18, "end": 25, "loc": { "start": { "line": 1, "column": 18 }, "end": { "line": 1, "column": 25 } }, "value": "three", "rawValue": "three", "raw": "'three'" } }, { "type": "ImportDeclaration", "start": 28, "end": 69, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 41 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 35, "end": 42, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 14 } }, "local": { "type": "Identifier", "start": 35, "end": 42, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 14 } }, "name": "Object3" } } ], "importKind": "value", "source": { "type": "Literal", "start": 48, "end": 68, "loc": { "start": { "line": 2, "column": 20 }, "end": { "line": 2, "column": 40 } }, "value": "awv3/three/object3", "rawValue": "awv3/three/object3", "raw": "'awv3/three/object3'" } }, { "type": "VariableDeclaration", "start": 73, "end": 123, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 50 } }, "declarations": [ { "type": "VariableDeclarator", "start": 77, "end": 122, "loc": { "start": { "line": 4, "column": 4 }, "end": { "line": 4, "column": 49 } }, "id": { "type": "Identifier", "start": 77, "end": 85, "loc": { "start": { "line": 4, "column": 4 }, "end": { "line": 4, "column": 12 } }, "name": "canvas2d" }, "init": { "type": "CallExpression", "start": 88, "end": 122, "loc": { "start": { "line": 4, "column": 15 }, "end": { "line": 4, "column": 49 } }, "callee": { "type": "MemberExpression", "start": 88, "end": 110, "loc": { "start": { "line": 4, "column": 15 }, "end": { "line": 4, "column": 37 } }, "object": { "type": "Identifier", "start": 88, "end": 96, "loc": { "start": { "line": 4, "column": 15 }, "end": { "line": 4, "column": 23 } }, "name": "document" }, "property": { "type": "Identifier", "start": 97, "end": 110, "loc": { "start": { "line": 4, "column": 24 }, "end": { "line": 4, "column": 37 } }, "name": "createElement" }, "computed": false }, "arguments": [ { "type": "Literal", "start": 112, "end": 120, "loc": { "start": { "line": 4, "column": 39 }, "end": { "line": 4, "column": 47 } }, "value": "canvas", "rawValue": "canvas", "raw": "'canvas'" } ] } } ], "kind": "var" }, { "type": "ExpressionStatement", "start": 125, "end": 146, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 21 } }, "expression": { "type": "AssignmentExpression", "start": 125, "end": 145, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 20 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 125, "end": 139, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 14 } }, "object": { "type": "Identifier", "start": 125, "end": 133, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 8 } }, "name": "canvas2d" }, "property": { "type": "Identifier", "start": 134, "end": 139, "loc": { "start": { "line": 5, "column": 9 }, "end": { "line": 5, "column": 14 } }, "name": "width" }, "computed": false }, "right": { "type": "Literal", "start": 142, "end": 145, "loc": { "start": { "line": 5, "column": 17 }, "end": { "line": 5, "column": 20 } }, "value": 128, "rawValue": 128, "raw": "128" } } }, { "type": "ExpressionStatement", "start": 148, "end": 170, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 22 } }, "expression": { "type": "AssignmentExpression", "start": 148, "end": 169, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 21 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 148, "end": 163, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 15 } }, "object": { "type": "Identifier", "start": 148, "end": 156, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 8 } }, "name": "canvas2d" }, "property": { "type": "Identifier", "start": 157, "end": 163, "loc": { "start": { "line": 6, "column": 9 }, "end": { "line": 6, "column": 15 } }, "name": "height" }, "computed": false }, "right": { "type": "Literal", "start": 166, "end": 169, "loc": { "start": { "line": 6, "column": 18 }, "end": { "line": 6, "column": 21 } }, "value": 128, "rawValue": 128, "raw": "128" } } }, { "type": "VariableDeclaration", "start": 172, "end": 214, "loc": { "start": { "line": 7, "column": 0 }, "end": { "line": 7, "column": 42 } }, "declarations": [ { "type": "VariableDeclarator", "start": 176, "end": 213, "loc": { "start": { "line": 7, "column": 4 }, "end": { "line": 7, "column": 41 } }, "id": { "type": "Identifier", "start": 176, "end": 183, "loc": { "start": { "line": 7, "column": 4 }, "end": { "line": 7, "column": 11 } }, "name": "context" }, "init": { "type": "CallExpression", "start": 186, "end": 213, "loc": { "start": { "line": 7, "column": 14 }, "end": { "line": 7, "column": 41 } }, "callee": { "type": "MemberExpression", "start": 186, "end": 205, "loc": { "start": { "line": 7, "column": 14 }, "end": { "line": 7, "column": 33 } }, "object": { "type": "Identifier", "start": 186, "end": 194, "loc": { "start": { "line": 7, "column": 14 }, "end": { "line": 7, "column": 22 } }, "name": "canvas2d" }, "property": { "type": "Identifier", "start": 195, "end": 205, "loc": { "start": { "line": 7, "column": 23 }, "end": { "line": 7, "column": 33 } }, "name": "getContext" }, "computed": false }, "arguments": [ { "type": "Literal", "start": 207, "end": 211, "loc": { "start": { "line": 7, "column": 35 }, "end": { "line": 7, "column": 39 } }, "value": "2d", "rawValue": "2d", "raw": "'2d'" } ] } } ], "kind": "var" }, { "type": "VariableDeclaration", "start": 216, "end": 367, "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 8, "column": 151 } }, "declarations": [ { "type": "VariableDeclarator", "start": 220, "end": 366, "loc": { "start": { "line": 8, "column": 4 }, "end": { "line": 8, "column": 150 } }, "id": { "type": "Identifier", "start": 220, "end": 228, "loc": { "start": { "line": 8, "column": 4 }, "end": { "line": 8, "column": 12 } }, "name": "gradient" }, "init": { "type": "CallExpression", "start": 231, "end": 366, "loc": { "start": { "line": 8, "column": 15 }, "end": { "line": 8, "column": 150 } }, "callee": { "type": "MemberExpression", "start": 231, "end": 259, "loc": { "start": { "line": 8, "column": 15 }, "end": { "line": 8, "column": 43 } }, "object": { "type": "Identifier", "start": 231, "end": 238, "loc": { "start": { "line": 8, "column": 15 }, "end": { "line": 8, "column": 22 } }, "name": "context" }, "property": { "type": "Identifier", "start": 239, "end": 259, "loc": { "start": { "line": 8, "column": 23 }, "end": { "line": 8, "column": 43 } }, "name": "createRadialGradient" }, "computed": false }, "arguments": [ { "type": "BinaryExpression", "start": 261, "end": 279, "loc": { "start": { "line": 8, "column": 45 }, "end": { "line": 8, "column": 63 } }, "left": { "type": "MemberExpression", "start": 261, "end": 275, "loc": { "start": { "line": 8, "column": 45 }, "end": { "line": 8, "column": 59 } }, "object": { "type": "Identifier", "start": 261, "end": 269, "loc": { "start": { "line": 8, "column": 45 }, "end": { "line": 8, "column": 53 } }, "name": "canvas2d" }, "property": { "type": "Identifier", "start": 270, "end": 275, "loc": { "start": { "line": 8, "column": 54 }, "end": { "line": 8, "column": 59 } }, "name": "width" }, "computed": false }, "operator": "/", "right": { "type": "Literal", "start": 278, "end": 279, "loc": { "start": { "line": 8, "column": 62 }, "end": { "line": 8, "column": 63 } }, "value": 2, "rawValue": 2, "raw": "2" } }, { "type": "BinaryExpression", "start": 281, "end": 300, "loc": { "start": { "line": 8, "column": 65 }, "end": { "line": 8, "column": 84 } }, "left": { "type": "MemberExpression", "start": 281, "end": 296, "loc": { "start": { "line": 8, "column": 65 }, "end": { "line": 8, "column": 80 } }, "object": { "type": "Identifier", "start": 281, "end": 289, "loc": { "start": { "line": 8, "column": 65 }, "end": { "line": 8, "column": 73 } }, "name": "canvas2d" }, "property": { "type": "Identifier", "start": 290, "end": 296, "loc": { "start": { "line": 8, "column": 74 }, "end": { "line": 8, "column": 80 } }, "name": "height" }, "computed": false }, "operator": "/", "right": { "type": "Literal", "start": 299, "end": 300, "loc": { "start": { "line": 8, "column": 83 }, "end": { "line": 8, "column": 84 } }, "value": 2, "rawValue": 2, "raw": "2" } }, { "type": "Literal", "start": 302, "end": 303, "loc": { "start": { "line": 8, "column": 86 }, "end": { "line": 8, "column": 87 } }, "value": 0, "rawValue": 0, "raw": "0" }, { "type": "BinaryExpression", "start": 305, "end": 323, "loc": { "start": { "line": 8, "column": 89 }, "end": { "line": 8, "column": 107 } }, "left": { "type": "MemberExpression", "start": 305, "end": 319, "loc": { "start": { "line": 8, "column": 89 }, "end": { "line": 8, "column": 103 } }, "object": { "type": "Identifier", "start": 305, "end": 313, "loc": { "start": { "line": 8, "column": 89 }, "end": { "line": 8, "column": 97 } }, "name": "canvas2d" }, "property": { "type": "Identifier", "start": 314, "end": 319, "loc": { "start": { "line": 8, "column": 98 }, "end": { "line": 8, "column": 103 } }, "name": "width" }, "computed": false }, "operator": "/", "right": { "type": "Literal", "start": 322, "end": 323, "loc": { "start": { "line": 8, "column": 106 }, "end": { "line": 8, "column": 107 } }, "value": 2, "rawValue": 2, "raw": "2" } }, { "type": "BinaryExpression", "start": 325, "end": 344, "loc": { "start": { "line": 8, "column": 109 }, "end": { "line": 8, "column": 128 } }, "left": { "type": "MemberExpression", "start": 325, "end": 340, "loc": { "start": { "line": 8, "column": 109 }, "end": { "line": 8, "column": 124 } }, "object": { "type": "Identifier", "start": 325, "end": 333, "loc": { "start": { "line": 8, "column": 109 }, "end": { "line": 8, "column": 117 } }, "name": "canvas2d" }, "property": { "type": "Identifier", "start": 334, "end": 340, "loc": { "start": { "line": 8, "column": 118 }, "end": { "line": 8, "column": 124 } }, "name": "height" }, "computed": false }, "operator": "/", "right": { "type": "Literal", "start": 343, "end": 344, "loc": { "start": { "line": 8, "column": 127 }, "end": { "line": 8, "column": 128 } }, "value": 2, "rawValue": 2, "raw": "2" } }, { "type": "BinaryExpression", "start": 346, "end": 364, "loc": { "start": { "line": 8, "column": 130 }, "end": { "line": 8, "column": 148 } }, "left": { "type": "MemberExpression", "start": 346, "end": 360, "loc": { "start": { "line": 8, "column": 130 }, "end": { "line": 8, "column": 144 } }, "object": { "type": "Identifier", "start": 346, "end": 354, "loc": { "start": { "line": 8, "column": 130 }, "end": { "line": 8, "column": 138 } }, "name": "canvas2d" }, "property": { "type": "Identifier", "start": 355, "end": 360, "loc": { "start": { "line": 8, "column": 139 }, "end": { "line": 8, "column": 144 } }, "name": "width" }, "computed": false }, "operator": "/", "right": { "type": "Literal", "start": 363, "end": 364, "loc": { "start": { "line": 8, "column": 147 }, "end": { "line": 8, "column": 148 } }, "value": 2, "rawValue": 2, "raw": "2" } } ] } } ], "kind": "var" }, { "type": "ExpressionStatement", "start": 369, "end": 418, "loc": { "start": { "line": 9, "column": 0 }, "end": { "line": 9, "column": 49 } }, "expression": { "type": "CallExpression", "start": 369, "end": 417, "loc": { "start": { "line": 9, "column": 0 }, "end": { "line": 9, "column": 48 } }, "callee": { "type": "MemberExpression", "start": 369, "end": 390, "loc": { "start": { "line": 9, "column": 0 }, "end": { "line": 9, "column": 21 } }, "object": { "type": "Identifier", "start": 369, "end": 377, "loc": { "start": { "line": 9, "column": 0 }, "end": { "line": 9, "column": 8 } }, "name": "gradient" }, "property": { "type": "Identifier", "start": 378, "end": 390, "loc": { "start": { "line": 9, "column": 9 }, "end": { "line": 9, "column": 21 } }, "name": "addColorStop" }, "computed": false }, "arguments": [ { "type": "Literal", "start": 392, "end": 395, "loc": { "start": { "line": 9, "column": 23 }, "end": { "line": 9, "column": 26 } }, "value": 0.1, "rawValue": 0.1, "raw": "0.1" }, { "type": "Literal", "start": 397, "end": 415, "loc": { "start": { "line": 9, "column": 28 }, "end": { "line": 9, "column": 46 } }, "value": "rgba(0,0,0,0.15)", "rawValue": "rgba(0,0,0,0.15)", "raw": "'rgba(0,0,0,0.15)'" } ] } }, { "type": "ExpressionStatement", "start": 420, "end": 464, "loc": { "start": { "line": 10, "column": 0 }, "end": { "line": 10, "column": 44 } }, "expression": { "type": "CallExpression", "start": 420, "end": 463, "loc": { "start": { "line": 10, "column": 0 }, "end": { "line": 10, "column": 43 } }, "callee": { "type": "MemberExpression", "start": 420, "end": 441, "loc": { "start": { "line": 10, "column": 0 }, "end": { "line": 10, "column": 21 } }, "object": { "type": "Identifier", "start": 420, "end": 428, "loc": { "start": { "line": 10, "column": 0 }, "end": { "line": 10, "column": 8 } }, "name": "gradient" }, "property": { "type": "Identifier", "start": 429, "end": 441, "loc": { "start": { "line": 10, "column": 9 }, "end": { "line": 10, "column": 21 } }, "name": "addColorStop" }, "computed": false }, "arguments": [ { "type": "Literal", "start": 443, "end": 444, "loc": { "start": { "line": 10, "column": 23 }, "end": { "line": 10, "column": 24 } }, "value": 1, "rawValue": 1, "raw": "1" }, { "type": "Literal", "start": 446, "end": 461, "loc": { "start": { "line": 10, "column": 26 }, "end": { "line": 10, "column": 41 } }, "value": "rgba(0,0,0,0)", "rawValue": "rgba(0,0,0,0)", "raw": "'rgba(0,0,0,0)'" } ] } }, { "type": "ExpressionStatement", "start": 466, "end": 495, "loc": { "start": { "line": 11, "column": 0 }, "end": { "line": 11, "column": 29 } }, "expression": { "type": "AssignmentExpression", "start": 466, "end": 494, "loc": { "start": { "line": 11, "column": 0 }, "end": { "line": 11, "column": 28 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 466, "end": 483, "loc": { "start": { "line": 11, "column": 0 }, "end": { "line": 11, "column": 17 } }, "object": { "type": "Identifier", "start": 466, "end": 473, "loc": { "start": { "line": 11, "column": 0 }, "end": { "line": 11, "column": 7 } }, "name": "context" }, "property": { "type": "Identifier", "start": 474, "end": 483, "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 11, "column": 17 } }, "name": "fillStyle" }, "computed": false }, "right": { "type": "Identifier", "start": 486, "end": 494, "loc": { "start": { "line": 11, "column": 20 }, "end": { "line": 11, "column": 28 } }, "name": "gradient" } } }, { "type": "ExpressionStatement", "start": 497, "end": 555, "loc": { "start": { "line": 12, "column": 0 }, "end": { "line": 12, "column": 58 } }, "expression": { "type": "CallExpression", "start": 497, "end": 554, "loc": { "start": { "line": 12, "column": 0 }, "end": { "line": 12, "column": 57 } }, "callee": { "type": "MemberExpression", "start": 497, "end": 513, "loc": { "start": { "line": 12, "column": 0 }, "end": { "line": 12, "column": 16 } }, "object": { "type": "Identifier", "start": 497, "end": 504, "loc": { "start": { "line": 12, "column": 0 }, "end": { "line": 12, "column": 7 } }, "name": "context" }, "property": { "type": "Identifier", "start": 505, "end": 513, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 16 } }, "name": "fillRect" }, "computed": false }, "arguments": [ { "type": "Literal", "start": 515, "end": 516, "loc": { "start": { "line": 12, "column": 18 }, "end": { "line": 12, "column": 19 } }, "value": 0, "rawValue": 0, "raw": "0" }, { "type": "Literal", "start": 518, "end": 519, "loc": { "start": { "line": 12, "column": 21 }, "end": { "line": 12, "column": 22 } }, "value": 0, "rawValue": 0, "raw": "0" }, { "type": "MemberExpression", "start": 521, "end": 535, "loc": { "start": { "line": 12, "column": 24 }, "end": { "line": 12, "column": 38 } }, "object": { "type": "Identifier", "start": 521, "end": 529, "loc": { "start": { "line": 12, "column": 24 }, "end": { "line": 12, "column": 32 } }, "name": "canvas2d" }, "property": { "type": "Identifier", "start": 530, "end": 535, "loc": { "start": { "line": 12, "column": 33 }, "end": { "line": 12, "column": 38 } }, "name": "width" }, "computed": false }, { "type": "MemberExpression", "start": 537, "end": 552, "loc": { "start": { "line": 12, "column": 40 }, "end": { "line": 12, "column": 55 } }, "object": { "type": "Identifier", "start": 537, "end": 545, "loc": { "start": { "line": 12, "column": 40 }, "end": { "line": 12, "column": 48 } }, "name": "canvas2d" }, "property": { "type": "Identifier", "start": 546, "end": 552, "loc": { "start": { "line": 12, "column": 49 }, "end": { "line": 12, "column": 55 } }, "name": "height" }, "computed": false } ] } }, { "type": "VariableDeclaration", "start": 557, "end": 613, "loc": { "start": { "line": 13, "column": 0 }, "end": { "line": 13, "column": 56 } }, "declarations": [ { "type": "VariableDeclarator", "start": 561, "end": 612, "loc": { "start": { "line": 13, "column": 4 }, "end": { "line": 13, "column": 55 } }, "id": { "type": "Identifier", "start": 561, "end": 574, "loc": { "start": { "line": 13, "column": 4 }, "end": { "line": 13, "column": 17 } }, "name": "shadowTexture" }, "init": { "type": "NewExpression", "start": 577, "end": 612, "loc": { "start": { "line": 13, "column": 20 }, "end": { "line": 13, "column": 55 } }, "callee": { "type": "MemberExpression", "start": 581, "end": 600, "loc": { "start": { "line": 13, "column": 24 }, "end": { "line": 13, "column": 43 } }, "object": { "type": "Identifier", "start": 581, "end": 586, "loc": { "start": { "line": 13, "column": 24 }, "end": { "line": 13, "column": 29 } }, "name": "THREE" }, "property": { "type": "Identifier", "start": 587, "end": 600, "loc": { "start": { "line": 13, "column": 30 }, "end": { "line": 13, "column": 43 } }, "name": "CanvasTexture" }, "computed": false }, "arguments": [ { "type": "Identifier", "start": 602, "end": 610, "loc": { "start": { "line": 13, "column": 45 }, "end": { "line": 13, "column": 53 } }, "name": "canvas2d" } ] } } ], "kind": "var" }, { "type": "VariableDeclaration", "start": 615, "end": 709, "loc": { "start": { "line": 14, "column": 0 }, "end": { "line": 14, "column": 94 } }, "declarations": [ { "type": "VariableDeclarator", "start": 619, "end": 708, "loc": { "start": { "line": 14, "column": 4 }, "end": { "line": 14, "column": 93 } }, "id": { "type": "Identifier", "start": 619, "end": 633, "loc": { "start": { "line": 14, "column": 4 }, "end": { "line": 14, "column": 18 } }, "name": "shadowMaterial" }, "init": { "type": "NewExpression", "start": 636, "end": 708, "loc": { "start": { "line": 14, "column": 21 }, "end": { "line": 14, "column": 93 } }, "callee": { "type": "MemberExpression", "start": 640, "end": 663, "loc": { "start": { "line": 14, "column": 25 }, "end": { "line": 14, "column": 48 } }, "object": { "type": "Identifier", "start": 640, "end": 645, "loc": { "start": { "line": 14, "column": 25 }, "end": { "line": 14, "column": 30 } }, "name": "THREE" }, "property": { "type": "Identifier", "start": 646, "end": 663, "loc": { "start": { "line": 14, "column": 31 }, "end": { "line": 14, "column": 48 } }, "name": "MeshBasicMaterial" }, "computed": false }, "arguments": [ { "type": "ObjectExpression", "start": 665, "end": 706, "loc": { "start": { "line": 14, "column": 50 }, "end": { "line": 14, "column": 91 } }, "properties": [ { "type": "Property", "start": 667, "end": 685, "loc": { "start": { "line": 14, "column": 52 }, "end": { "line": 14, "column": 70 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 667, "end": 670, "loc": { "start": { "line": 14, "column": 52 }, "end": { "line": 14, "column": 55 } }, "name": "map" }, "value": { "type": "Identifier", "start": 672, "end": 685, "loc": { "start": { "line": 14, "column": 57 }, "end": { "line": 14, "column": 70 } }, "name": "shadowTexture" }, "kind": "init" }, { "type": "Property", "start": 687, "end": 704, "loc": { "start": { "line": 14, "column": 72 }, "end": { "line": 14, "column": 89 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 687, "end": 698, "loc": { "start": { "line": 14, "column": 72 }, "end": { "line": 14, "column": 83 } },