create-analytics-demo 1.0.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.
@@ -0,0 +1,122 @@
1
+ import React from "react";
2
+ import { config } from "../demo.config";
3
+
4
+ const { theme } = config;
5
+
6
+ export const HomeScreen: React.FC = () => (
7
+ <div style={{ padding: "48px 12px 12px", height: "100%", overflow: "hidden" }}>
8
+ {/* Address bar */}
9
+ <div style={{ marginBottom: 12 }}>
10
+ <div style={{ fontSize: 9, color: theme.textSecondary, marginBottom: 2 }}>
11
+ DELIVERING TO
12
+ </div>
13
+ <div style={{ fontSize: 13, color: theme.textPrimary, fontWeight: "600" }}>
14
+ 123 Main Street
15
+ </div>
16
+ </div>
17
+
18
+ {/* Search */}
19
+ <div
20
+ style={{
21
+ background: theme.surface,
22
+ borderRadius: 12,
23
+ padding: "10px 12px",
24
+ marginBottom: 14,
25
+ border: `1px solid ${theme.stroke}`,
26
+ }}
27
+ >
28
+ <span style={{ color: theme.textSecondary, fontSize: 11 }}>
29
+ Search...
30
+ </span>
31
+ </div>
32
+
33
+ {/* Categories */}
34
+ <div style={{ marginBottom: 14 }}>
35
+ <div
36
+ style={{
37
+ fontSize: 13,
38
+ color: theme.textPrimary,
39
+ fontWeight: "600",
40
+ marginBottom: 8,
41
+ }}
42
+ >
43
+ Categories
44
+ </div>
45
+ <div
46
+ style={{
47
+ display: "grid",
48
+ gridTemplateColumns: "repeat(4, 1fr)",
49
+ gap: 6,
50
+ }}
51
+ >
52
+ {config.categories.map((cat, i) => (
53
+ <div
54
+ key={i}
55
+ style={{
56
+ background: theme.surface,
57
+ borderRadius: 10,
58
+ padding: "8px 4px",
59
+ textAlign: "center",
60
+ border: `1px solid ${theme.stroke}`,
61
+ }}
62
+ >
63
+ <div style={{ fontSize: 16 }}>{cat.emoji}</div>
64
+ <div style={{ fontSize: 7, color: theme.textSecondary, marginTop: 2 }}>
65
+ {cat.name}
66
+ </div>
67
+ </div>
68
+ ))}
69
+ </div>
70
+ </div>
71
+
72
+ {/* Featured */}
73
+ <div>
74
+ <div
75
+ style={{
76
+ fontSize: 13,
77
+ color: theme.textPrimary,
78
+ fontWeight: "600",
79
+ marginBottom: 8,
80
+ }}
81
+ >
82
+ Featured
83
+ </div>
84
+ <div
85
+ style={{
86
+ background: theme.surface,
87
+ borderRadius: 14,
88
+ overflow: "hidden",
89
+ border: `1px solid ${theme.stroke}`,
90
+ }}
91
+ >
92
+ <div
93
+ style={{
94
+ background: "linear-gradient(135deg, #2a2a3e, #1a1a2e)",
95
+ height: 70,
96
+ display: "flex",
97
+ alignItems: "center",
98
+ justifyContent: "center",
99
+ }}
100
+ >
101
+ <span style={{ fontSize: 28 }}>
102
+ {config.categories[0]?.emoji || ""}
103
+ </span>
104
+ </div>
105
+ <div style={{ padding: 10 }}>
106
+ <div
107
+ style={{
108
+ fontSize: 12,
109
+ color: theme.textPrimary,
110
+ fontWeight: "600",
111
+ }}
112
+ >
113
+ Featured Store
114
+ </div>
115
+ <div style={{ fontSize: 9, color: theme.textSecondary }}>
116
+ 4.8 - 20-30 min
117
+ </div>
118
+ </div>
119
+ </div>
120
+ </div>
121
+ </div>
122
+ );
@@ -0,0 +1,94 @@
1
+ import React from "react";
2
+ import { config } from "../demo.config";
3
+
4
+ const { theme } = config;
5
+
6
+ export const LoginScreen: React.FC<{ showSuccess?: boolean }> = ({
7
+ showSuccess = false,
8
+ }) => (
9
+ <div
10
+ style={{
11
+ height: "100%",
12
+ display: "flex",
13
+ flexDirection: "column",
14
+ padding: "60px 20px 20px",
15
+ background: `linear-gradient(160deg, ${theme.bg} 0%, ${theme.bgGradient} 100%)`,
16
+ }}
17
+ >
18
+ <div style={{ textAlign: "center", marginBottom: 30 }}>
19
+ <div
20
+ style={{
21
+ width: 70,
22
+ height: 70,
23
+ borderRadius: 18,
24
+ background: `linear-gradient(135deg, ${theme.accent}, ${theme.accentSoft})`,
25
+ display: "inline-flex",
26
+ alignItems: "center",
27
+ justifyContent: "center",
28
+ fontSize: 32,
29
+ color: "white",
30
+ fontWeight: "bold",
31
+ }}
32
+ >
33
+ {config.appName.charAt(0)}
34
+ </div>
35
+ <div
36
+ style={{
37
+ fontSize: 24,
38
+ color: theme.textPrimary,
39
+ fontWeight: "bold",
40
+ marginTop: 12,
41
+ }}
42
+ >
43
+ Welcome Back
44
+ </div>
45
+ </div>
46
+
47
+ {/* Email field */}
48
+ <div
49
+ style={{
50
+ background: theme.surface,
51
+ borderRadius: 12,
52
+ padding: "12px 14px",
53
+ marginBottom: 12,
54
+ border: `1px solid ${theme.stroke}`,
55
+ }}
56
+ >
57
+ <span style={{ color: theme.textSecondary, fontSize: 11 }}>
58
+ user@example.com
59
+ </span>
60
+ </div>
61
+
62
+ {/* Password field */}
63
+ <div
64
+ style={{
65
+ background: theme.surface,
66
+ borderRadius: 12,
67
+ padding: "12px 14px",
68
+ marginBottom: 20,
69
+ border: `1px solid ${theme.stroke}`,
70
+ }}
71
+ >
72
+ <span style={{ color: theme.textSecondary, fontSize: 11 }}>
73
+ ********
74
+ </span>
75
+ </div>
76
+
77
+ {/* Sign In button */}
78
+ <div
79
+ style={{
80
+ background: showSuccess
81
+ ? "linear-gradient(135deg, #44bb44, #33aa33)"
82
+ : `linear-gradient(135deg, ${theme.accent}, ${theme.accentSoft})`,
83
+ borderRadius: 14,
84
+ padding: "14px 18px",
85
+ textAlign: "center",
86
+ color: "white",
87
+ fontWeight: "600",
88
+ fontSize: 14,
89
+ }}
90
+ >
91
+ {showSuccess ? "Logged In!" : "Sign In"}
92
+ </div>
93
+ </div>
94
+ );
@@ -0,0 +1,53 @@
1
+ import React from "react";
2
+ import { config } from "../demo.config";
3
+
4
+ const { theme } = config;
5
+
6
+ export const SplashScreen: React.FC = () => (
7
+ <div
8
+ style={{
9
+ height: "100%",
10
+ display: "flex",
11
+ flexDirection: "column",
12
+ alignItems: "center",
13
+ justifyContent: "center",
14
+ background: `linear-gradient(160deg, ${theme.bg} 0%, ${theme.bgGradient} 100%)`,
15
+ }}
16
+ >
17
+ <div
18
+ style={{
19
+ width: 100,
20
+ height: 100,
21
+ borderRadius: 24,
22
+ background: `linear-gradient(135deg, ${theme.accent}, ${theme.accentSoft})`,
23
+ display: "flex",
24
+ alignItems: "center",
25
+ justifyContent: "center",
26
+ fontSize: 48,
27
+ color: "white",
28
+ fontWeight: "bold",
29
+ }}
30
+ >
31
+ {config.appName.charAt(0)}
32
+ </div>
33
+ <div
34
+ style={{
35
+ fontSize: 28,
36
+ color: theme.textPrimary,
37
+ fontWeight: "bold",
38
+ marginTop: 16,
39
+ }}
40
+ >
41
+ {config.appName}
42
+ </div>
43
+ <div
44
+ style={{
45
+ fontSize: 12,
46
+ color: theme.textSecondary,
47
+ marginTop: 8,
48
+ }}
49
+ >
50
+ Loading...
51
+ </div>
52
+ </div>
53
+ );
@@ -0,0 +1,27 @@
1
+ #!/bin/bash
2
+
3
+ echo "Starting <%= appName %> Analytics Demo..."
4
+ echo ""
5
+
6
+ # Start demo server in background
7
+ echo "Starting demo server..."
8
+ cd "$(dirname "$0")/demo-server" && node server.js &
9
+ SERVER_PID=$!
10
+
11
+ sleep 2
12
+
13
+ # Start Vite dev server
14
+ echo "Starting visualization..."
15
+ cd "$(dirname "$0")" && npx vite --config vite.demo.config.ts --open &
16
+ VITE_PID=$!
17
+
18
+ echo ""
19
+ echo "Demo running!"
20
+ echo " Visualization: http://localhost:3000/demo.html"
21
+ echo " Server: http://localhost:3001"
22
+ echo ""
23
+ echo "Press Ctrl+C to stop."
24
+
25
+ # Cleanup on exit
26
+ trap "kill $SERVER_PID $VITE_PID 2>/dev/null; exit" SIGINT SIGTERM
27
+ wait
@@ -0,0 +1,13 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2018",
4
+ "module": "commonjs",
5
+ "jsx": "react-jsx",
6
+ "strict": true,
7
+ "esModuleInterop": true,
8
+ "skipLibCheck": true,
9
+ "forceConsistentCasingInFileNames": true,
10
+ "moduleResolution": "node"
11
+ },
12
+ "include": ["src"]
13
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "buildCommand": "npm run demo:build",
3
+ "outputDirectory": "demo-dist",
4
+ "framework": null,
5
+ "rewrites": [
6
+ { "source": "/(.*)", "destination": "/demo.html" }
7
+ ]
8
+ }
@@ -0,0 +1,24 @@
1
+ import { defineConfig } from 'vite';
2
+ import react from '@vitejs/plugin-react';
3
+ import path from 'path';
4
+
5
+ export default defineConfig({
6
+ plugins: [react()],
7
+ root: '.',
8
+ publicDir: 'public',
9
+ build: {
10
+ outDir: 'demo-dist',
11
+ rollupOptions: {
12
+ input: path.resolve(__dirname, 'demo.html'),
13
+ },
14
+ },
15
+ server: {
16
+ port: 3000,
17
+ open: '/demo.html',
18
+ },
19
+ resolve: {
20
+ alias: {
21
+ 'remotion': 'remotion',
22
+ },
23
+ },
24
+ });