guanwei 1.1.3 → 1.2.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.
Files changed (45) hide show
  1. package/README.en.md +1 -1
  2. package/README.md +1 -1
  3. package/dist/assets/index-CRUHghuF.js +102 -0
  4. package/dist/assets/index-CRUHghuF.js.map +1 -0
  5. package/dist/assets/index-hLV3S-Cj.css +1 -0
  6. package/dist/index.html +2 -2
  7. package/package.json +1 -1
  8. package/scripts/release.sh +15 -0
  9. package/server/src/data/db.json +189 -0
  10. package/server/src/data/guanwei.db +0 -0
  11. package/server/src/index.ts +1 -1
  12. package/server/src/services/duanyu.ts +67 -0
  13. package/server/src/services/promptBuilder.ts +5 -0
  14. package/shared/core/data/duanyu.ts +15 -14
  15. package/shared/core/data/ganzhi.ts +1 -1
  16. package/shared/core/data/gua64.ts +1 -1
  17. package/shared/core/data/liuren.ts +1 -1
  18. package/shared/core/data/qimen.ts +1 -1
  19. package/shared/core/data/xiaoliuren.ts +1 -1
  20. package/shared/core/data/ziwei.ts +1 -1
  21. package/shared/core/data/zodiac.ts +1 -1
  22. package/shared/core/engine/bazi.ts +3 -1
  23. package/shared/core/engine/calendar.ts +11 -2
  24. package/shared/core/engine/liuren.ts +218 -6
  25. package/shared/core/engine/qimen.ts +30 -8
  26. package/shared/core/types.ts +3 -0
  27. package/src/App.tsx +1 -1
  28. package/src/components/arts/LiurenArt.tsx +2 -1
  29. package/src/data/arts.ts +1 -1
  30. package/src/index.css +2 -74
  31. package/src/pages/DemoPage.tsx +66 -21
  32. package/tailwind.config.js +0 -35
  33. package/dist/assets/index-C3wrtpPY.css +0 -1
  34. package/dist/assets/index-CAyAIgw8.js +0 -102
  35. package/dist/assets/index-CAyAIgw8.js.map +0 -1
  36. package/src/components/Navigation.tsx +0 -80
  37. package/src/components/TarotCard.tsx +0 -129
  38. package/src/pages/AstrologyPage.tsx +0 -33
  39. package/src/pages/BaZiPage.tsx +0 -33
  40. package/src/pages/Home.tsx +0 -179
  41. package/src/pages/SpreadEditor.tsx +0 -230
  42. package/src/pages/SpreadLibrary.tsx +0 -199
  43. package/src/pages/SpreadLibraryPage.tsx +0 -17
  44. package/src/pages/TarotPage.tsx +0 -736
  45. package/src/pages/ZiWeiPage.tsx +0 -33
@@ -1,80 +0,0 @@
1
- import { Link, useLocation } from 'react-router-dom';
2
- import { useState } from 'react';
3
- import { Sparkles, History, Menu, X, Library } from 'lucide-react';
4
-
5
- const navItems = [
6
- { path: '/', label: '首页', icon: Sparkles },
7
- { path: '/tarot', label: '塔罗占卜', icon: Sparkles },
8
- { path: '/spread-library', label: '牌阵库', icon: Library },
9
- { path: '/history', label: '历史记录', icon: History },
10
- ];
11
-
12
- export default function Navigation() {
13
- const location = useLocation();
14
- const [mobileOpen, setMobileOpen] = useState(false);
15
-
16
- return (
17
- <nav className="fixed top-0 left-0 right-0 z-50 bg-void/80 backdrop-blur-md border-b border-ancient/20">
18
- <div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
19
- <div className="flex items-center justify-between h-16">
20
- <Link to="/" className="flex items-center gap-2 group">
21
- <Sparkles className="w-6 h-6 text-ancient group-hover:animate-pulse-glow" />
22
- <span className="font-display text-xl text-ancient tracking-wider">玄冥占星</span>
23
- </Link>
24
-
25
- {/* Desktop nav */}
26
- <div className="hidden md:flex items-center gap-8">
27
- {navItems.map((item) => {
28
- const isActive = location.pathname === item.path || location.pathname.startsWith(item.path + '/');
29
- return (
30
- <Link
31
- key={item.path}
32
- to={item.path}
33
- className={`relative text-sm tracking-wide transition-colors duration-300 ${
34
- isActive ? 'text-ancient' : 'text-stardust/70 hover:text-ancient'
35
- }`}
36
- >
37
- {item.label}
38
- {isActive && (
39
- <span className="absolute -bottom-1 left-0 right-0 h-px bg-ancient animate-pulse-glow" />
40
- )}
41
- </Link>
42
- );
43
- })}
44
- </div>
45
-
46
- {/* Mobile menu button */}
47
- <button
48
- className="md:hidden text-stardust/70 hover:text-ancient"
49
- onClick={() => setMobileOpen(!mobileOpen)}
50
- >
51
- {mobileOpen ? <X className="w-6 h-6" /> : <Menu className="w-6 h-6" />}
52
- </button>
53
- </div>
54
- </div>
55
-
56
- {/* Mobile nav */}
57
- {mobileOpen && (
58
- <div className="md:hidden bg-void/95 backdrop-blur-md border-t border-ancient/20">
59
- <div className="px-4 py-4 space-y-3">
60
- {navItems.map((item) => {
61
- const isActive = location.pathname === item.path;
62
- return (
63
- <Link
64
- key={item.path}
65
- to={item.path}
66
- onClick={() => setMobileOpen(false)}
67
- className={`block py-2 text-sm tracking-wide ${
68
- isActive ? 'text-ancient' : 'text-stardust/70'
69
- }`}
70
- >
71
- {item.label}
72
- </Link>
73
- );
74
- })}
75
- </div>
76
- </div>
77
- )}
78
- </nav>
79
- );
80
- }
@@ -1,129 +0,0 @@
1
- import { useState } from 'react';
2
- import type { TarotCard as TarotCardType } from '@/types';
3
-
4
- interface TarotCardProps {
5
- card: TarotCardType;
6
- isReversed?: boolean;
7
- isFlipped?: boolean;
8
- onClick?: () => void;
9
- size?: 'sm' | 'md' | 'lg';
10
- className?: string;
11
- }
12
-
13
- const sizeClasses = {
14
- sm: 'w-20 h-32',
15
- md: 'w-32 h-48',
16
- lg: 'w-44 h-72',
17
- };
18
-
19
- export default function TarotCard({
20
- card,
21
- isReversed = false,
22
- isFlipped = false,
23
- onClick,
24
- size = 'md',
25
- className = '',
26
- }: TarotCardProps) {
27
- const [flipped, setFlipped] = useState(isFlipped);
28
-
29
- const handleClick = () => {
30
- if (!flipped) {
31
- setFlipped(true);
32
- }
33
- onClick?.();
34
- };
35
-
36
- const suitSymbol = {
37
- wands: '⚡',
38
- cups: '🏆',
39
- swords: '⚔️',
40
- pentacles: '💰',
41
- };
42
-
43
- const elementColor = {
44
- wands: 'text-orange-400',
45
- cups: 'text-blue-400',
46
- swords: 'text-gray-300',
47
- pentacles: 'text-green-400',
48
- };
49
-
50
- return (
51
- <div
52
- className={`relative perspective-1000 cursor-pointer ${className}`}
53
- onClick={handleClick}
54
- >
55
- <div
56
- className={`relative preserve-3d transition-transform duration-700 ${
57
- flipped ? 'rotate-y-180' : ''
58
- } ${sizeClasses[size]}`}
59
- >
60
- {/* Card Back */}
61
- <div className="absolute inset-0 backface-hidden rounded-lg border-2 border-ancient/40 bg-abyss overflow-hidden">
62
- <div className="absolute inset-0 flex items-center justify-center">
63
- <div className="w-full h-full p-2">
64
- <div className="w-full h-full border border-ancient/30 rounded flex items-center justify-center relative">
65
- <div className="absolute inset-0 flex items-center justify-center">
66
- <div className="w-12 h-12 border border-ancient/50 rotate-45" />
67
- </div>
68
- <div className="absolute inset-0 flex items-center justify-center">
69
- <span className="text-ancient/60 text-2xl">✦</span>
70
- </div>
71
- <div className="absolute top-1 left-1 text-ancient/30 text-xs">⚜</div>
72
- <div className="absolute top-1 right-1 text-ancient/30 text-xs">⚜</div>
73
- <div className="absolute bottom-1 left-1 text-ancient/30 text-xs">⚜</div>
74
- <div className="absolute bottom-1 right-1 text-ancient/30 text-xs">⚜</div>
75
- </div>
76
- </div>
77
- </div>
78
- </div>
79
-
80
- {/* Card Front */}
81
- <div
82
- className={`absolute inset-0 backface-hidden rotate-y-180 rounded-lg border-2 ${
83
- isReversed ? 'border-crimson/60' : 'border-ancient/60'
84
- } bg-abyss overflow-hidden`}
85
- >
86
- <div className="absolute inset-0 flex flex-col items-center justify-between p-2">
87
- {/* Top */}
88
- <div className="w-full flex justify-between items-start">
89
- <span className={`text-xs ${card.suit ? elementColor[card.suit] : 'text-ancient'}`}>
90
- {card.number || (card.arcana === 'major' ? '∞' : '')}
91
- </span>
92
- {card.suit && (
93
- <span className="text-xs">{suitSymbol[card.suit]}</span>
94
- )}
95
- </div>
96
-
97
- {/* Center */}
98
- <div className="flex-1 flex items-center justify-center">
99
- <div className="text-center">
100
- <div className="text-3xl mb-1">
101
- {card.arcana === 'major' ? '☽' : suitSymbol[card.suit as keyof typeof suitSymbol]}
102
- </div>
103
- <div className={`text-xs ${isReversed ? 'text-crimson/80' : 'text-ancient'} font-medium`}>
104
- {card.name}
105
- </div>
106
- {isReversed && (
107
- <div className="text-[10px] text-crimson/60 mt-0.5">逆位</div>
108
- )}
109
- </div>
110
- </div>
111
-
112
- {/* Bottom */}
113
- <div className="w-full flex justify-between items-end">
114
- <span className="text-[10px] text-stardust/40">
115
- {card.arcana === 'major' ? '大阿卡纳' : card.suit === 'wands' ? '权杖' : card.suit === 'cups' ? '圣杯' : card.suit === 'swords' ? '宝剑' : '星币'}
116
- </span>
117
- <span className={`text-xs ${card.suit ? elementColor[card.suit] : 'text-ancient'}`}>
118
- {card.number || (card.arcana === 'major' ? '∞' : '')}
119
- </span>
120
- </div>
121
- </div>
122
-
123
- {/* Decorative border */}
124
- <div className="absolute inset-1 border border-ancient/10 rounded pointer-events-none" />
125
- </div>
126
- </div>
127
- </div>
128
- );
129
- }
@@ -1,33 +0,0 @@
1
- import { Link } from 'react-router-dom';
2
- import { CircleDot, Construction, ArrowLeft } from 'lucide-react';
3
-
4
- export default function AstrologyPage() {
5
- return (
6
- <div className="relative min-h-screen pt-20 pb-16 px-4 flex items-center justify-center">
7
- <div className="max-w-2xl mx-auto text-center">
8
- <div className="glass-panel p-12">
9
- <CircleDot className="w-16 h-16 text-ancient/40 mx-auto mb-6" />
10
- <h1 className="font-display text-3xl text-ancient tracking-wider mb-4">
11
- 星盘占星
12
- </h1>
13
- <p className="text-stardust/60 mb-2">西方占星之术,解读行星语言</p>
14
- <div className="flex items-center justify-center gap-2 text-mystic/60 mb-8">
15
- <Construction className="w-4 h-4" />
16
- <span className="text-sm">功能开发中</span>
17
- </div>
18
- <p className="text-stardust/40 text-sm mb-8 leading-relaxed">
19
- 星盘占星通过计算出生时各行星在黄道十二宫的位置,绘制出个人出生星盘。
20
- 此功能将集成完整的星盘绘制、相位分析和推运系统。
21
- </p>
22
- <Link
23
- to="/tarot"
24
- className="inline-flex items-center gap-2 px-6 py-2 border border-ancient/50 text-ancient hover:bg-ancient/10 transition-all rounded-sm text-sm"
25
- >
26
- <ArrowLeft className="w-4 h-4" />
27
- 先体验塔罗占卜
28
- </Link>
29
- </div>
30
- </div>
31
- </div>
32
- );
33
- }
@@ -1,33 +0,0 @@
1
- import { Link } from 'react-router-dom';
2
- import { Calendar, Construction, ArrowLeft } from 'lucide-react';
3
-
4
- export default function BaZiPage() {
5
- return (
6
- <div className="relative min-h-screen pt-20 pb-16 px-4 flex items-center justify-center">
7
- <div className="max-w-2xl mx-auto text-center">
8
- <div className="glass-panel p-12">
9
- <Calendar className="w-16 h-16 text-ancient/40 mx-auto mb-6" />
10
- <h1 className="font-display text-3xl text-ancient tracking-wider mb-4">
11
- 四柱八字
12
- </h1>
13
- <p className="text-stardust/60 mb-2">天干地支之奥秘,洞察命运起伏</p>
14
- <div className="flex items-center justify-center gap-2 text-mystic/60 mb-8">
15
- <Construction className="w-4 h-4" />
16
- <span className="text-sm">功能开发中</span>
17
- </div>
18
- <p className="text-stardust/40 text-sm mb-8 leading-relaxed">
19
- 四柱八字以出生年、月、日、时的天干地支组成命盘,通过五行生克制化、十神关系来分析性格、运势和人生轨迹。
20
- 此功能将集成自动排盘、大运流年和神煞分析。
21
- </p>
22
- <Link
23
- to="/tarot"
24
- className="inline-flex items-center gap-2 px-6 py-2 border border-ancient/50 text-ancient hover:bg-ancient/10 transition-all rounded-sm text-sm"
25
- >
26
- <ArrowLeft className="w-4 h-4" />
27
- 先体验塔罗占卜
28
- </Link>
29
- </div>
30
- </div>
31
- </div>
32
- );
33
- }
@@ -1,179 +0,0 @@
1
- import { Link } from 'react-router-dom';
2
- import { Sparkles, Star, CircleDot, Calendar, Moon, Sun } from 'lucide-react';
3
- import { getCurrentZodiac, getMoonPhase, getDailyFortune } from '@/utils/astrologyCalc';
4
- import { useEffect, useState } from 'react';
5
-
6
- const features = [
7
- {
8
- title: '塔罗占卜',
9
- description: '78张神秘牌面,揭示命运的多维真相',
10
- icon: Sparkles,
11
- path: '/tarot',
12
- color: 'from-ancient/20 to-mystic/20',
13
- symbol: '✦',
14
- },
15
- {
16
- title: '紫微斗数',
17
- description: '东方星命之学,解析人生格局',
18
- icon: Star,
19
- path: '/ziwei',
20
- color: 'from-mystic/20 to-crimson/20',
21
- symbol: '☆',
22
- },
23
- {
24
- title: '四柱八字',
25
- description: '天干地支之奥秘,洞察命运起伏',
26
- icon: Calendar,
27
- path: '/bazi',
28
- color: 'from-crimson/20 to-ancient/20',
29
- symbol: '☯',
30
- },
31
- {
32
- title: '星盘占星',
33
- description: '西方占星之术,解读行星语言',
34
- icon: CircleDot,
35
- path: '/astrology',
36
- color: 'from-ancient/20 to-crimson/20',
37
- symbol: '◎',
38
- },
39
- ];
40
-
41
- export default function Home() {
42
- const [fortune, setFortune] = useState('');
43
- const [zodiac, setZodiac] = useState('');
44
- const [moonPhase, setMoonPhase] = useState('');
45
-
46
- useEffect(() => {
47
- setFortune(getDailyFortune());
48
- setZodiac(getCurrentZodiac());
49
- setMoonPhase(getMoonPhase());
50
- }, []);
51
-
52
- return (
53
- <div className="relative min-h-screen">
54
- {/* Hero Section */}
55
- <section className="relative min-h-screen flex items-center justify-center px-4">
56
- <div className="text-center max-w-4xl mx-auto">
57
- <div className="mb-8">
58
- <div className="inline-flex items-center gap-2 px-4 py-2 rounded-full border border-ancient/30 bg-ancient/5 mb-6">
59
- <Moon className="w-4 h-4 text-ancient" />
60
- <span className="text-xs text-ancient/80 tracking-widest">探索宇宙的智慧</span>
61
- <Sun className="w-4 h-4 text-ancient" />
62
- </div>
63
- </div>
64
-
65
- <h1 className="font-display text-5xl md:text-7xl lg:text-8xl text-ancient mb-6 tracking-wider">
66
- <span className="shimmer-text">玄冥占星</span>
67
- </h1>
68
-
69
- <p className="text-stardust/60 text-lg md:text-xl max-w-2xl mx-auto mb-4 leading-relaxed">
70
- 东西方玄学体系的交汇之地
71
- </p>
72
- <p className="text-stardust/40 text-sm md:text-base max-w-xl mx-auto mb-12">
73
- 塔罗 · 紫微 · 四柱 · 星盘 · 组合占卜
74
- </p>
75
-
76
- <div className="flex flex-col sm:flex-row gap-4 justify-center">
77
- <Link
78
- to="/tarot"
79
- className="inline-flex items-center justify-center gap-2 px-8 py-3 border border-ancient/50 text-ancient hover:bg-ancient/10 hover:border-ancient transition-all duration-500 rounded-sm tracking-wider text-sm"
80
- >
81
- <Sparkles className="w-4 h-4" />
82
- 开始占卜
83
- </Link>
84
- <Link
85
- to="/history"
86
- className="inline-flex items-center justify-center gap-2 px-8 py-3 border border-stardust/20 text-stardust/70 hover:border-stardust/50 hover:text-stardust transition-all duration-500 rounded-sm tracking-wider text-sm"
87
- >
88
- 查看记录
89
- </Link>
90
- </div>
91
- </div>
92
-
93
- {/* Scroll indicator */}
94
- <div className="absolute bottom-8 left-1/2 -translate-x-1/2 animate-bounce">
95
- <div className="w-px h-12 bg-gradient-to-b from-ancient/50 to-transparent" />
96
- </div>
97
- </section>
98
-
99
- {/* Daily Fortune */}
100
- <section className="relative py-16 px-4">
101
- <div className="max-w-4xl mx-auto">
102
- <div className="glass-panel p-6 md:p-8 relative overflow-hidden">
103
- <div className="absolute top-0 right-0 w-32 h-32 bg-ancient/5 rounded-full blur-3xl" />
104
- <div className="absolute bottom-0 left-0 w-24 h-24 bg-mystic/5 rounded-full blur-3xl" />
105
-
106
- <div className="relative">
107
- <div className="flex items-center gap-3 mb-4">
108
- <Sun className="w-5 h-5 text-ancient" />
109
- <h2 className="font-display text-xl text-ancient tracking-wider">今日星象</h2>
110
- </div>
111
-
112
- <div className="flex flex-wrap gap-4 mb-4 text-sm">
113
- <span className="px-3 py-1 rounded-full border border-ancient/20 text-ancient/70">
114
- 太阳星座:{zodiac}
115
- </span>
116
- <span className="px-3 py-1 rounded-full border border-mystic/20 text-mystic/70">
117
- 月相:{moonPhase}
118
- </span>
119
- </div>
120
-
121
- <p className="text-stardust/70 leading-relaxed text-sm md:text-base">
122
- {fortune}
123
- </p>
124
- </div>
125
- </div>
126
- </div>
127
- </section>
128
-
129
- {/* Features Grid */}
130
- <section className="relative py-16 px-4">
131
- <div className="max-w-6xl mx-auto">
132
- <div className="text-center mb-12">
133
- <h2 className="font-display text-3xl text-ancient tracking-wider mb-3">占卜之道</h2>
134
- <p className="text-stardust/50 text-sm">选择适合你的探索方式</p>
135
- </div>
136
-
137
- <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6">
138
- {features.map((feature) => (
139
- <Link
140
- key={feature.path}
141
- to={feature.path}
142
- className="group relative"
143
- >
144
- <div className={`absolute inset-0 bg-gradient-to-br ${feature.color} rounded-lg opacity-0 group-hover:opacity-100 transition-opacity duration-500`} />
145
- <div className="relative glass-panel p-6 h-full hover:border-ancient/50 transition-all duration-500">
146
- <div className="flex items-center justify-between mb-4">
147
- <feature.icon className="w-6 h-6 text-ancient/70 group-hover:text-ancient transition-colors" />
148
- <span className="text-ancient/30 text-lg group-hover:text-ancient/60 transition-colors">
149
- {feature.symbol}
150
- </span>
151
- </div>
152
- <h3 className="font-display text-lg text-stardust group-hover:text-ancient transition-colors mb-2">
153
- {feature.title}
154
- </h3>
155
- <p className="text-stardust/50 text-sm leading-relaxed">
156
- {feature.description}
157
- </p>
158
- </div>
159
- </Link>
160
- ))}
161
- </div>
162
- </div>
163
- </section>
164
-
165
- {/* Footer */}
166
- <footer className="relative py-12 px-4 border-t border-ancient/10">
167
- <div className="max-w-4xl mx-auto text-center">
168
- <div className="flex items-center justify-center gap-2 mb-4">
169
- <Sparkles className="w-4 h-4 text-ancient/40" />
170
- <span className="font-display text-sm text-ancient/40 tracking-wider">玄冥占星</span>
171
- </div>
172
- <p className="text-stardust/30 text-xs">
173
- 塔罗不是预言,而是镜子 · 命运掌握在你手中
174
- </p>
175
- </div>
176
- </footer>
177
- </div>
178
- );
179
- }