ma-dino-game 0.1.6 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,59 +1,54 @@
1
1
  {
2
2
  "name": "ma-dino-game",
3
- "version": "0.1.6",
3
+ "version": "0.3.0",
4
4
  "description": "Dino Game",
5
- "main": "build/lib.js",
6
- "module": "build/lib.js",
7
- "types": "build/lib.d.ts",
5
+ "main": "build/index.js",
6
+ "module": "build/index.esm.js",
7
+ "types": "build/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./build/index.d.ts",
11
+ "react-server": "./build/index.esm.js",
12
+ "import": "./build/index.esm.js",
13
+ "require": "./build/index.js",
14
+ "default": "./build/index.js"
15
+ },
16
+ "./package.json": "./package.json"
17
+ },
8
18
  "files": [
9
19
  "build"
10
20
  ],
21
+ "sideEffects": [
22
+ "*.css"
23
+ ],
11
24
  "license": "MIT",
12
25
  "peerDependencies": {
13
- "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
14
- "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
26
+ "react": ">=16.8.0",
27
+ "react-dom": ">=16.8.0"
28
+ },
29
+ "peerDependenciesMeta": {
30
+ "react": {
31
+ "optional": false
32
+ },
33
+ "react-dom": {
34
+ "optional": false
35
+ }
15
36
  },
16
- "dependencies": {},
17
37
  "scripts": {
18
- "start": "react-scripts start",
19
- "build": "tsc -p tsconfig.build.json && npm run copy-css",
20
- "copy-css": "cp src/components/DinoGame/dino.css build/components/DinoGame/",
21
- "test": "react-scripts test",
22
- "eject": "react-scripts eject",
38
+ "build": "rollup -c",
23
39
  "prepublishOnly": "npm run build"
24
40
  },
25
41
  "devDependencies": {
26
- "@testing-library/dom": "^10.4.1",
27
- "@testing-library/jest-dom": "^6.9.1",
28
- "@testing-library/react": "^16.3.1",
29
- "@testing-library/user-event": "^13.5.0",
30
- "@types/jest": "^27.5.2",
31
- "@types/node": "^16.18.126",
42
+ "@rollup/plugin-commonjs": "^29.0.0",
43
+ "@rollup/plugin-node-resolve": "^16.0.3",
44
+ "@rollup/plugin-typescript": "^12.3.0",
32
45
  "@types/react": "^19.2.7",
33
46
  "@types/react-dom": "^19.2.3",
34
47
  "react": "^19.2.3",
35
48
  "react-dom": "^19.2.3",
36
- "react-scripts": "5.0.1",
37
- "react-scripts-ts": "latest",
38
- "typescript": "^4.9.5",
39
- "web-vitals": "^2.1.4"
40
- },
41
- "eslintConfig": {
42
- "extends": [
43
- "react-app",
44
- "react-app/jest"
45
- ]
46
- },
47
- "browserslist": {
48
- "production": [
49
- ">0.2%",
50
- "not dead",
51
- "not op_mini all"
52
- ],
53
- "development": [
54
- "last 1 chrome version",
55
- "last 1 firefox version",
56
- "last 1 safari version"
57
- ]
49
+ "rollup": "^4.54.0",
50
+ "rollup-plugin-peer-deps-external": "^2.2.4",
51
+ "rollup-plugin-postcss": "^4.0.2",
52
+ "typescript": "^4.9.5"
58
53
  }
59
54
  }
@@ -1,15 +0,0 @@
1
- {
2
- "files": {
3
- "main.css": "/static/css/main.10fa8405.css",
4
- "main.js": "/static/js/main.3f3fd9bc.js",
5
- "static/js/453.e1b8a3ee.chunk.js": "/static/js/453.e1b8a3ee.chunk.js",
6
- "index.html": "/index.html",
7
- "main.10fa8405.css.map": "/static/css/main.10fa8405.css.map",
8
- "main.3f3fd9bc.js.map": "/static/js/main.3f3fd9bc.js.map",
9
- "453.e1b8a3ee.chunk.js.map": "/static/js/453.e1b8a3ee.chunk.js.map"
10
- },
11
- "entrypoints": [
12
- "static/css/main.10fa8405.css",
13
- "static/js/main.3f3fd9bc.js"
14
- ]
15
- }
@@ -1,231 +0,0 @@
1
- /* $border-color: #333; */
2
- /* $bg-color: #fff;
3
- 50px: 50px;
4
- $cactus-color: red; */
5
-
6
- .game {
7
- width: 600px;
8
- height: 200px;
9
- border: 2px solid #333;
10
- margin: 100px auto;
11
- position: relative;
12
- overflow: hidden;
13
- background: #fff;
14
-
15
- .dino {
16
- width: 50px;
17
- height: 50px;
18
- position: absolute;
19
- bottom: 0;
20
- left: 50px;
21
- }
22
-
23
- .cactus {
24
- width: 50px;
25
- position: absolute;
26
- bottom: 0;
27
- left: 600px;
28
- animation: moveCactus 2s linear infinite;
29
- }
30
-
31
- .score {
32
- position: absolute;
33
- top: 10px;
34
- left: 10px;
35
- font-weight: bold;
36
- }
37
-
38
- @keyframes moveCactus {
39
- from {
40
- left: 600px;
41
- }
42
- to {
43
- left: -20px;
44
- }
45
- }
46
- }
47
-
48
-
49
- .game {
50
- position: relative;
51
- width: 600px;
52
- height: 200px;
53
- margin: 100px auto;
54
- overflow: hidden;
55
- border: 2px solid #333;
56
- background: #cceffc; /* Light sky */
57
- }
58
-
59
- /* Ground bar */
60
- .ground {
61
- position: absolute;
62
- bottom: 0;
63
- width: 100%;
64
- }
65
-
66
- /* Cloud base style */
67
- .cloud {
68
- position: absolute;
69
- width: 80px;
70
- height: 40px;
71
- background: #fff;
72
- border-radius: 50px;
73
- opacity: 0.7;
74
- animation: moveCloud 30s linear infinite;
75
- }
76
-
77
- .cloud::before,
78
- .cloud::after {
79
- content: '';
80
- position: absolute;
81
- background: #fff;
82
- border-radius: 50%;
83
- }
84
-
85
- .cloud::before {
86
- width: 40px;
87
- height: 40px;
88
- top: -10px;
89
- left: 10px;
90
- }
91
-
92
- .cloud::after {
93
- width: 30px;
94
- height: 30px;
95
- top: 0;
96
- left: 40px;
97
- }
98
-
99
- /* Different starting positions */
100
- .cloud1 {
101
- top: 20px;
102
- left: 100%;
103
- animation-delay: 0s;
104
- }
105
-
106
- .cloud2 {
107
- top: 60px;
108
- left: 150%;
109
- animation-delay: 10s;
110
- }
111
-
112
- /* Cloud movement */
113
- @keyframes moveCloud {
114
- 0% {
115
- left: 100%;
116
- }
117
- 100% {
118
- left: -100px;
119
- }
120
- }
121
-
122
-
123
- .mountains {
124
- position: absolute;
125
- bottom: 0px; /* just above ground */
126
- width: 100%;
127
- height: 100px;
128
- pointer-events: none;
129
- }
130
-
131
- /* Common mountain styles */
132
- .mountain {
133
- position: absolute;
134
- bottom: 0;
135
- width: 120px;
136
- height: 100px;
137
- background: #99b3cc; /* mountain color */
138
- clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
139
- opacity: 0.8;
140
- }
141
-
142
- .mountain1 {
143
- left: 100px;
144
- height: 90px;
145
- width: 120px;
146
- background: #89aacc;
147
- }
148
-
149
- .mountain2 {
150
- left: 300px;
151
- height: 50px;
152
- width: 50px;
153
- background: #7799bb;
154
- }
155
-
156
-
157
- .tree {
158
- position: absolute;
159
- bottom: 0px; /* sit on ground */
160
- width: 10px;
161
- height: 20px;
162
- background: #3e6131; /* Tree trunk color */
163
- animation: moveTree 12s linear infinite;
164
- z-index: 0;
165
- }
166
-
167
- /* Tree foliage (just using ::before) */
168
- .tree::before {
169
- content: '';
170
- position: absolute;
171
- bottom: 15px;
172
- left: -10px;
173
- width: 30px;
174
- height: 25px;
175
- background: #4caf50;
176
- border-radius: 50%;
177
- z-index: -1;
178
- }
179
-
180
- /* Individual tree positions */
181
- .tree1 {
182
- left: 50%;
183
- animation-delay: 0s;
184
- }
185
- .tree2 {
186
- left: 100%;
187
- animation-delay: 5s;
188
- }
189
- .tree3 {
190
- left: 150%;
191
- animation-delay: 10s;
192
- }
193
-
194
- /* Tree movement animation */
195
- @keyframes moveTree {
196
- 0% {
197
- left: 100%;
198
- }
199
- 100% {
200
- left: -40px;
201
- }
202
- }
203
-
204
-
205
- .bumpy-wrapper {
206
- position: absolute;
207
- bottom: 0;
208
- width: 100%;
209
- height: 20px;
210
- overflow: hidden;
211
- }
212
-
213
- .bumpy-svg {
214
- position: absolute;
215
- width: 200%; /* double width for seamless scroll */
216
- height: 100%;
217
- animation: moveBumps 10s linear infinite;
218
- }
219
-
220
- .bumpy-path {
221
- fill: #888;
222
- }
223
-
224
- @keyframes moveBumps {
225
- from {
226
- transform: translateX(0);
227
- }
228
- to {
229
- transform: translateX(-50%);
230
- }
231
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DinoGame/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAC3D,OAAO,YAAY,CAAC;AAEpB,QAAA,MAAM,QAAQ,yBAqHb,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -1,112 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- var react_1 = __importStar(require("react"));
27
- require("./dino.css");
28
- var DinoGame = function () {
29
- var dinoRef = (0, react_1.useRef)(null);
30
- var cactusRef = (0, react_1.useRef)(null);
31
- var _a = (0, react_1.useState)(0), score = _a[0], setScore = _a[1];
32
- var _b = (0, react_1.useState)(false), isJumping = _b[0], setIsJumping = _b[1];
33
- var gameOver = false;
34
- // Jump Logic
35
- var jump = function () {
36
- if (isJumping || gameOver)
37
- return;
38
- setIsJumping(true);
39
- var pos = 0;
40
- var upInterval = setInterval(function () {
41
- if (pos >= 90) {
42
- clearInterval(upInterval);
43
- var downInterval_1 = setInterval(function () {
44
- if (pos <= 0) {
45
- clearInterval(downInterval_1);
46
- setIsJumping(false);
47
- }
48
- else {
49
- pos -= 4;
50
- if (dinoRef.current)
51
- dinoRef.current.style.bottom = "".concat(pos, "px");
52
- }
53
- }, 25);
54
- }
55
- else {
56
- pos += 4;
57
- if (dinoRef.current)
58
- dinoRef.current.style.bottom = "".concat(pos, "px");
59
- }
60
- }, 20);
61
- };
62
- // Key listener
63
- (0, react_1.useEffect)(function () {
64
- var handleKey = function (e) {
65
- if (e.code === 'Space' || e.code === 'ArrowUp')
66
- jump();
67
- };
68
- window.addEventListener('keydown', handleKey);
69
- return function () { return window.removeEventListener('keydown', handleKey); };
70
- }, [isJumping, gameOver]);
71
- // Collision + Score Logic
72
- (0, react_1.useEffect)(function () {
73
- var interval = setInterval(function () {
74
- if (!gameOver && dinoRef.current && cactusRef.current) {
75
- var dinoRect = dinoRef.current.getBoundingClientRect();
76
- var cactusRect = cactusRef.current.getBoundingClientRect();
77
- if (cactusRect.left < dinoRect.right &&
78
- cactusRect.right > dinoRect.left &&
79
- cactusRect.bottom > dinoRect.top) {
80
- // setGameOver(true);
81
- // cactusRef.current.style.animationPlayState = 'paused';
82
- // alert('Game Over! Final Score: ' + score);
83
- }
84
- else {
85
- setScore(function (prev) { return prev + 1; });
86
- }
87
- }
88
- }, 100);
89
- return function () { return clearInterval(interval); };
90
- }, [gameOver, score]);
91
- return (react_1.default.createElement("div", { className: "game" },
92
- react_1.default.createElement("div", { className: "mountains" },
93
- react_1.default.createElement("div", { className: "mountain mountain1" }),
94
- react_1.default.createElement("div", { className: "mountain mountain2" })),
95
- react_1.default.createElement("div", { className: "bumpy-wrapper" },
96
- react_1.default.createElement("svg", { className: "bumpy-svg", viewBox: "0 0 600 100", preserveAspectRatio: "none" },
97
- react_1.default.createElement("path", { className: "bumpy-path", d: "M0,100 \n L0,80 \n Q30,60 60,80 \n Q90,40 120,80 \n Q150,60 180,70 \n Q210,30 240,80 \n Q270,50 300,70 \n Q330,40 360,80 \n Q390,60 420,70 \n Q450,50 480,80 \n Q510,60 540,70 \n Q570,55 600,80 \n L600,100 Z" }))),
98
- react_1.default.createElement("div", { className: "tree tree1" }),
99
- react_1.default.createElement("div", { className: "tree tree2" }),
100
- react_1.default.createElement("div", { className: "tree tree3" }),
101
- react_1.default.createElement("div", { className: "cloud cloud1" }),
102
- react_1.default.createElement("div", { className: "cloud cloud2" }),
103
- react_1.default.createElement("div", { className: "ground" }),
104
- react_1.default.createElement("div", { ref: dinoRef, className: "dino" },
105
- react_1.default.createElement("img", { style: { width: '100%' }, src: "https://img.itch.zone/aW1hZ2UvNTA5MzIwLzI2NDIzNTEucG5n/347x500/kwmG6Z.png" })),
106
- react_1.default.createElement("div", { ref: cactusRef, className: "cactus" },
107
- react_1.default.createElement("img", { style: { width: '100%' }, src: "https://img.itch.zone/aW1hZ2UvNTA5MzIwLzI2NDIzNTcucG5n/347x500/%2FqbQKf.png" })),
108
- react_1.default.createElement("div", { className: "score" },
109
- "Score: ",
110
- score)));
111
- };
112
- exports.default = DinoGame;
package/build/favicon.ico DELETED
Binary file
Binary file
package/build/index.html DELETED
@@ -1 +0,0 @@
1
- <!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>React App</title><script defer="defer" src="/static/js/main.3f3fd9bc.js"></script><link href="/static/css/main.10fa8405.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
@@ -1 +0,0 @@
1
- {"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../src/lib.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC"}
package/build/lib.js DELETED
@@ -1,10 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.default = exports.DinoGame = void 0;
7
- var DinoGame_1 = require("./components/DinoGame");
8
- Object.defineProperty(exports, "DinoGame", { enumerable: true, get: function () { return __importDefault(DinoGame_1).default; } });
9
- var DinoGame_2 = require("./components/DinoGame");
10
- Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(DinoGame_2).default; } });
package/build/logo192.png DELETED
Binary file
package/build/logo512.png DELETED
Binary file
@@ -1,25 +0,0 @@
1
- {
2
- "short_name": "React App",
3
- "name": "Create React App Sample",
4
- "icons": [
5
- {
6
- "src": "favicon.ico",
7
- "sizes": "64x64 32x32 24x24 16x16",
8
- "type": "image/x-icon"
9
- },
10
- {
11
- "src": "logo192.png",
12
- "type": "image/png",
13
- "sizes": "192x192"
14
- },
15
- {
16
- "src": "logo512.png",
17
- "type": "image/png",
18
- "sizes": "512x512"
19
- }
20
- ],
21
- "start_url": ".",
22
- "display": "standalone",
23
- "theme_color": "#000000",
24
- "background_color": "#ffffff"
25
- }
package/build/robots.txt DELETED
@@ -1,3 +0,0 @@
1
- # https://www.robotstxt.org/robotstxt.html
2
- User-agent: *
3
- Disallow:
@@ -1,2 +0,0 @@
1
- body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;margin:0}code{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}.game{background:#fff;.dino{height:50px;left:50px}.cactus,.dino{bottom:0;position:absolute;width:50px}.cactus{animation:moveCactus 2s linear infinite;left:600px}.score{font-weight:700;left:10px;position:absolute;top:10px}@keyframes moveCactus{0%{left:600px}to{left:-20px}}}.game{background:#cceffc;border:2px solid #333;height:200px;margin:100px auto;overflow:hidden;position:relative;width:600px}.ground{bottom:0;position:absolute;width:100%}.cloud{animation:moveCloud 30s linear infinite;background:#fff;border-radius:50px;height:40px;opacity:.7;position:absolute;width:80px}.cloud:after,.cloud:before{background:#fff;border-radius:50%;content:"";position:absolute}.cloud:before{height:40px;left:10px;top:-10px;width:40px}.cloud:after{height:30px;left:40px;top:0;width:30px}.cloud1{animation-delay:0s;left:100%;top:20px}.cloud2{animation-delay:10s;left:150%;top:60px}@keyframes moveCloud{0%{left:100%}to{left:-100px}}.mountains{pointer-events:none;width:100%}.mountain,.mountains{bottom:0;height:100px;position:absolute}.mountain{background:#99b3cc;-webkit-clip-path:polygon(50% 0,0 100%,100% 100%);clip-path:polygon(50% 0,0 100%,100% 100%);opacity:.8;width:120px}.mountain1{background:#89aacc;height:90px;left:100px;width:120px}.mountain2{background:#79b;height:50px;left:300px;width:50px}.tree{animation:moveTree 12s linear infinite;background:#3e6131;bottom:0;height:20px;position:absolute;width:10px;z-index:0}.tree:before{background:#4caf50;border-radius:50%;bottom:15px;content:"";height:25px;left:-10px;position:absolute;width:30px;z-index:-1}.tree1{animation-delay:0s;left:50%}.tree2{animation-delay:5s;left:100%}.tree3{animation-delay:10s;left:150%}@keyframes moveTree{0%{left:100%}to{left:-40px}}.bumpy-wrapper{bottom:0;height:20px;overflow:hidden;position:absolute;width:100%}.bumpy-svg{animation:moveBumps 10s linear infinite;height:100%;position:absolute;width:200%}.bumpy-path{fill:#888}@keyframes moveBumps{0%{transform:translateX(0)}to{transform:translateX(-50%)}}
2
- /*# sourceMappingURL=main.10fa8405.css.map*/
@@ -1 +0,0 @@
1
- {"version":3,"file":"static/css/main.10fa8405.css","mappings":"AAAA,KAKE,kCAAmC,CACnC,iCAAkC,CAJlC,mIAEY,CAHZ,QAMF,CAEA,KACE,uEAEF,CCPA,MAOE,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B,UAAW,CAIX,UACF,CAGA,OAEE,kBAAmB,CADnB,QAEF,CACA,OAEE,kBAAmB,CADnB,SAEF,CACA,OAEE,mBAAoB,CADpB,SAEF,CAGA,oBACE,GACE,SACF,CACA,GACE,UACF,CACF,CAGA,eAEE,QAAS,CAET,WAAY,CACZ,eAAgB,CAJhB,iBAAkB,CAElB,UAGF,CAEA,WAIE,uCAAwC,CADxC,WAAY,CAFZ,iBAAkB,CAClB,UAGF,CAEA,YACE,SACF,CAEA,qBACE,GACE,uBACF,CACA,GACE,0BACF,CACF","sources":["index.css","components/DinoGame/dino.css"],"sourcesContent":["body {\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',\n 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',\n sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',\n monospace;\n}\n","/* $border-color: #333; */\n/* $bg-color: #fff;\n50px: 50px;\n$cactus-color: red; */\n\n.game {\n width: 600px;\n height: 200px;\n border: 2px solid #333;\n margin: 100px auto;\n position: relative;\n overflow: hidden;\n background: #fff;\n\n .dino {\n width: 50px;\n height: 50px;\n position: absolute;\n bottom: 0;\n left: 50px;\n }\n\n .cactus {\n width: 50px;\n position: absolute;\n bottom: 0;\n left: 600px;\n animation: moveCactus 2s linear infinite;\n }\n\n .score {\n position: absolute;\n top: 10px;\n left: 10px;\n font-weight: bold;\n }\n\n @keyframes moveCactus {\n from {\n left: 600px;\n }\n to {\n left: -20px;\n }\n }\n}\n\n\n.game {\n position: relative;\n width: 600px;\n height: 200px;\n margin: 100px auto;\n overflow: hidden;\n border: 2px solid #333;\n background: #cceffc; /* Light sky */\n}\n\n/* Ground bar */\n.ground {\n position: absolute;\n bottom: 0;\n width: 100%;\n}\n\n/* Cloud base style */\n.cloud {\n position: absolute;\n width: 80px;\n height: 40px;\n background: #fff;\n border-radius: 50px;\n opacity: 0.7;\n animation: moveCloud 30s linear infinite;\n}\n\n.cloud::before,\n.cloud::after {\n content: '';\n position: absolute;\n background: #fff;\n border-radius: 50%;\n}\n\n.cloud::before {\n width: 40px;\n height: 40px;\n top: -10px;\n left: 10px;\n}\n\n.cloud::after {\n width: 30px;\n height: 30px;\n top: 0;\n left: 40px;\n}\n\n/* Different starting positions */\n.cloud1 {\n top: 20px;\n left: 100%;\n animation-delay: 0s;\n}\n\n.cloud2 {\n top: 60px;\n left: 150%;\n animation-delay: 10s;\n}\n\n/* Cloud movement */\n@keyframes moveCloud {\n 0% {\n left: 100%;\n }\n 100% {\n left: -100px;\n }\n}\n\n\n.mountains {\n position: absolute;\n bottom: 0px; /* just above ground */\n width: 100%;\n height: 100px;\n pointer-events: none;\n}\n\n/* Common mountain styles */\n.mountain {\n position: absolute;\n bottom: 0;\n width: 120px;\n height: 100px;\n background: #99b3cc; /* mountain color */\n clip-path: polygon(50% 0%, 0% 100%, 100% 100%);\n opacity: 0.8;\n}\n\n.mountain1 {\n left: 100px;\n height: 90px;\n width: 120px;\n background: #89aacc;\n}\n\n.mountain2 {\n left: 300px;\n height: 50px;\n width: 50px;\n background: #7799bb;\n}\n\n\n.tree {\n position: absolute;\n bottom: 0px; /* sit on ground */\n width: 10px;\n height: 20px;\n background: #3e6131; /* Tree trunk color */\n animation: moveTree 12s linear infinite;\n z-index: 0;\n}\n\n/* Tree foliage (just using ::before) */\n.tree::before {\n content: '';\n position: absolute;\n bottom: 15px;\n left: -10px;\n width: 30px;\n height: 25px;\n background: #4caf50;\n border-radius: 50%;\n z-index: -1;\n}\n\n/* Individual tree positions */\n.tree1 {\n left: 50%;\n animation-delay: 0s;\n}\n.tree2 {\n left: 100%;\n animation-delay: 5s;\n}\n.tree3 {\n left: 150%;\n animation-delay: 10s;\n}\n\n/* Tree movement animation */\n@keyframes moveTree {\n 0% {\n left: 100%;\n }\n 100% {\n left: -40px;\n }\n}\n\n\n.bumpy-wrapper {\n position: absolute;\n bottom: 0;\n width: 100%;\n height: 20px;\n overflow: hidden;\n}\n\n.bumpy-svg {\n position: absolute;\n width: 200%; /* double width for seamless scroll */\n height: 100%;\n animation: moveBumps 10s linear infinite;\n}\n\n.bumpy-path {\n fill: #888;\n}\n\n@keyframes moveBumps {\n from {\n transform: translateX(0);\n }\n to {\n transform: translateX(-50%);\n }\n}\n"],"names":[],"ignoreList":[],"sourceRoot":""}
@@ -1,2 +0,0 @@
1
- "use strict";(self.webpackChunkma_dino_game=self.webpackChunkma_dino_game||[]).push([[453],{453(e,t,n){n.d(t,{getCLS:()=>y,getFCP:()=>g,getFID:()=>C,getLCP:()=>P,getTTFB:()=>D});var i,r,a,o,u=function(e,t){return{name:e,value:void 0===t?-1:t,delta:0,entries:[],id:"v2-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12)}},c=function(e,t){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){if("first-input"===e&&!("PerformanceEventTiming"in self))return;var n=new PerformanceObserver(function(e){return e.getEntries().map(t)});return n.observe({type:e,buffered:!0}),n}}catch(e){}},f=function(e,t){var n=function n(i){"pagehide"!==i.type&&"hidden"!==document.visibilityState||(e(i),t&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)},s=function(e){addEventListener("pageshow",function(t){t.persisted&&e(t)},!0)},m=function(e,t,n){var i;return function(r){t.value>=0&&(r||n)&&(t.delta=t.value-(i||0),(t.delta||void 0===i)&&(i=t.value,e(t)))}},v=-1,d=function(){return"hidden"===document.visibilityState?0:1/0},p=function(){f(function(e){var t=e.timeStamp;v=t},!0)},l=function(){return v<0&&(v=d(),p(),s(function(){setTimeout(function(){v=d(),p()},0)})),{get firstHiddenTime(){return v}}},g=function(e,t){var n,i=l(),r=u("FCP"),a=function(e){"first-contentful-paint"===e.name&&(f&&f.disconnect(),e.startTime<i.firstHiddenTime&&(r.value=e.startTime,r.entries.push(e),n(!0)))},o=window.performance&&performance.getEntriesByName&&performance.getEntriesByName("first-contentful-paint")[0],f=o?null:c("paint",a);(o||f)&&(n=m(e,r,t),o&&a(o),s(function(i){r=u("FCP"),n=m(e,r,t),requestAnimationFrame(function(){requestAnimationFrame(function(){r.value=performance.now()-i.timeStamp,n(!0)})})}))},h=!1,T=-1,y=function(e,t){h||(g(function(e){T=e.value}),h=!0);var n,i=function(t){T>-1&&e(t)},r=u("CLS",0),a=0,o=[],v=function(e){if(!e.hadRecentInput){var t=o[0],i=o[o.length-1];a&&e.startTime-i.startTime<1e3&&e.startTime-t.startTime<5e3?(a+=e.value,o.push(e)):(a=e.value,o=[e]),a>r.value&&(r.value=a,r.entries=o,n())}},d=c("layout-shift",v);d&&(n=m(i,r,t),f(function(){d.takeRecords().map(v),n(!0)}),s(function(){a=0,T=-1,r=u("CLS",0),n=m(i,r,t)}))},E={passive:!0,capture:!0},w=new Date,L=function(e,t){i||(i=t,r=e,a=new Date,F(removeEventListener),S())},S=function(){if(r>=0&&r<a-w){var e={entryType:"first-input",name:i.type,target:i.target,cancelable:i.cancelable,startTime:i.timeStamp,processingStart:i.timeStamp+r};o.forEach(function(t){t(e)}),o=[]}},b=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){L(e,t),r()},i=function(){r()},r=function(){removeEventListener("pointerup",n,E),removeEventListener("pointercancel",i,E)};addEventListener("pointerup",n,E),addEventListener("pointercancel",i,E)}(t,e):L(t,e)}},F=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach(function(t){return e(t,b,E)})},C=function(e,t){var n,a=l(),v=u("FID"),d=function(e){e.startTime<a.firstHiddenTime&&(v.value=e.processingStart-e.startTime,v.entries.push(e),n(!0))},p=c("first-input",d);n=m(e,v,t),p&&f(function(){p.takeRecords().map(d),p.disconnect()},!0),p&&s(function(){var a;v=u("FID"),n=m(e,v,t),o=[],r=-1,i=null,F(addEventListener),a=d,o.push(a),S()})},k={},P=function(e,t){var n,i=l(),r=u("LCP"),a=function(e){var t=e.startTime;t<i.firstHiddenTime&&(r.value=t,r.entries.push(e),n())},o=c("largest-contentful-paint",a);if(o){n=m(e,r,t);var v=function(){k[r.id]||(o.takeRecords().map(a),o.disconnect(),k[r.id]=!0,n(!0))};["keydown","click"].forEach(function(e){addEventListener(e,v,{once:!0,capture:!0})}),f(v,!0),s(function(i){r=u("LCP"),n=m(e,r,t),requestAnimationFrame(function(){requestAnimationFrame(function(){r.value=performance.now()-i.timeStamp,k[r.id]=!0,n(!0)})})})}},D=function(e){var t,n=u("TTFB");t=function(){try{var t=performance.getEntriesByType("navigation")[0]||function(){var e=performance.timing,t={entryType:"navigation",startTime:0};for(var n in e)"navigationStart"!==n&&"toJSON"!==n&&(t[n]=Math.max(e[n]-e.navigationStart,0));return t}();if(n.value=n.delta=t.responseStart,n.value<0||n.value>performance.now())return;n.entries=[t],e(n)}catch(e){}},"complete"===document.readyState?setTimeout(t,0):addEventListener("load",function(){return setTimeout(t,0)})}}}]);
2
- //# sourceMappingURL=453.e1b8a3ee.chunk.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"static/js/453.e1b8a3ee.chunk.js","mappings":"kLAAA,IAAIA,EAAEC,EAAEC,EAAEC,EAAEC,EAAE,SAASJ,EAAEC,GAAG,MAAM,CAACI,KAAKL,EAAEM,WAAM,IAASL,GAAG,EAAEA,EAAEM,MAAM,EAAEC,QAAQ,GAAGC,GAAG,MAAMC,OAAOC,KAAKC,MAAM,KAAKF,OAAOG,KAAKC,MAAM,cAAcD,KAAKE,UAAU,MAAM,EAAEC,EAAE,SAAShB,EAAEC,GAAG,IAAI,GAAGgB,oBAAoBC,oBAAoBC,SAASnB,GAAG,CAAC,GAAG,gBAAgBA,KAAK,2BAA2BoB,MAAM,OAAO,IAAIlB,EAAE,IAAIe,oBAAqB,SAASjB,GAAG,OAAOA,EAAEqB,aAAaC,IAAIrB,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AAS5B,GAAG+B,EAAE9B,EAAE,OAAOF,EAAE+B,EAAEjC,EAAEkC,EAAEjC,GAAG+C,sBAAuB,WAAWA,sBAAuB,WAAWd,EAAE5B,MAAMwC,YAAYlC,MAAMT,EAAEkC,UAAUgC,EAAEnC,EAAEzB,KAAI,EAAGP,GAAE,EAAG,EAAG,EAAG,EAAG,CAAC,EAAEsE,EAAE,SAASxE,GAAG,IAAIC,EAAEC,EAAEE,EAAE,QAAQH,EAAE,WAAW,IAAI,IAAIA,EAAE6C,YAAY2B,iBAAiB,cAAc,IAAI,WAAW,IAAIzE,EAAE8C,YAAY4B,OAAOzE,EAAE,CAAC6D,UAAU,aAAanB,UAAU,GAAG,IAAI,IAAIzC,KAAKF,EAAE,oBAAoBE,GAAG,WAAWA,IAAID,EAAEC,GAAGW,KAAK8D,IAAI3E,EAAEE,GAAGF,EAAE4E,gBAAgB,IAAI,OAAO3E,CAAC,CAAjL,GAAqL,GAAGC,EAAEI,MAAMJ,EAAEK,MAAMN,EAAE4E,cAAc3E,EAAEI,MAAM,GAAGJ,EAAEI,MAAMwC,YAAYlC,MAAM,OAAOV,EAAEM,QAAQ,CAACP,GAAGD,EAAEE,EAAE,CAAC,MAAMF,GAAG,CAAC,EAAE,aAAa2B,SAASmD,WAAWvC,WAAWtC,EAAE,GAAG6B,iBAAiB,OAAQ,WAAW,OAAOS,WAAWtC,EAAE,EAAE,EAAG,C","sources":["../node_modules/web-vitals/dist/web-vitals.js"],"sourcesContent":["var e,t,n,i,r=function(e,t){return{name:e,value:void 0===t?-1:t,delta:0,entries:[],id:\"v2-\".concat(Date.now(),\"-\").concat(Math.floor(8999999999999*Math.random())+1e12)}},a=function(e,t){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){if(\"first-input\"===e&&!(\"PerformanceEventTiming\"in self))return;var n=new PerformanceObserver((function(e){return e.getEntries().map(t)}));return n.observe({type:e,buffered:!0}),n}}catch(e){}},o=function(e,t){var n=function n(i){\"pagehide\"!==i.type&&\"hidden\"!==document.visibilityState||(e(i),t&&(removeEventListener(\"visibilitychange\",n,!0),removeEventListener(\"pagehide\",n,!0)))};addEventListener(\"visibilitychange\",n,!0),addEventListener(\"pagehide\",n,!0)},u=function(e){addEventListener(\"pageshow\",(function(t){t.persisted&&e(t)}),!0)},c=function(e,t,n){var i;return function(r){t.value>=0&&(r||n)&&(t.delta=t.value-(i||0),(t.delta||void 0===i)&&(i=t.value,e(t)))}},f=-1,s=function(){return\"hidden\"===document.visibilityState?0:1/0},m=function(){o((function(e){var t=e.timeStamp;f=t}),!0)},v=function(){return f<0&&(f=s(),m(),u((function(){setTimeout((function(){f=s(),m()}),0)}))),{get firstHiddenTime(){return f}}},d=function(e,t){var n,i=v(),o=r(\"FCP\"),f=function(e){\"first-contentful-paint\"===e.name&&(m&&m.disconnect(),e.startTime<i.firstHiddenTime&&(o.value=e.startTime,o.entries.push(e),n(!0)))},s=window.performance&&performance.getEntriesByName&&performance.getEntriesByName(\"first-contentful-paint\")[0],m=s?null:a(\"paint\",f);(s||m)&&(n=c(e,o,t),s&&f(s),u((function(i){o=r(\"FCP\"),n=c(e,o,t),requestAnimationFrame((function(){requestAnimationFrame((function(){o.value=performance.now()-i.timeStamp,n(!0)}))}))})))},p=!1,l=-1,h=function(e,t){p||(d((function(e){l=e.value})),p=!0);var n,i=function(t){l>-1&&e(t)},f=r(\"CLS\",0),s=0,m=[],v=function(e){if(!e.hadRecentInput){var t=m[0],i=m[m.length-1];s&&e.startTime-i.startTime<1e3&&e.startTime-t.startTime<5e3?(s+=e.value,m.push(e)):(s=e.value,m=[e]),s>f.value&&(f.value=s,f.entries=m,n())}},h=a(\"layout-shift\",v);h&&(n=c(i,f,t),o((function(){h.takeRecords().map(v),n(!0)})),u((function(){s=0,l=-1,f=r(\"CLS\",0),n=c(i,f,t)})))},T={passive:!0,capture:!0},y=new Date,g=function(i,r){e||(e=r,t=i,n=new Date,w(removeEventListener),E())},E=function(){if(t>=0&&t<n-y){var r={entryType:\"first-input\",name:e.type,target:e.target,cancelable:e.cancelable,startTime:e.timeStamp,processingStart:e.timeStamp+t};i.forEach((function(e){e(r)})),i=[]}},S=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;\"pointerdown\"==e.type?function(e,t){var n=function(){g(e,t),r()},i=function(){r()},r=function(){removeEventListener(\"pointerup\",n,T),removeEventListener(\"pointercancel\",i,T)};addEventListener(\"pointerup\",n,T),addEventListener(\"pointercancel\",i,T)}(t,e):g(t,e)}},w=function(e){[\"mousedown\",\"keydown\",\"touchstart\",\"pointerdown\"].forEach((function(t){return e(t,S,T)}))},L=function(n,f){var s,m=v(),d=r(\"FID\"),p=function(e){e.startTime<m.firstHiddenTime&&(d.value=e.processingStart-e.startTime,d.entries.push(e),s(!0))},l=a(\"first-input\",p);s=c(n,d,f),l&&o((function(){l.takeRecords().map(p),l.disconnect()}),!0),l&&u((function(){var a;d=r(\"FID\"),s=c(n,d,f),i=[],t=-1,e=null,w(addEventListener),a=p,i.push(a),E()}))},b={},F=function(e,t){var n,i=v(),f=r(\"LCP\"),s=function(e){var t=e.startTime;t<i.firstHiddenTime&&(f.value=t,f.entries.push(e),n())},m=a(\"largest-contentful-paint\",s);if(m){n=c(e,f,t);var d=function(){b[f.id]||(m.takeRecords().map(s),m.disconnect(),b[f.id]=!0,n(!0))};[\"keydown\",\"click\"].forEach((function(e){addEventListener(e,d,{once:!0,capture:!0})})),o(d,!0),u((function(i){f=r(\"LCP\"),n=c(e,f,t),requestAnimationFrame((function(){requestAnimationFrame((function(){f.value=performance.now()-i.timeStamp,b[f.id]=!0,n(!0)}))}))}))}},P=function(e){var t,n=r(\"TTFB\");t=function(){try{var t=performance.getEntriesByType(\"navigation\")[0]||function(){var e=performance.timing,t={entryType:\"navigation\",startTime:0};for(var n in e)\"navigationStart\"!==n&&\"toJSON\"!==n&&(t[n]=Math.max(e[n]-e.navigationStart,0));return t}();if(n.value=n.delta=t.responseStart,n.value<0||n.value>performance.now())return;n.entries=[t],e(n)}catch(e){}},\"complete\"===document.readyState?setTimeout(t,0):addEventListener(\"load\",(function(){return setTimeout(t,0)}))};export{h as getCLS,d as getFCP,L as getFID,F as getLCP,P as getTTFB};\n"],"names":["e","t","n","i","r","name","value","delta","entries","id","concat","Date","now","Math","floor","random","a","PerformanceObserver","supportedEntryTypes","includes","self","getEntries","map","observe","type","buffered","o","document","visibilityState","removeEventListener","addEventListener","u","persisted","c","f","s","m","timeStamp","v","setTimeout","firstHiddenTime","d","disconnect","startTime","push","window","performance","getEntriesByName","requestAnimationFrame","p","l","h","hadRecentInput","length","takeRecords","T","passive","capture","y","g","w","E","entryType","target","cancelable","processingStart","forEach","S","L","b","F","once","P","getEntriesByType","timing","max","navigationStart","responseStart","readyState"],"ignoreList":[],"sourceRoot":""}