transpolymer commited on
Commit
705c727
·
verified ·
1 Parent(s): f031105

Update home.py

Browse files
Files changed (1) hide show
  1. home.py +153 -144
home.py CHANGED
@@ -1,144 +1,153 @@
1
- import streamlit as st
2
- import streamlit.components.v1 as components
3
-
4
- def show():
5
- # Hero Section
6
- st.markdown("""
7
- <div style="background: linear-gradient(to right, #2c3e50, #3498db); height: 300px;">
8
- <h1 style="text-align:center; color:white; padding-top:100px; font-family: Arial; font-weight: bold;">🧬 TransPolymer</h1>
9
- <h3 style="text-align:center; color:white; font-family: Arial;">A Transformer-based AI Model for Polymer Property Predictions</h3>
10
- </div>
11
- """, unsafe_allow_html=True)
12
-
13
- # Typing Animation
14
- components.html("""
15
- <div style="display:flex; justify-content:center; align-items:center; height:120px;">
16
- <span id="typed-output" style="font-size:24px; color:white; font-family:Arial;"></span>
17
- <span id="cursor" style="font-size:24px; color:white; margin-left:2px;">|</span>
18
- </div>
19
- <script src="https://cdn.jsdelivr.net/npm/typed.js@2.0.12"></script>
20
- <script>
21
- const typed = new Typed('#typed-output', {
22
- strings: [
23
- "Predict Polymer Properties Instantly",
24
- "Powered by Transformers and Chemistry",
25
- "SMILES In, Predictions Out",
26
- "Design Better Polymers with AI",
27
- "Empowering Researchers through AI"
28
- ],
29
- typeSpeed: 50, backSpeed: 30, loop: true, showCursor: false
30
- });
31
- setInterval(() => {
32
- const cursor = document.getElementById("cursor");
33
- cursor.style.visibility = (cursor.style.visibility === "hidden") ? "visible" : "hidden";
34
- }, 500);
35
- </script>
36
- """, height=120)
37
-
38
- # Flip Cards
39
- # Flip Cards
40
- st.markdown("""
41
- <style>
42
- .card-container { display: flex; justify-content: center; gap: 20px; margin-top: 50px; }
43
- .flip-card { width: 250px; height: 300px; perspective: 1000px; }
44
- .flip-card-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 0.6s; }
45
- .flip-card:hover .flip-card-inner { transform: rotateY(180deg); }
46
- .flip-card-front, .flip-card-back { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; padding: 20px; border-radius: 10px; }
47
- .flip-card-front { background-color: #ffffff; border: 2px solid #8e44ad; display: flex; justify-content: center; align-items: center; font-size: 20px; color: #8e44ad; font-family: 'Arial', sans-serif; font-weight: bold; }
48
- .flip-card-back { background-color: #8e44ad; color: white; transform: rotateY(180deg); text-align: center; font-family: 'Arial', sans-serif; }
49
- .flip-card-back h4 { color: #ffffff; }
50
- .flip-card-back p { color: #f1f1f1; font-size: 14px; }
51
- </style>
52
- <div class="card-container">
53
- <div class="flip-card">
54
- <div class="flip-card-inner">
55
- <div class="flip-card-front">Polymer Property Prediction</div>
56
- <div class="flip-card-back"><h4>Polymer Property Prediction</h4><p>Using advanced AI models to make accurate and fast polymer property predictions.</p></div>
57
- </div>
58
- </div>
59
- <div class="flip-card">
60
- <div class="flip-card-inner">
61
- <div class="flip-card-front">SMILES Input</div>
62
- <div class="flip-card-back"><h4>SMILES Input</h4><p>TransPolymer works with SMILES strings to generate accurate predictions of polymer properties.</p></div>
63
- </div>
64
- </div>
65
- <div class="flip-card">
66
- <div class="flip-card-inner">
67
- <div class="flip-card-front">Transformer Technology</div>
68
- <div class="flip-card-back"><h4>Transformer Technology</h4><p>Built on the powerful Transformer architecture .</p></div>
69
- </div>
70
- </div>
71
- </div>
72
- """, unsafe_allow_html=True)
73
-
74
- st.markdown("""
75
- <div style='
76
- padding: 25px;
77
- background: #fcf3cf;
78
- border-left: 6px solid #f39c12;
79
- border-radius: 12px;
80
- margin-top: 20px;
81
- box-shadow: 0 4px 12px rgba(0,0,0,0.1);
82
- '>
83
- <h4 style='color: #d35400; text-align: center; font-family: Arial;'>What is TransPolymer?</h4>
84
- <p style='color: #333; font-size: 16px; text-align: center; font-family: Arial;'>
85
- <strong style="color: #e67e22;">TransPolymer</strong> is a powerful AI assistant that predicts physical and chemical properties of polymers using deep learning techniques.<br>
86
- It transforms molecular SMILES strings into property insights within seconds.
87
- </p>
88
- <div style='display: flex; flex-direction: column; align-items: center;'>
89
- <ul style='color: #e67e22; font-size: 15px; list-style: none; padding-left: 0; text-align: left; font-family: Arial;'>
90
- <li>⚡ Fast predictions driven by Transformer architecture</li>
91
- <li>🔍 Supports polymer innovation and discovery</li>
92
- </ul>
93
- </div>
94
- </div>
95
- """, unsafe_allow_html=True)
96
-
97
-
98
- # Circular Layout
99
- components.html("""
100
- <style>
101
- .circle-container { position:relative; width:500px; height:500px; margin:40px auto; cursor:pointer; }
102
- .center-circle {
103
- width:180px; height:180px; background:#27ae60; border-radius:50%;
104
- position:absolute; top:50%; left:50%; transform:translate(-50%,-50%);
105
- display:flex; align-items:center; justify-content:center;
106
- color:#fff; font-size:14px; font-weight:bold; text-align:center;
107
- animation:pulse 2s infinite;
108
- }
109
- .property-circle {
110
- width:120px; height:120px; border-radius:50%;
111
- position:absolute; display:flex; align-items:center; justify-content:center;
112
- color:#fff; font-size:13px; font-weight:bold; text-align:center;
113
- visibility:hidden; opacity:0; transition:all 0.5s ease; padding:10px;
114
- }
115
- .circle-container.show .property-circle { visibility:visible; opacity:1; }
116
- .p1 { background:#1abc9c; top:10%; left:50%; transform:translate(-50%, -50%); }
117
- .p2 { background:#3498db; top:30%; left:85%; transform:translate(-50%, -50%); }
118
- .p3 { background:#9b59b6; top:70%; left:85%; transform:translate(-50%, -50%); }
119
- .p4 { background:#e67e22; top:90%; left:50%; transform:translate(-50%, -50%); }
120
- .p5 { background:#f39c12; top:70%; left:15%; transform:translate(-50%, -50%); }
121
- .p6 { background:#e74c3c; top:30%; left:15%; transform:translate(-50%, -50%); }
122
- @keyframes pulse {
123
- 0%,100% { transform:translate(-50%, -50%) scale(1); }
124
- 50% { transform:translate(-50%, -50%) scale(1.05); }
125
- }
126
- </style>
127
- <div class="circle-container" id="circleLayout" onclick="this.classList.add('show')">
128
- <div class="center-circle">Who Can Use TransPolymer?</div>
129
- <div class="property-circle p1">Polymer Scientists</div>
130
- <div class="property-circle p2">Drug Delivery Researchers</div>
131
- <div class="property-circle p3">Materials Scientists</div>
132
- <div class="property-circle p4">Optical Material Engineers</div>
133
- <div class="property-circle p5">Environmental Researchers</div>
134
- <div class="property-circle p6">Students in Chemistry</div>
135
- </div>
136
- """, height=600)
137
-
138
- # Footer
139
- st.markdown("""
140
- <div style="text-align:center; margin-top:50px;">
141
- <p style="color:#555; font-family:Arial;">Transpolymer - Simple. Smart. Scientific</p>
142
- <p style="color:#888; font-family:Arial; font-size:14px;">&copy; 2025 TransPolymer. All rights reserved.</p>
143
- </div>
144
- """, unsafe_allow_html=True)
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import streamlit.components.v1 as components
3
+ from streamlit_extras.switch_page_button import switch_page
4
+ import login_page
5
+
6
+
7
+ def show():
8
+ # Top-right Logout button
9
+ col1, col2 = st.columns([8, 2])
10
+ with col2:
11
+ if st.button("Logout", key="logout_btn"):
12
+ st.session_state.logged_in = False
13
+ st.session_state.page = "Home"
14
+ st.rerun()
15
+
16
+ # Hero Section
17
+ st.markdown("""
18
+ <div style="background: linear-gradient(to right, #2c3e50, #3498db); height: 300px;">
19
+ <h1 style="text-align:center; color:white; padding-top:100px; font-family: Arial; font-weight: bold;">🧬 TransPolymer</h1>
20
+ <h3 style="text-align:center; color:white; font-family: Arial;">A Transformer-based AI Model for Polymer Property Predictions</h3>
21
+ </div>
22
+ """, unsafe_allow_html=True)
23
+
24
+ # Typing Animation
25
+ components.html("""
26
+ <div style="display:flex; justify-content:center; align-items:center; height:120px;">
27
+ <span id="typed-output" style="font-size:24px; color:white; font-family:Arial;"></span>
28
+ <span id="cursor" style="font-size:24px; color:white; margin-left:2px;">|</span>
29
+ </div>
30
+ <script src="https://cdn.jsdelivr.net/npm/typed.js@2.0.12"></script>
31
+ <script>
32
+ const typed = new Typed('#typed-output', {
33
+ strings: [
34
+ "Predict Polymer Properties Instantly",
35
+ "Powered by Transformers and Chemistry",
36
+ "SMILES In, Predictions Out",
37
+ "Design Better Polymers with AI",
38
+ "Empowering Researchers through AI"
39
+ ],
40
+ typeSpeed: 50, backSpeed: 30, loop: true, showCursor: false
41
+ });
42
+ setInterval(() => {
43
+ const cursor = document.getElementById("cursor");
44
+ cursor.style.visibility = (cursor.style.visibility === "hidden") ? "visible" : "hidden";
45
+ }, 500);
46
+ </script>
47
+ """, height=120)
48
+
49
+ # Flip Cards
50
+ st.markdown("""
51
+ <style>
52
+ .card-container { display: flex; justify-content: center; gap: 20px; margin-top: 50px; }
53
+ .flip-card { width: 250px; height: 300px; perspective: 1000px; }
54
+ .flip-card-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 0.6s; }
55
+ .flip-card:hover .flip-card-inner { transform: rotateY(180deg); }
56
+ .flip-card-front, .flip-card-back { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; padding: 20px; border-radius: 10px; }
57
+ .flip-card-front { background-color: #ffffff; border: 2px solid #8e44ad; display: flex; justify-content: center; align-items: center; font-size: 20px; color: #8e44ad; font-family: 'Arial', sans-serif; font-weight: bold; }
58
+ .flip-card-back { background-color: #8e44ad; color: white; transform: rotateY(180deg); text-align: center; font-family: 'Arial', sans-serif; }
59
+ .flip-card-back h4 { color: #ffffff; }
60
+ .flip-card-back p { color: #f1f1f1; font-size: 14px; }
61
+ </style>
62
+ <div class="card-container">
63
+ <div class="flip-card">
64
+ <div class="flip-card-inner">
65
+ <div class="flip-card-front">Polymer Property Prediction</div>
66
+ <div class="flip-card-back"><h4>Polymer Property Prediction</h4><p>Using advanced AI models to make accurate and fast polymer property predictions.</p></div>
67
+ </div>
68
+ </div>
69
+ <div class="flip-card">
70
+ <div class="flip-card-inner">
71
+ <div class="flip-card-front">SMILES Input</div>
72
+ <div class="flip-card-back"><h4>SMILES Input</h4><p>TransPolymer works with SMILES strings to generate accurate predictions of polymer properties.</p></div>
73
+ </div>
74
+ </div>
75
+ <div class="flip-card">
76
+ <div class="flip-card-inner">
77
+ <div class="flip-card-front">Transformer Technology</div>
78
+ <div class="flip-card-back"><h4>Transformer Technology</h4><p>Built on the powerful Transformer architecture .</p></div>
79
+ </div>
80
+ </div>
81
+ </div>
82
+ """, unsafe_allow_html=True)
83
+
84
+ st.markdown("""
85
+ <div style='
86
+ padding: 25px;
87
+ background: #fcf3cf;
88
+ border-left: 6px solid #f39c12;
89
+ border-radius: 12px;
90
+ margin-top: 20px;
91
+ box-shadow: 0 4px 12px rgba(0,0,0,0.1);
92
+ '>
93
+ <h4 style='color: #d35400; text-align: center; font-family: Arial;'>What is TransPolymer?</h4>
94
+ <p style='color: #333; font-size: 16px; text-align: center; font-family: Arial;'>
95
+ <strong style="color: #e67e22;">TransPolymer</strong> is a powerful AI assistant that predicts physical and chemical properties of polymers using deep learning techniques.<br>
96
+ It transforms molecular SMILES strings into property insights within seconds.
97
+ </p>
98
+ <div style='display: flex; flex-direction: column; align-items: center;'>
99
+ <ul style='color: #e67e22; font-size: 15px; list-style: none; padding-left: 0; text-align: left; font-family: Arial;'>
100
+ <li>⚡ Fast predictions driven by Transformer architecture</li>
101
+ <li>🔍 Supports polymer innovation and discovery</li>
102
+ </ul>
103
+ </div>
104
+ </div>
105
+ """, unsafe_allow_html=True)
106
+
107
+ # Circular Layout
108
+ components.html("""
109
+ <style>
110
+ .circle-container { position:relative; width:500px; height:500px; margin:40px auto; cursor:pointer; }
111
+ .center-circle {
112
+ width:180px; height:180px; background:#27ae60; border-radius:50%;
113
+ position:absolute; top:50%; left:50%; transform:translate(-50%,-50%);
114
+ display:flex; align-items:center; justify-content:center;
115
+ color:#fff; font-size:14px; font-weight:bold; text-align:center;
116
+ animation:pulse 2s infinite;
117
+ }
118
+ .property-circle {
119
+ width:120px; height:120px; border-radius:50%;
120
+ position:absolute; display:flex; align-items:center; justify-content:center;
121
+ color:#fff; font-size:13px; font-weight:bold; text-align:center;
122
+ visibility:hidden; opacity:0; transition:all 0.5s ease; padding:10px;
123
+ }
124
+ .circle-container.show .property-circle { visibility:visible; opacity:1; }
125
+ .p1 { background:#1abc9c; top:10%; left:50%; transform:translate(-50%, -50%); }
126
+ .p2 { background:#3498db; top:30%; left:85%; transform:translate(-50%, -50%); }
127
+ .p3 { background:#9b59b6; top:70%; left:85%; transform:translate(-50%, -50%); }
128
+ .p4 { background:#e67e22; top:90%; left:50%; transform:translate(-50%, -50%); }
129
+ .p5 { background:#f39c12; top:70%; left:15%; transform:translate(-50%, -50%); }
130
+ .p6 { background:#e74c3c; top:30%; left:15%; transform:translate(-50%, -50%); }
131
+ @keyframes pulse {
132
+ 0%,100% { transform:translate(-50%, -50%) scale(1); }
133
+ 50% { transform:translate(-50%, -50%) scale(1.05); }
134
+ }
135
+ </style>
136
+ <div class="circle-container" id="circleLayout" onclick="this.classList.add('show')">
137
+ <div class="center-circle">Who Can Use TransPolymer?</div>
138
+ <div class="property-circle p1">Polymer Scientists</div>
139
+ <div class="property-circle p2">Drug Delivery Researchers</div>
140
+ <div class="property-circle p3">Materials Scientists</div>
141
+ <div class="property-circle p4">Optical Material Engineers</div>
142
+ <div class="property-circle p5">Environmental Researchers</div>
143
+ <div class="property-circle p6">Students in Chemistry</div>
144
+ </div>
145
+ """, height=600)
146
+
147
+ # Footer
148
+ st.markdown("""
149
+ <div style="text-align:center; margin-top:50px;">
150
+ <p style="color:#555; font-family:Arial;">Transpolymer - Simple. Smart. Scientific</p>
151
+ <p style="color:#888; font-family:Arial; font-size:14px;">&copy; 2025 TransPolymer. All rights reserved.</p>
152
+ </div>
153
+ """, unsafe_allow_html=True)