kazutab commited on
Commit
8310b98
·
verified ·
1 Parent(s): 100b9d3

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +39 -27
app.py CHANGED
@@ -85,48 +85,60 @@ def generate_mindmap(input_text: str):
85
  base_css = """
86
  @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');
87
 
88
- :root {
89
- --bg-canvas: #fafafa;
90
- --bg-sidebar: #ffffff;
91
- --border-color: #eaeaea;
92
- --text-primary: #171717;
93
- --text-secondary: #666666;
94
- --text-tertiary: #a1a1aa;
95
- --focus-ring: rgba(0, 0, 0, 0.08);
 
 
96
  }
97
 
98
  * { box-sizing: border-box; margin: 0; padding: 0; }
99
  body { font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", "Helvetica Neue", sans-serif; color: var(--text-primary); background-color: var(--bg-canvas); height: 100vh; overflow: hidden; -webkit-font-smoothing: antialiased; }
100
 
101
- .app-layout { display: flex; height: 100vh; width: 100vw; }
 
102
 
103
- .sidebar { width: 360px; min-width: 360px; max-width: 360px; background-color: var(--bg-sidebar); border-right: 1px solid var(--border-color); display: flex; flex-direction: column; box-shadow: 1px 0 10px rgba(0,0,0,0.02); z-index: 10; }
104
- .sidebar-header { padding: 24px; border-bottom: 1px solid var(--border-color); }
105
- .logo { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 16px; letter-spacing: -0.02em; color: #171717; }
106
- .sidebar-content { flex-grow: 1; padding: 24px; display: flex; flex-direction: column; gap: 20px; }
107
- .input-group { display: flex; flex-direction: column; gap: 8px; flex-grow: 1; }
108
- .input-group label { font-size: 13px; font-weight: 500; color: var(--text-secondary); }
 
 
 
 
109
 
110
  textarea.custom-textarea {
111
- flex-grow: 1; width: 100%; height: 100%; resize: none; border: 1px solid var(--border-color); border-radius: 8px; padding: 16px; font-family: inherit; font-size: 14px; line-height: 1.6; color: var(--text-primary); background-color: #fff; transition: all 0.2s ease; box-shadow: 0 1px 2px rgba(0,0,0,0.02);
112
  }
113
- textarea.custom-textarea:focus { outline: none; border-color: #999; box-shadow: 0 0 0 4px var(--focus-ring); }
114
- textarea.custom-textarea::placeholder { color: #a1a1aa; }
115
 
116
- .btn-primary { background-color: #000; color: #fff; border: none; border-radius: 6px; padding: 12px 16px; font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.2s ease; display: flex; align-items: center; justify-content: center; gap: 8px; }
117
- .btn-primary:hover { background-color: #333; }
118
- .btn-primary:active { transform: scale(0.98); }
119
- .btn-primary:disabled { background-color: #e5e5e5; color: #a3a3a3; cursor: not-allowed; }
 
120
 
121
- #loading { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 13px; color: var(--text-secondary); padding: 12px; }
122
- .spinner { width: 16px; height: 16px; border: 2px solid var(--border-color); border-top: 2px solid #000; border-radius: 50%; animation: spin 0.8s linear infinite; }
123
  @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
124
  .hidden { display: none !important; }
125
 
126
- .sidebar-footer { padding: 16px 24px; border-top: 1px solid var(--border-color); font-size: 12px; color: var(--text-tertiary); }
 
 
 
 
 
127
 
128
- .canvas-area { flex-grow: 1; position: relative; background-color: var(--bg-canvas); background-image: radial-gradient(#e5e7eb 1px, transparent 1px); background-size: 20px 20px; }
129
- #markmap { width: 100%; height: 100%; }
130
 
131
  /* Gradio Overrides to remove padding and ensure full screen */
132
  .gradio-container { padding: 0 !important; margin: 0 !important; max-width: 100vw !important; border: none !important; }
 
85
  base_css = """
86
  @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');
87
 
88
+ :root, .dark, body {
89
+ --bg-canvas: #fafafa !important;
90
+ --bg-sidebar: #ffffff !important;
91
+ --border-color: #eaeaea !important;
92
+ --text-primary: #171717 !important;
93
+ --text-secondary: #666666 !important;
94
+ --text-tertiary: #a1a1aa !important;
95
+ --focus-ring: rgba(0, 0, 0, 0.08) !important;
96
+ --body-text-color: #171717 !important;
97
+ color: #171717 !important;
98
  }
99
 
100
  * { box-sizing: border-box; margin: 0; padding: 0; }
101
  body { font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", "Helvetica Neue", sans-serif; color: var(--text-primary); background-color: var(--bg-canvas); height: 100vh; overflow: hidden; -webkit-font-smoothing: antialiased; }
102
 
103
+ /* Force layout to break out of Gradio's container limitations */
104
+ .app-layout { position: fixed !important; top: 0 !important; left: 0 !important; display: flex !important; height: 100vh !important; width: 100vw !important; z-index: 99999 !important; background-color: var(--bg-canvas) !important; margin: 0 !important; padding: 0 !important; }
105
 
106
+ /* Force light mode text colors to defeat Gradio Dark Mode */
107
+ .app-layout, .app-layout div, .app-layout span, .app-layout p, .app-layout label { color: #171717 !important; }
108
+
109
+ .sidebar { width: 360px !important; min-width: 360px !important; max-width: 360px !important; background-color: var(--bg-sidebar) !important; border-right: 1px solid var(--border-color) !important; display: flex !important; flex-direction: column !important; box-shadow: 1px 0 10px rgba(0,0,0,0.02) !important; z-index: 10 !important; height: 100vh !important; margin: 0 !important; padding: 0 !important; }
110
+ .sidebar-header { padding: 24px !important; border-bottom: 1px solid var(--border-color) !important; }
111
+ .logo { display: flex !important; align-items: center !important; gap: 12px !important; font-weight: 600 !important; font-size: 16px !important; letter-spacing: -0.02em !important; color: #171717 !important; }
112
+ .logo svg { stroke: #171717 !important; }
113
+ .sidebar-content { flex-grow: 1 !important; padding: 24px !important; display: flex !important; flex-direction: column !important; gap: 20px !important; }
114
+ .input-group { display: flex !important; flex-direction: column !important; gap: 8px !important; flex-grow: 1 !important; }
115
+ .input-group label { font-size: 13px !important; font-weight: 500 !important; color: var(--text-secondary) !important; }
116
 
117
  textarea.custom-textarea {
118
+ flex-grow: 1 !important; width: 100% !important; height: 100% !important; resize: none !important; border: 1px solid var(--border-color) !important; border-radius: 8px !important; padding: 16px !important; font-family: inherit !important; font-size: 14px !important; line-height: 1.6 !important; color: var(--text-primary) !important; background-color: #fff !important; transition: all 0.2s ease !important; box-shadow: 0 1px 2px rgba(0,0,0,0.02) !important;
119
  }
120
+ textarea.custom-textarea:focus { outline: none !important; border-color: #999 !important; box-shadow: 0 0 0 4px var(--focus-ring) !important; }
121
+ textarea.custom-textarea::placeholder { color: #a1a1aa !important; }
122
 
123
+ .btn-primary { background-color: #000 !important; color: #fff !important; border: none !important; border-radius: 6px !important; padding: 12px 16px !important; font-size: 14px !important; font-weight: 500 !important; cursor: pointer !important; transition: all 0.2s ease !important; display: flex !important; align-items: center !important; justify-content: center !important; gap: 8px !important; }
124
+ .btn-primary, .btn-primary * { color: #ffffff !important; stroke: #ffffff !important; }
125
+ .btn-primary:hover { background-color: #333 !important; }
126
+ .btn-primary:active { transform: scale(0.98) !important; }
127
+ .btn-primary:disabled { background-color: #e5e5e5 !important; color: #a3a3a3 !important; cursor: not-allowed !important; stroke: #a3a3a3 !important; }
128
 
129
+ #loading { display: flex !important; align-items: center !important; justify-content: center !important; gap: 12px !important; font-size: 13px !important; color: var(--text-secondary) !important; padding: 12px !important; }
130
+ .spinner { width: 16px !important; height: 16px !important; border: 2px solid var(--border-color) !important; border-top: 2px solid #000 !important; border-radius: 50% !important; animation: spin 0.8s linear infinite !important; }
131
  @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
132
  .hidden { display: none !important; }
133
 
134
+ .sidebar-footer { padding: 16px 24px !important; border-top: 1px solid var(--border-color) !important; font-size: 12px !important; color: var(--text-tertiary) !important; }
135
+ .sidebar-footer p { color: var(--text-tertiary) !important; }
136
+
137
+ .canvas-area { flex-grow: 1 !important; position: relative !important; background-color: var(--bg-canvas) !important; background-image: radial-gradient(#e5e7eb 1px, transparent 1px) !important; background-size: 20px 20px !important; padding: 0 !important; margin: 0 !important; height: 100vh !important; }
138
+ #markmap { width: 100% !important; height: 100% !important; }
139
+ #markmap text { fill: #171717 !important; color: #171717 !important; font-family: inherit !important; }
140
 
141
+ .disclaimer { color: var(--text-tertiary) !important; }
 
142
 
143
  /* Gradio Overrides to remove padding and ensure full screen */
144
  .gradio-container { padding: 0 !important; margin: 0 !important; max-width: 100vw !important; border: none !important; }