Junaidb commited on
Commit
b61c416
·
verified ·
1 Parent(s): 50698a0

Create ui.py

Browse files
Files changed (1) hide show
  1. ui.py +81 -0
ui.py ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+
3
+ def APP():
4
+
5
+ st.title("newMATTER")
6
+ st.markdown("> Engineering Programmable Biology")
7
+
8
+ tab1, tab2, tab3 = st.tabs(["PROTEIN ENGINEERING LAB", "EXECUTED OPERATIONS", "LAB OUTPUT"])
9
+
10
+ def SHOW_PROJECT_NAME():
11
+
12
+
13
+ st.header(f"setup your project @ {st.session_state.username}")
14
+
15
+ project_name=st.text_input("enter project name ")
16
+
17
+ st.session_state.projectname=project_name
18
+
19
+ st.rerun()
20
+
21
+
22
+
23
+ def SHOWTABS():
24
+
25
+
26
+ st.markdown("""
27
+ <style>
28
+ @keyframes blink {
29
+ 0% { opacity: 1; }
30
+ 50% { opacity: 0; }
31
+ 100% { opacity: 1; }
32
+ }
33
+
34
+ .blinking-text {
35
+ animation: blink 2s infinite;
36
+ font-size: 20px;
37
+ font-weight: bold;
38
+ color: red;
39
+ }
40
+ </style>
41
+ """, unsafe_allow_html=True)
42
+
43
+ st.markdown('<div class="blinking-text"> CAUTION ! </div>', unsafe_allow_html=True)
44
+
45
+ with tab1:
46
+
47
+ console_container = st.container(height=100, border=False)
48
+
49
+ with console_container:
50
+ st.code(">>> Online...", language="rust") # Use st.code for a console look
51
+
52
+ user_input = st.text_area(
53
+ "Protein Engineering Query",
54
+ placeholder="Type your query here."
55
+ )
56
+ if st.button("Execute", use_container_width=True):
57
+
58
+ output=None
59
+ if output:
60
+ # Simulate processing and append to the console
61
+ with console_container:
62
+ st.code(f"> {output}", language="rust") # Show first 200 chars
63
+ st.success("Task completed!")
64
+ else:
65
+ with console_container:
66
+ st.warning(">>>Error")
67
+
68
+
69
+ with tab2:
70
+ st.markdown("### Operations")
71
+
72
+ with tab3:
73
+ st.markdown("### Output")
74
+
75
+
76
+
77
+ if st.session_state.projectname is not "":
78
+ SHOWTABS()
79
+
80
+ else:
81
+ SHOW_PROJECT_NAME()