Spaces:
Build error
Build error
Upload about.py
Browse files
about.py
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
|
| 3 |
+
# Define the show() function to display the About page
|
| 4 |
+
def show():
|
| 5 |
+
# Page title and content
|
| 6 |
+
st.markdown("<h2 style='text-align:center; color:#4B8BBE;'>π About TransPolymer</h2>", unsafe_allow_html=True)
|
| 7 |
+
st.markdown("---")
|
| 8 |
+
|
| 9 |
+
# Why TransPolymer Section
|
| 10 |
+
st.markdown("""
|
| 11 |
+
<div style='background-color: #E0F7FA; padding: 15px; border-radius: 15px; text-align: center;'>
|
| 12 |
+
<h3 style='color: #00796B; margin-bottom: 10px;'>Why TransPolymer</h3>
|
| 13 |
+
<p style='font-size: 18px; color: #333333;'>
|
| 14 |
+
In TransPolymer, we use models like <b>ChemBERTa</b> to learn from SMILES strings β a special way to represent molecules.
|
| 15 |
+
This enables understanding of complex molecular structures and provides accurate predictions, even for new polymers.
|
| 16 |
+
</p>
|
| 17 |
+
</div>
|
| 18 |
+
""", unsafe_allow_html=True)
|
| 19 |
+
|
| 20 |
+
st.markdown("---")
|
| 21 |
+
|
| 22 |
+
# π¬ Properties Predicted Section with Animated Cards
|
| 23 |
+
st.markdown("### π¬ Properties Predicted by TransPolymer", unsafe_allow_html=True)
|
| 24 |
+
st.markdown("""
|
| 25 |
+
<style>
|
| 26 |
+
.card-container {
|
| 27 |
+
display: grid;
|
| 28 |
+
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
|
| 29 |
+
gap: 20px;
|
| 30 |
+
margin-top: 20px;
|
| 31 |
+
}
|
| 32 |
+
.card {
|
| 33 |
+
background: #f1f8ff;
|
| 34 |
+
border: 1px solid #d9e7f5;
|
| 35 |
+
border-radius: 20px;
|
| 36 |
+
padding: 20px;
|
| 37 |
+
text-align: center;
|
| 38 |
+
box-shadow: 0 4px 12px rgba(75, 139, 190, 0.15);
|
| 39 |
+
color: #4B8BBE;
|
| 40 |
+
font-weight: bold;
|
| 41 |
+
opacity: 0;
|
| 42 |
+
transform: scale(0.5) rotate(0deg);
|
| 43 |
+
animation: burst 6s ease-out forwards;
|
| 44 |
+
}
|
| 45 |
+
.card:nth-child(1) { animation-delay: 0.4s; }
|
| 46 |
+
.card:nth-child(2) { animation-delay: 1.2s; }
|
| 47 |
+
.card:nth-child(3) { animation-delay: 2.0s; }
|
| 48 |
+
.card:nth-child(4) { animation-delay: 2.8s; }
|
| 49 |
+
.card:nth-child(5) { animation-delay: 3.6s; }
|
| 50 |
+
.card:nth-child(6) { animation-delay: 4.4s; }
|
| 51 |
+
|
| 52 |
+
.card:hover {
|
| 53 |
+
transform: scale(1.05);
|
| 54 |
+
background-color: #e6f3ff;
|
| 55 |
+
box-shadow: 0 6px 18px rgba(75, 139, 190, 0.25);
|
| 56 |
+
text-shadow: 0px 0px 8px rgba(75, 139, 190, 0.5);
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
@keyframes burst {
|
| 60 |
+
0% {
|
| 61 |
+
opacity: 0;
|
| 62 |
+
transform: scale(0.5) rotate(-15deg);
|
| 63 |
+
}
|
| 64 |
+
40% {
|
| 65 |
+
opacity: 1;
|
| 66 |
+
transform: scale(1.1) rotate(5deg);
|
| 67 |
+
}
|
| 68 |
+
100% {
|
| 69 |
+
opacity: 1;
|
| 70 |
+
transform: scale(1) rotate(0deg);
|
| 71 |
+
}
|
| 72 |
+
}
|
| 73 |
+
</style>
|
| 74 |
+
|
| 75 |
+
<div class="card-container">
|
| 76 |
+
<div class="card">Tensile Strength</div>
|
| 77 |
+
<div class="card">Ionization Energy</div>
|
| 78 |
+
<div class="card">Electron Affinity</div>
|
| 79 |
+
<div class="card">LogP</div>
|
| 80 |
+
<div class="card">Refractive Index</div>
|
| 81 |
+
<div class="card">Molecular Weight</div>
|
| 82 |
+
</div>
|
| 83 |
+
""", unsafe_allow_html=True)
|
| 84 |
+
|
| 85 |
+
st.markdown("---")
|
| 86 |
+
|
| 87 |
+
# π¨βπ« Mentor Section
|
| 88 |
+
st.markdown("### π¨βπ« Our Mentor", unsafe_allow_html=True)
|
| 89 |
+
st.markdown("""
|
| 90 |
+
<div style='text-align: justify; font-size: 17px; color: #FFFFFF;;'>
|
| 91 |
+
We are deeply grateful to our mentor, Mrs. Navatha Kolisetti, for her constant guidance and support throughout the TransPolymer project.
|
| 92 |
+
</div>
|
| 93 |
+
""", unsafe_allow_html=True)
|
| 94 |
+
|
| 95 |
+
st.markdown("---")
|
| 96 |
+
|
| 97 |
+
# π SMILES Info and π Use Case with Pulse Animation
|
| 98 |
+
with st.container():
|
| 99 |
+
col1, col2 = st.columns(2)
|
| 100 |
+
with col1:
|
| 101 |
+
if st.button("π Learn More About SMILES"):
|
| 102 |
+
st.markdown("""
|
| 103 |
+
<div style='animation: pulse 1.5s infinite; background-color:#eef7fd; padding: 20px; border-radius: 15px; font-size: 16px; color: #333;'>
|
| 104 |
+
<b>SMILES</b> stands for <i>Simplified Molecular Input Line Entry System</i>.<br><br>
|
| 105 |
+
It encodes molecules as text strings like C1=CC=CC=C1 (for Benzene).
|
| 106 |
+
SMILES is simple yet powerful, making it perfect for AI training on chemical data.
|
| 107 |
+
</div>
|
| 108 |
+
""", unsafe_allow_html=True)
|
| 109 |
+
with col2:
|
| 110 |
+
if st.button("π Example Use Case"):
|
| 111 |
+
st.markdown("""
|
| 112 |
+
<div style='animation: pulse 1.5s infinite; background-color:#eef7fd; padding: 20px; border-radius: 15px; font-size: 16px; color: #333;'>
|
| 113 |
+
Imagine you're working on a biodegradable polymer for packaging.<br><br>
|
| 114 |
+
You need one with low density and high flexibility.
|
| 115 |
+
Just enter the SMILES string and TransPolymer will predict its physical properties β instantly.
|
| 116 |
+
</div>
|
| 117 |
+
""", unsafe_allow_html=True)
|
| 118 |
+
|
| 119 |
+
st.markdown("""
|
| 120 |
+
<style>
|
| 121 |
+
@keyframes pulse {
|
| 122 |
+
0% {transform: scale(1); opacity: 1;}
|
| 123 |
+
50% {transform: scale(1.05); opacity: 0.8;}
|
| 124 |
+
100% {transform: scale(1); opacity: 1;}
|
| 125 |
+
}
|
| 126 |
+
</style>
|
| 127 |
+
""", unsafe_allow_html=True)
|
| 128 |
+
|
| 129 |
+
st.markdown("---")
|
| 130 |
+
|
| 131 |
+
# π‘ Modern Footer
|
| 132 |
+
st.markdown("""
|
| 133 |
+
<div style="text-align: center; padding-top: 20px; font-size: 14px; color: #4B8BBE;">
|
| 134 |
+
Β© 2025 TransPolymer β’ Powered by AI & Polymer Science
|
| 135 |
+
</div>
|
| 136 |
+
""", unsafe_allow_html=True)
|