arthrod commited on
Commit
71d0164
·
verified ·
1 Parent(s): e9bcfed

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +60 -13
app.py CHANGED
@@ -1,11 +1,11 @@
1
- import marimo as mo
2
 
3
  __generated_with = "0.13.1-dev16"
4
- app = marimo.App(layout_file="layouts/notebook.slides.json")
5
 
6
  @app.cell
7
  def _(mo):
8
-
9
  mo.Html("""
10
  <!DOCTYPE html>
11
  <html lang="en">
@@ -112,12 +112,26 @@ def _(mo):
112
  </head>
113
  <body>
114
  <div class="container">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
  """)
116
  return
117
 
118
  @app.cell
119
  def _(mo):
120
-
121
  # Page 2 Content
122
  mo.Html("""
123
  <!-- Page 2 -->
@@ -139,10 +153,9 @@ def _(mo):
139
  """)
140
  return
141
 
142
-
143
  @app.cell
144
  def _(mo):
145
-
146
  # Page 3 Content
147
  mo.Html("""
148
  <!-- Page 3 -->
@@ -195,11 +208,9 @@ def _(mo):
195
  """)
196
  return
197
 
198
-
199
-
200
  @app.cell
201
  def _(mo):
202
-
203
  # Page 4: Conclusion
204
  mo.Html("""
205
  <!-- Page 4: Conclusion -->
@@ -222,17 +233,53 @@ def _(mo):
222
  <button id="nextBtn">Next</button>
223
  </div>
224
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
225
  </body>
226
  </html>
227
  """)
228
  return
229
 
230
-
231
  @app.cell
232
  def _():
233
  import marimo as mo
234
- return (mo,)
235
-
236
 
237
  if __name__ == "__main__":
238
- app.run()
 
1
+ import marimo
2
 
3
  __generated_with = "0.13.1-dev16"
4
+
5
 
6
  @app.cell
7
  def _(mo):
8
+ import marimo as mo
9
  mo.Html("""
10
  <!DOCTYPE html>
11
  <html lang="en">
 
112
  </head>
113
  <body>
114
  <div class="container">
115
+ <!-- Page 1 -->
116
+ <div id="page1" class="page active">
117
+ <h2>Our t:able Legal Journey</h2>
118
+ <p>When we thought legal would say "no", we were surprised by their creative "yes, and"!</p>
119
+ <svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
120
+ <title>Legal Scale</title>
121
+ <line x1="50" y1="20" x2="50" y2="80" stroke="#6c757d" stroke-width="3"/>
122
+ <line x1="30" y1="30" x2="70" y2="30" stroke="#6c757d" stroke-width="3"/>
123
+ <circle cx="50" cy="20" r="5" fill="#00A87E"/>
124
+ <circle cx="30" cy="40" r="10" fill="#e6f7f3" stroke="#b2e0d4" stroke-width="1"/>
125
+ <circle cx="70" cy="40" r="10" fill="#e6f7f3" stroke="#b2e0d4" stroke-width="1"/>
126
+ <rect x="40" y="80" width="20" height="5" fill="#6c757d"/>
127
+ </svg>
128
+ </div>
129
  """)
130
  return
131
 
132
  @app.cell
133
  def _(mo):
134
+ import marimo as mo
135
  # Page 2 Content
136
  mo.Html("""
137
  <!-- Page 2 -->
 
153
  """)
154
  return
155
 
 
156
  @app.cell
157
  def _(mo):
158
+ import marimo as mo
159
  # Page 3 Content
160
  mo.Html("""
161
  <!-- Page 3 -->
 
208
  """)
209
  return
210
 
 
 
211
  @app.cell
212
  def _(mo):
213
+ import marimo as mo
214
  # Page 4: Conclusion
215
  mo.Html("""
216
  <!-- Page 4: Conclusion -->
 
233
  <button id="nextBtn">Next</button>
234
  </div>
235
  </div>
236
+ <script>
237
+ document.addEventListener('DOMContentLoaded', function() {
238
+ const pages = document.querySelectorAll('.page');
239
+ const prevBtn = document.getElementById('prevBtn');
240
+ const nextBtn = document.getElementById('nextBtn');
241
+ let currentPage = 0;
242
+
243
+ function showPage(pageIndex) {
244
+ pages.forEach((page, index) => {
245
+ if (index === pageIndex) {
246
+ page.classList.add('active');
247
+ } else {
248
+ page.classList.remove('active');
249
+ }
250
+ });
251
+
252
+ prevBtn.disabled = pageIndex === 0;
253
+ nextBtn.disabled = pageIndex === pages.length - 1;
254
+ }
255
+
256
+ prevBtn.addEventListener('click', function() {
257
+ if (currentPage > 0) {
258
+ currentPage--;
259
+ showPage(currentPage);
260
+ }
261
+ });
262
+
263
+ nextBtn.addEventListener('click', function() {
264
+ if (currentPage < pages.length - 1) {
265
+ currentPage++;
266
+ showPage(currentPage);
267
+ }
268
+ });
269
+
270
+ // Initialize
271
+ showPage(currentPage);
272
+ });
273
+ </script>
274
  </body>
275
  </html>
276
  """)
277
  return
278
 
 
279
  @app.cell
280
  def _():
281
  import marimo as mo
282
+ return mo
 
283
 
284
  if __name__ == "__main__":
285
+ app.run()