1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
|
import React, { useEffect } from 'react'
import { useStore } from '@nanostores/react'
import {
isStandbyStore,
currentTimeStore,
weatherStore,
showChoicesStore,
showSettingsModalStore,
isVisibleStore,
yenBalanceStore,
toggleStandby,
toggleShowChoices,
updateTime
} from '../stores'
interface VNInterfaceProps {
onLogout: () => void
}
export function VNInterface({ onLogout }: VNInterfaceProps) {
const isStandby = useStore(isStandbyStore)
const currentTime = useStore(currentTimeStore)
const weather = useStore(weatherStore)
const showChoices = useStore(showChoicesStore)
const showSettingsModal = useStore(showSettingsModalStore)
const isVisible = useStore(isVisibleStore)
const yenBalance = useStore(yenBalanceStore)
// Fade in effect on mount
useEffect(() => {
const timer = setTimeout(() => {
isVisibleStore.set(true)
}, 100)
return () => clearTimeout(timer)
}, [])
// Update clock every second (Japan Time)
useEffect(() => {
const timer = setInterval(() => {
const now = new Date()
// Convert to Japan Time (UTC+9)
const japanTime = new Date(now.getTime() + (now.getTimezoneOffset() * 60000) + (9 * 3600000))
updateTime()
}, 1000)
return () => clearInterval(timer)
}, [])
return (
<div className={`vn-interface ${isVisible ? 'fade-in' : 'fade-out'}`}>
{/* Background */}
<div className="vn-background">
<img
src="/__gaogao__56242cbde8f18ac64522e410bad04e68_waifu2x_art_noise2.png"
alt="Background image"
className="background-image"
/>
</div>
{/* Combined Info Panel (Top Right) */}
<div className="floating-info-panel">
<div className="info-panel-content">
{/* Weather Section */}
<div className="weather-section">
<div className="weather-icon">🌤️</div>
<div className="weather-details">
<div className="weather-location">Tokyo</div>
<div className="weather-temp">22°C Sunny</div>
</div>
</div>
{/* Time Section */}
<div className="time-section">
<div className="japan-date">{currentTime.toLocaleDateString('ja-JP', {
year: 'numeric',
month: 'long',
day: 'numeric',
weekday: 'short'
})}</div>
<div className="japan-time">{currentTime.toLocaleTimeString('ja-JP', {
hour12: false,
hour: '2-digit',
minute: '2-digit'
})}</div>
</div>
{/* Status Section */}
<div className="status-section">
<div className="status-item">
<span className="info-label">Balance:</span>
<span className="info-value yen-balance">¥{yenBalance.toLocaleString()}</span>
</div>
<div className="status-item">
<span className="info-label">System:</span>
<span
className="info-value live-status clickable"
onClick={toggleStandby}
title="Click to toggle between LIVE and STANDBY"
>
<span className={`status-dot ${isStandby ? 'standby' : 'live'}`}></span>
{isStandby ? 'STDBY' : 'LIVE'}
</span>
</div>
</div>
</div>
</div>
{/* Main VN Viewport */}
<div className="vn-viewport">
<div className="vn-content">
</div>
</div>
{/* Dialogue Panel (Bottom) */}
<div className="floating-dialogue-panel">
<div className="dialogue-content">
<div className="dialogue-speaker">???</div>
<div className="dialogue-text">
A warm CRT glow fills the room. A figure turns towards you...
</div>
</div>
</div>
{/* Input/Choice Panel (Bottom) */}
<div className="floating-input-panel">
<div className="input-content">
{!showChoices ? (
// Text Input Mode
<input
type="text"
className="vn-text-input"
placeholder="Type your response..."
onKeyPress={(e) => {
if (e.key === 'Enter') {
const target = e.target as HTMLInputElement;
if (target.value.trim()) {
console.log('User input:', target.value);
target.value = '';
}
}
}}
/>
) : (
// Choice Options Mode
<div className="choice-buttons">
<button className="choice-btn" onClick={() => console.log('Choice: Hello?')}>"Hello?"</button>
<button className="choice-btn" onClick={() => console.log('Choice: Who are you?')}>"Who are you?"</button>
<button className="choice-btn" onClick={() => console.log('Choice: Stay silent')}>(Stay silent)</button>
</div>
)}
{/* Toggle Button */}
<button
className="toggle-input-btn"
onClick={toggleShowChoices}
title={showChoices ? "Switch to text input" : "Switch to choice options"}
>
{showChoices ? "⎀" : "≡"}
</button>
</div>
</div>
{/* Floating Settings Button */}
<button className="floating-logout-btn" onClick={() => showSettingsModalStore.set(true)}>
<span className="btn-icon">⚙</span>
<span className="btn-text">Settings</span>
</button>
{/* Settings Modal */}
{showSettingsModal && (
<div className="modal-overlay" onClick={() => showSettingsModalStore.set(false)}>
<div className="settings-modal" onClick={(e) => e.stopPropagation()}>
<div className="modal-header">
<h2 className="modal-title">Settings</h2>
<button className="modal-close-btn" onClick={() => showSettingsModalStore.set(false)}>
×
</button>
</div>
<div className="modal-content">
<div className="settings-section">
<h3>Display Options</h3>
<div className="setting-item">
<label>
<input type="checkbox" defaultChecked /> Enable animations
</label>
</div>
</div>
<div className="settings-section">
<h3>Audio</h3>
<div className="setting-item">
<label>Master Volume</label>
<input type="range" min="0" max="100" defaultValue="75" />
</div>
</div>
</div>
<div className="modal-footer">
<button className="modal-btn secondary" onClick={() => showSettingsModalStore.set(false)}>
Cancel
</button>
<button className="modal-btn logout" onClick={() => { showSettingsModalStore.set(false); onLogout(); }}>
Logout
</button>
</div>
</div>
</div>
)}
</div>
)
}
|