Kexin-251202 commited on
Commit
a548c20
·
verified ·
1 Parent(s): 3b59312

update app.css home.jsx to adjust homepage layout

Browse files
Files changed (1) hide show
  1. src/components/Home.jsx +7 -7
src/components/Home.jsx CHANGED
@@ -67,7 +67,7 @@ function Home({ setActiveTab, role, setRole }) {
67
  }
68
  } else {
69
  const pwd = window.prompt("Enter Admin Password:");
70
- if (pwd === "admin123") {
71
  try {
72
  await fetch('/api/history', { method: 'DELETE' });
73
  const res = await fetch('/test_data.json');
@@ -96,23 +96,23 @@ function Home({ setActiveTab, role, setRole }) {
96
  <h1>FocusGuard</h1>
97
  <p>Your productivity monitor assistant.</p>
98
 
99
- {/* 选项按钮组,全部采和谐蓝色按钮 (btn-main) */}
100
- <div style={{ display: 'flex', flexDirection: 'column', gap: '15px', alignItems: 'center', marginTop: '30px' }}>
101
 
102
- <button className="btn-main" onClick={handleNewStart} style={{ width: '250px' }}>
103
  Start Focus
104
  </button>
105
 
106
- <button className="btn-main" onClick={handleAutoImport} style={{ width: '250px' }}>
107
  Auto Import History
108
  </button>
109
 
110
- <button className="btn-main" onClick={() => fileInputRef.current.click()} style={{ width: '250px' }}>
111
  Manual Import History
112
  </button>
113
  <input type="file" ref={fileInputRef} style={{ display: 'none' }} accept=".json" onChange={handleFileChange} />
114
 
115
- <button className="btn-main" onClick={handleAdminToggle} style={{ width: '250px' }}>
116
  {role === 'admin' ? 'Switch to User Mode' : 'Admin Login'}
117
  </button>
118
 
 
67
  }
68
  } else {
69
  const pwd = window.prompt("Enter Admin Password:");
70
+ if (pwd === "123") {
71
  try {
72
  await fetch('/api/history', { method: 'DELETE' });
73
  const res = await fetch('/test_data.json');
 
96
  <h1>FocusGuard</h1>
97
  <p>Your productivity monitor assistant.</p>
98
 
99
+ {/* 使全新2x2 网格容器 */}
100
+ <div className="home-button-grid">
101
 
102
+ <button className="btn-main" onClick={handleNewStart}>
103
  Start Focus
104
  </button>
105
 
106
+ <button className="btn-main" onClick={handleAutoImport}>
107
  Auto Import History
108
  </button>
109
 
110
+ <button className="btn-main" onClick={() => fileInputRef.current.click()}>
111
  Manual Import History
112
  </button>
113
  <input type="file" ref={fileInputRef} style={{ display: 'none' }} accept=".json" onChange={handleFileChange} />
114
 
115
+ <button className="btn-main" onClick={handleAdminToggle}>
116
  {role === 'admin' ? 'Switch to User Mode' : 'Admin Login'}
117
  </button>
118