CaffeinatedCoding commited on
Commit
6b6a2d7
·
verified ·
1 Parent(s): 5b3cb31

Upload folder using huggingface_hub

Browse files
api/main.py CHANGED
@@ -176,6 +176,14 @@ def health():
176
  }
177
 
178
 
 
 
 
 
 
 
 
 
179
  @app.post("/query", response_model=QueryResponse)
180
  def query(request: QueryRequest, background_tasks: BackgroundTasks):
181
  if not request.query.strip():
 
176
  }
177
 
178
 
179
+ @app.get("/court/ui")
180
+ def serve_moot_court():
181
+ """Serve the Moot Court UI directly"""
182
+ if os.path.exists("frontend/court/court.html"):
183
+ return FileResponse("frontend/court/court.html", media_type="text/html")
184
+ return {"error": "Moot Court UI not found"}
185
+
186
+
187
  @app.post("/query", response_model=QueryResponse)
188
  def query(request: QueryRequest, background_tasks: BackgroundTasks):
189
  if not request.query.strip():
frontend/court/court.css CHANGED
@@ -9,6 +9,10 @@
9
  }
10
 
11
  /* Typography overrides */
 
 
 
 
12
  body {
13
  font-family: "Plus Jakarta Sans", sans-serif;
14
  -webkit-font-smoothing: antialiased;
@@ -246,8 +250,9 @@ h1, h2, h3, h4, h5, h6 {
246
  .screen {
247
  display: none;
248
  width: 100%;
249
- height: 100%;
250
  min-height: 100vh;
 
 
251
  }
252
 
253
  .screen.active {
@@ -764,6 +769,70 @@ input:checked + .toggle-slider:before {
764
  margin: 16px;
765
  max-width: none;
766
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
767
  }
768
 
769
  /* ════════════════════════════════════════════════════════════ */
 
9
  }
10
 
11
  /* Typography overrides */
12
+ html {
13
+ scroll-behavior: smooth;
14
+ }
15
+
16
  body {
17
  font-family: "Plus Jakarta Sans", sans-serif;
18
  -webkit-font-smoothing: antialiased;
 
250
  .screen {
251
  display: none;
252
  width: 100%;
 
253
  min-height: 100vh;
254
+ overflow-y: auto;
255
+ overflow-x: hidden;
256
  }
257
 
258
  .screen.active {
 
769
  margin: 16px;
770
  max-width: none;
771
  }
772
+
773
+ /* Improve responsiveness for setup screens */
774
+ header nav {
775
+ padding: 16px !important;
776
+ }
777
+
778
+ main {
779
+ padding: 16px !important;
780
+ }
781
+
782
+ .max-w-4xl {
783
+ max-width: none !important;
784
+ width: 100% !important;
785
+ }
786
+
787
+ .px-12 {
788
+ padding-left: 16px !important;
789
+ padding-right: 16px !important;
790
+ }
791
+
792
+ .pt-28 {
793
+ padding-top: 80px !important;
794
+ }
795
+
796
+ header.fixed {
797
+ position: relative;
798
+ }
799
+ }
800
+
801
+ @media (max-width: 480px) {
802
+ body {
803
+ font-size: 13px;
804
+ }
805
+
806
+ .font-serif.text-4xl {
807
+ font-size: 28px !important;
808
+ }
809
+
810
+ .font-serif.text-2xl {
811
+ font-size: 20px !important;
812
+ }
813
+
814
+ header nav {
815
+ flex-direction: column;
816
+ gap: 8px;
817
+ }
818
+
819
+ header nav a,
820
+ header nav span {
821
+ font-size: 14px !important;
822
+ }
823
+
824
+ main {
825
+ padding: 12px !important;
826
+ gap: 16px !important;
827
+ }
828
+
829
+ .grid.grid-cols-2 {
830
+ grid-template-columns: 1fr !important;
831
+ }
832
+
833
+ .clay-card {
834
+ padding: 16px !important;
835
+ }
836
  }
837
 
838
  /* ════════════════════════════════════════════════════════════ */
frontend/court/court.html CHANGED
@@ -68,7 +68,7 @@
68
  }
69
  </script>
70
  </head>
71
- <body class="bg-[#F5F0E8] text-on-surface font-body min-h-screen overflow-hidden">
72
 
73
  <!-- ══════════════════════════════════════════════════════════ -->
74
  <!-- SCREEN: LOBBY -->
 
68
  }
69
  </script>
70
  </head>
71
+ <body class="bg-[#F5F0E8] text-on-surface font-body min-h-screen overflow-y-auto overflow-x-hidden">
72
 
73
  <!-- ══════════════════════════════════════════════════════════ -->
74
  <!-- SCREEN: LOBBY -->
frontend/court/court.js CHANGED
@@ -32,10 +32,14 @@ const state = {
32
  // ════════════════════════════════════════════════════════════
33
 
34
  document.addEventListener('DOMContentLoaded', () => {
35
- loadRecentSessions();
 
36
  updateLobbyTime();
37
  setInterval(updateLobbyTime, 1000);
38
- document.getElementById('argument-input').addEventListener('input', updateWordCount);
 
 
 
39
  });
40
 
41
  // ════════════════════════════════════════════════════════════
@@ -43,6 +47,7 @@ document.addEventListener('DOMContentLoaded', () => {
43
  // ════════════════════════════════════════════════════════════
44
 
45
  function showScreen(screenId) {
 
46
  // Hide all screens
47
  document.querySelectorAll('.screen').forEach(s => s.classList.remove('active'));
48
 
@@ -51,10 +56,11 @@ function showScreen(screenId) {
51
  if (targetScreen) {
52
  targetScreen.classList.add('active');
53
  state.currentScreen = screenId;
 
54
 
55
  // Screen-specific initialization
56
  if (screenId === 'lobby') {
57
- loadRecentSessions();
58
  } else if (screenId === 'courtroom') {
59
  initializeCourtroom();
60
  } else if (screenId === 'analysis') {
@@ -62,6 +68,8 @@ function showScreen(screenId) {
62
  } else if (screenId === 'sessions') {
63
  loadAllSessions();
64
  }
 
 
65
  }
66
  }
67
 
@@ -110,17 +118,22 @@ function removeIssue(issue) {
110
  }
111
 
112
  function goToStep(step) {
 
 
113
  // Validate current step
114
  if (state.setupStep === 1 && !state.setupData.side) {
115
  alert('Please select your side');
 
116
  return;
117
  }
118
  if (state.setupStep === 2) {
119
- if (!document.getElementById('case-title').value.trim()) {
 
120
  alert('Please enter case title');
 
121
  return;
122
  }
123
- state.setupData.title = document.getElementById('case-title').value;
124
  state.setupData.userClient = document.getElementById('user-client').value;
125
  state.setupData.opposingParty = document.getElementById('opposing-party').value;
126
  state.setupData.facts = document.getElementById('brief-facts').value;
@@ -130,7 +143,13 @@ function goToStep(step) {
130
  // Update steps
131
  state.setupStep = step;
132
  document.querySelectorAll('.setup-step').forEach(s => s.classList.add('hidden'));
133
- document.getElementById(`setup-step-${step}`).classList.remove('hidden');
 
 
 
 
 
 
134
 
135
  // Update indicators
136
  document.querySelectorAll('.step-indicator').forEach((ind, i) => {
 
32
  // ════════════════════════════════════════════════════════════
33
 
34
  document.addEventListener('DOMContentLoaded', () => {
35
+ console.log('✓ NyayaSetu Moot Court UI loaded');
36
+ try { loadRecentSessions(); } catch (e) { console.warn('Could not load sessions:', e); }
37
  updateLobbyTime();
38
  setInterval(updateLobbyTime, 1000);
39
+ const argInput = document.getElementById('argument-input');
40
+ if (argInput) {
41
+ argInput.addEventListener('input', updateWordCount);
42
+ }
43
  });
44
 
45
  // ════════════════════════════════════════════════════════════
 
47
  // ════════════════════════════════════════════════════════════
48
 
49
  function showScreen(screenId) {
50
+ console.log(`🔄 Navigating to screen: ${screenId}`);
51
  // Hide all screens
52
  document.querySelectorAll('.screen').forEach(s => s.classList.remove('active'));
53
 
 
56
  if (targetScreen) {
57
  targetScreen.classList.add('active');
58
  state.currentScreen = screenId;
59
+ console.log(`✓ Screen active: ${screenId}`);
60
 
61
  // Screen-specific initialization
62
  if (screenId === 'lobby') {
63
+ try { loadRecentSessions(); } catch (e) { console.warn('Error loading sessions:', e); }
64
  } else if (screenId === 'courtroom') {
65
  initializeCourtroom();
66
  } else if (screenId === 'analysis') {
 
68
  } else if (screenId === 'sessions') {
69
  loadAllSessions();
70
  }
71
+ } else {
72
+ console.error(`✗ Screen not found: screen-${screenId}`);
73
  }
74
  }
75
 
 
118
  }
119
 
120
  function goToStep(step) {
121
+ console.log(`→ Moving to setup step ${step}`);
122
+
123
  // Validate current step
124
  if (state.setupStep === 1 && !state.setupData.side) {
125
  alert('Please select your side');
126
+ console.warn('Cannot advance: side not selected');
127
  return;
128
  }
129
  if (state.setupStep === 2) {
130
+ const title = document.getElementById('case-title').value.trim();
131
+ if (!title) {
132
  alert('Please enter case title');
133
+ console.warn('Cannot advance: case title missing');
134
  return;
135
  }
136
+ state.setupData.title = title;
137
  state.setupData.userClient = document.getElementById('user-client').value;
138
  state.setupData.opposingParty = document.getElementById('opposing-party').value;
139
  state.setupData.facts = document.getElementById('brief-facts').value;
 
143
  // Update steps
144
  state.setupStep = step;
145
  document.querySelectorAll('.setup-step').forEach(s => s.classList.add('hidden'));
146
+ const stepEl = document.getElementById(`setup-step-${step}`);
147
+ if (stepEl) {
148
+ stepEl.classList.remove('hidden');
149
+ console.log(`✓ Setup step ${step} displayed`);
150
+ } else {
151
+ console.error(`✗ Setup step ${step} element not found`);
152
+ }
153
 
154
  // Update indicators
155
  document.querySelectorAll('.step-indicator').forEach((ind, i) => {
frontend/index.html CHANGED
@@ -32,10 +32,10 @@
32
  System Analytics
33
  </button>
34
 
35
- <a href="/static/court/court.html" class="analytics-btn" style="text-decoration: none; color: inherit;">
36
  <span class="analytics-icon">⚖️</span>
37
  Moot Court
38
- </a>
39
 
40
  <div class="sidebar-section-label">SESSIONS</div>
41
  <div id="sessions-list" class="sessions-list">
 
32
  System Analytics
33
  </button>
34
 
35
+ <button class="analytics-btn" onclick="window.location.href='/court/ui'">
36
  <span class="analytics-icon">⚖️</span>
37
  Moot Court
38
+ </button>
39
 
40
  <div class="sidebar-section-label">SESSIONS</div>
41
  <div id="sessions-list" class="sessions-list">
frontend/style.css CHANGED
@@ -23,7 +23,7 @@
23
  --transition: 0.2s ease;
24
  }
25
 
26
- html, body { height: 100%; overflow: hidden; }
27
 
28
  body {
29
  font-family: 'DM Sans', sans-serif;
@@ -31,13 +31,16 @@ body {
31
  color: var(--text-1);
32
  font-size: 14px;
33
  line-height: 1.6;
 
 
 
34
  }
35
 
36
  /* ── Layout ── */
37
  .app-layout {
38
  display: flex;
39
- height: 100vh;
40
- overflow: hidden;
41
  }
42
 
43
  /* ── Sidebar ── */
@@ -809,6 +812,95 @@ body {
809
  .stat-value {
810
  font-size: 28px;
811
  font-weight: 600;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
812
  color: var(--text-1);
813
  font-family: 'Cormorant Garamond', serif;
814
  }
 
23
  --transition: 0.2s ease;
24
  }
25
 
26
+ html { height: 100%; }
27
 
28
  body {
29
  font-family: 'DM Sans', sans-serif;
 
31
  color: var(--text-1);
32
  font-size: 14px;
33
  line-height: 1.6;
34
+ min-height: 100vh;
35
+ overflow-x: hidden;
36
+ overflow-y: auto;
37
  }
38
 
39
  /* ── Layout ── */
40
  .app-layout {
41
  display: flex;
42
+ min-height: 100vh;
43
+ overflow: visible;
44
  }
45
 
46
  /* ── Sidebar ── */
 
812
  .stat-value {
813
  font-size: 28px;
814
  font-weight: 600;
815
+ }
816
+
817
+ /* ── Responsive Improvements ── */
818
+ html {
819
+ scroll-behavior: smooth;
820
+ }
821
+
822
+ @media (max-width: 768px) {
823
+ :root {
824
+ --sidebar-w: 208px;
825
+ --topbar-h: 48px;
826
+ }
827
+
828
+ .app-layout {
829
+ flex-direction: column;
830
+ }
831
+
832
+ .sidebar {
833
+ width: 100% !important;
834
+ height: auto;
835
+ max-height: 40vh;
836
+ overflow-y: auto;
837
+ border-right: none;
838
+ border-bottom: 1px solid var(--border);
839
+ }
840
+
841
+ .main-wrapper {
842
+ flex: 1;
843
+ overflow-y: auto;
844
+ }
845
+
846
+ .topbar-title {
847
+ font-size: 14px;
848
+ max-width: 60%;
849
+ }
850
+
851
+ .screen {
852
+ overflow-y: auto !important;
853
+ overflow-x: hidden !important;
854
+ }
855
+
856
+ .screen-welcome {
857
+ padding: 20px 16px 60px !important;
858
+ }
859
+
860
+ .welcome-inner {
861
+ max-width: 100% !important;
862
+ }
863
+
864
+ .chat-bubble {
865
+ max-width: 95% !important;
866
+ }
867
+
868
+ .msg-text {
869
+ font-size: 13px;
870
+ }
871
+ }
872
+
873
+ @media (max-width: 480px) {
874
+ .sessions-list {
875
+ max-height: 200px;
876
+ }
877
+
878
+ .topbar {
879
+ padding: 0 12px;
880
+ }
881
+
882
+ .topbar-title {
883
+ font-size: 12px;
884
+ }
885
+
886
+ .status-pill {
887
+ font-size: 11px;
888
+ padding: 4px 8px;
889
+ }
890
+
891
+ .screen-welcome {
892
+ padding: 16px 12px 40px !important;
893
+ }
894
+
895
+ .welcome-inner h1 {
896
+ font-size: 20px !important;
897
+ line-height: 1.3;
898
+ }
899
+
900
+ .chat-container {
901
+ max-height: 300px;
902
+ }
903
+ }
904
  color: var(--text-1);
905
  font-family: 'Cormorant Garamond', serif;
906
  }