MySafeCode commited on
Commit
29b1c1c
·
verified ·
1 Parent(s): d8e137c

Delete src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +0 -57
src/streamlit_app.py DELETED
@@ -1,57 +0,0 @@
1
- import streamlit as st
2
- import json
3
- import os
4
-
5
- # --- Paths ---
6
- COMMENTS_FILE = "data/comments.json"
7
- os.makedirs("data", exist_ok=True)
8
-
9
- # --- Load existing comments ---
10
- if os.path.exists(COMMENTS_FILE):
11
- with open(COMMENTS_FILE, "r") as f:
12
- comments = json.load(f)
13
- else:
14
- comments = []
15
-
16
- # --- Shader Editor ---
17
- st.subheader("Shader Editor")
18
- default_shader = """// Fresh GLSL shader example
19
- #ifdef GL_ES
20
- precision mediump float;
21
- #endif
22
-
23
- uniform float iTime;
24
- uniform vec2 iResolution;
25
-
26
- void main() {
27
- vec2 uv = gl_FragCoord.xy / iResolution.xy;
28
- vec3 color = 0.5 + 0.5 * cos(iTime + uv.xyx * 3.0);
29
- gl_FragColor = vec4(color, 1.0);
30
- }
31
- """
32
- shader_code = st.text_area("Edit shader code", default_shader, height=300)
33
-
34
- # --- Comments Section ---
35
- st.subheader("Comments")
36
- if comments:
37
- for c in comments:
38
- st.write(f"**{c['name']}**: {c['content']}")
39
- else:
40
- st.write("_No comments yet_")
41
-
42
- # --- Add a new comment ---
43
- with st.form("comment_form", clear_on_submit=True):
44
- user_name = st.text_input("Your name", "")
45
- user_content = st.text_area("Content", height=80)
46
- submitted = st.form_submit_button("Submit")
47
-
48
- if submitted and user_content.strip():
49
- new_comment = {
50
- "name": user_name or "Anonymous",
51
- "content": user_content
52
- }
53
- comments.append(new_comment)
54
- with open(COMMENTS_FILE, "w") as f:
55
- json.dump(comments, f, indent=2)
56
- st.success("Saved!")
57
- st.experimental_rerun() # refresh to show new comment immediately