Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,69 +15,204 @@ from streamlit_drawable_canvas import st_canvas
|
|
| 15 |
|
| 16 |
import streamlit as st
|
| 17 |
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
| 20 |
|
| 21 |
-
# Custom CSS for a
|
| 22 |
custom_css = """
|
| 23 |
<style>
|
| 24 |
-
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&display=swap');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
body {
|
| 27 |
-
color:
|
| 28 |
-
background-color:
|
| 29 |
-
font-family: '
|
|
|
|
| 30 |
}
|
| 31 |
|
| 32 |
.stApp {
|
| 33 |
-
background
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
linear-gradient(
|
| 37 |
-
|
|
|
|
| 38 |
}
|
| 39 |
|
| 40 |
-
@keyframes
|
| 41 |
0% { background-position: 0% 50%; }
|
| 42 |
100% { background-position: 100% 50%; }
|
| 43 |
}
|
| 44 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
.stButton>button {
|
| 46 |
-
color:
|
| 47 |
-
border: 2px solid
|
| 48 |
-
border-radius:
|
| 49 |
-
background: linear-gradient(45deg,
|
| 50 |
-
box-shadow: 0 0 15px
|
| 51 |
transition: all 0.3s ease;
|
|
|
|
|
|
|
|
|
|
| 52 |
}
|
| 53 |
|
| 54 |
.stButton>button:hover {
|
| 55 |
-
transform: scale(1.05);
|
| 56 |
-
box-shadow: 0 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
}
|
| 58 |
|
| 59 |
.stSlider>div>div>div>div {
|
| 60 |
-
background-color:
|
| 61 |
-
box-shadow: 0 0 10px #00FFFF;
|
| 62 |
}
|
| 63 |
|
| 64 |
-
.
|
| 65 |
-
background-color:
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
transition: all 0.3s ease;
|
| 71 |
}
|
| 72 |
|
| 73 |
-
.
|
| 74 |
-
|
| 75 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
}
|
| 77 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
.stProgress > div > div {
|
| 79 |
-
background-color:
|
| 80 |
-
background-image: linear-gradient(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 81 |
background-size: 40px 40px;
|
| 82 |
animation: progress-bar-stripes 1s linear infinite;
|
| 83 |
}
|
|
@@ -87,35 +222,117 @@ custom_css = """
|
|
| 87 |
100% { background-position: 0 0; }
|
| 88 |
}
|
| 89 |
|
|
|
|
| 90 |
.stCheckbox > label > div {
|
| 91 |
-
border-color:
|
|
|
|
| 92 |
}
|
| 93 |
|
| 94 |
.stCheckbox > label > div[data-checked="true"] {
|
| 95 |
-
background-color:
|
|
|
|
| 96 |
}
|
| 97 |
|
| 98 |
-
/* Futuristic
|
| 99 |
-
|
| 100 |
-
|
|
|
|
|
|
|
| 101 |
}
|
| 102 |
|
| 103 |
-
|
| 104 |
-
|
|
|
|
| 105 |
}
|
| 106 |
|
| 107 |
-
|
| 108 |
-
background:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 109 |
border-radius: 5px;
|
|
|
|
|
|
|
| 110 |
}
|
| 111 |
|
| 112 |
-
|
| 113 |
-
|
| 114 |
}
|
| 115 |
|
| 116 |
-
/*
|
| 117 |
-
|
| 118 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 119 |
}
|
| 120 |
</style>
|
| 121 |
"""
|
|
@@ -127,7 +344,8 @@ st.markdown(custom_css, unsafe_allow_html=True)
|
|
| 127 |
AVATAR_WIDTH, AVATAR_HEIGHT = 600, 800
|
| 128 |
|
| 129 |
# Your Streamlit app code goes here
|
| 130 |
-
st.title("NeuraSense AI")
|
|
|
|
| 131 |
|
| 132 |
# Set up DialoGPT model
|
| 133 |
@st.cache_resource
|
|
|
|
| 15 |
|
| 16 |
import streamlit as st
|
| 17 |
|
| 18 |
+
import streamlit as st
|
| 19 |
+
|
| 20 |
+
# Set page config
|
| 21 |
+
st.set_page_config(page_title="NeuraSense AI - Cyberpunk Edition", page_icon="🧠", layout="wide")
|
| 22 |
|
| 23 |
+
# Enhanced Custom CSS for a hyper-cyberpunk realistic look
|
| 24 |
custom_css = """
|
| 25 |
<style>
|
| 26 |
+
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;700&family=Roboto+Mono:wght@400;700&display=swap');
|
| 27 |
+
|
| 28 |
+
:root {
|
| 29 |
+
--neon-blue: #00FFFF;
|
| 30 |
+
--neon-pink: #FF00FF;
|
| 31 |
+
--neon-green: #39FF14;
|
| 32 |
+
--dark-bg: #0a0a0a;
|
| 33 |
+
--darker-bg: #050505;
|
| 34 |
+
--light-text: #E0E0E0;
|
| 35 |
+
}
|
| 36 |
|
| 37 |
body {
|
| 38 |
+
color: var(--light-text);
|
| 39 |
+
background-color: var(--dark-bg);
|
| 40 |
+
font-family: 'Roboto Mono', monospace;
|
| 41 |
+
overflow-x: hidden;
|
| 42 |
}
|
| 43 |
|
| 44 |
.stApp {
|
| 45 |
+
background:
|
| 46 |
+
linear-gradient(45deg, var(--darker-bg) 0%, var(--dark-bg) 100%),
|
| 47 |
+
repeating-linear-gradient(45deg, #000 0%, #000 2%, transparent 2%, transparent 4%),
|
| 48 |
+
repeating-linear-gradient(-45deg, #111 0%, #111 1%, transparent 1%, transparent 3%);
|
| 49 |
+
background-blend-mode: overlay;
|
| 50 |
+
animation: backgroundPulse 20s infinite alternate;
|
| 51 |
}
|
| 52 |
|
| 53 |
+
@keyframes backgroundPulse {
|
| 54 |
0% { background-position: 0% 50%; }
|
| 55 |
100% { background-position: 100% 50%; }
|
| 56 |
}
|
| 57 |
|
| 58 |
+
h1, h2, h3 {
|
| 59 |
+
font-family: 'Orbitron', sans-serif;
|
| 60 |
+
position: relative;
|
| 61 |
+
text-shadow:
|
| 62 |
+
0 0 5px var(--neon-blue),
|
| 63 |
+
0 0 10px var(--neon-blue),
|
| 64 |
+
0 0 20px var(--neon-blue),
|
| 65 |
+
0 0 40px var(--neon-blue);
|
| 66 |
+
animation: textGlitch 5s infinite alternate;
|
| 67 |
+
}
|
| 68 |
+
|
| 69 |
+
@keyframes textGlitch {
|
| 70 |
+
0% { transform: skew(0deg); }
|
| 71 |
+
20% { transform: skew(5deg); text-shadow: 3px 3px 0 var(--neon-pink); }
|
| 72 |
+
40% { transform: skew(-5deg); text-shadow: -3px -3px 0 var(--neon-green); }
|
| 73 |
+
60% { transform: skew(3deg); text-shadow: 2px -2px 0 var(--neon-blue); }
|
| 74 |
+
80% { transform: skew(-3deg); text-shadow: -2px 2px 0 var(--neon-pink); }
|
| 75 |
+
100% { transform: skew(0deg); }
|
| 76 |
+
}
|
| 77 |
+
|
| 78 |
.stButton>button {
|
| 79 |
+
color: var(--neon-blue);
|
| 80 |
+
border: 2px solid var(--neon-blue);
|
| 81 |
+
border-radius: 5px;
|
| 82 |
+
background: linear-gradient(45deg, rgba(0,255,255,0.1), rgba(0,255,255,0.3));
|
| 83 |
+
box-shadow: 0 0 15px var(--neon-blue);
|
| 84 |
transition: all 0.3s ease;
|
| 85 |
+
text-transform: uppercase;
|
| 86 |
+
letter-spacing: 2px;
|
| 87 |
+
backdrop-filter: blur(5px);
|
| 88 |
}
|
| 89 |
|
| 90 |
.stButton>button:hover {
|
| 91 |
+
transform: scale(1.05) translateY(-3px);
|
| 92 |
+
box-shadow: 0 0 30px var(--neon-blue);
|
| 93 |
+
text-shadow: 0 0 5px var(--neon-blue);
|
| 94 |
+
}
|
| 95 |
+
|
| 96 |
+
.stTextInput>div>div>input, .stTextArea>div>div>textarea, .stSelectbox>div>div>div {
|
| 97 |
+
background-color: rgba(0, 255, 255, 0.1);
|
| 98 |
+
border: 1px solid var(--neon-blue);
|
| 99 |
+
border-radius: 5px;
|
| 100 |
+
color: var(--neon-blue);
|
| 101 |
+
backdrop-filter: blur(5px);
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
.stTextInput>div>div>input:focus, .stTextArea>div>div>textarea:focus, .stSelectbox>div>div>div:focus {
|
| 105 |
+
box-shadow: 0 0 20px var(--neon-blue);
|
| 106 |
}
|
| 107 |
|
| 108 |
.stSlider>div>div>div>div {
|
| 109 |
+
background-color: var(--neon-blue);
|
|
|
|
| 110 |
}
|
| 111 |
|
| 112 |
+
.stSlider>div>div>div>div>div {
|
| 113 |
+
background-color: var(--neon-pink);
|
| 114 |
+
box-shadow: 0 0 10px var(--neon-pink);
|
| 115 |
+
}
|
| 116 |
+
|
| 117 |
+
::-webkit-scrollbar {
|
| 118 |
+
width: 10px;
|
| 119 |
+
height: 10px;
|
| 120 |
+
}
|
| 121 |
+
|
| 122 |
+
::-webkit-scrollbar-track {
|
| 123 |
+
background: var(--darker-bg);
|
| 124 |
+
border-radius: 5px;
|
| 125 |
+
}
|
| 126 |
+
|
| 127 |
+
::-webkit-scrollbar-thumb {
|
| 128 |
+
background: var(--neon-blue);
|
| 129 |
+
border-radius: 5px;
|
| 130 |
+
box-shadow: 0 0 5px var(--neon-blue);
|
| 131 |
+
}
|
| 132 |
+
|
| 133 |
+
::-webkit-scrollbar-thumb:hover {
|
| 134 |
+
background: var(--neon-pink);
|
| 135 |
+
box-shadow: 0 0 5px var(--neon-pink);
|
| 136 |
+
}
|
| 137 |
+
|
| 138 |
+
.stPlot, .stDataFrame {
|
| 139 |
+
border: 1px solid var(--neon-blue);
|
| 140 |
+
border-radius: 5px;
|
| 141 |
+
overflow: hidden;
|
| 142 |
+
box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
|
| 143 |
+
}
|
| 144 |
+
|
| 145 |
+
.stImage, .stIcon {
|
| 146 |
+
filter: drop-shadow(0 0 5px var(--neon-blue));
|
| 147 |
+
}
|
| 148 |
+
|
| 149 |
+
.stSidebar, .stContainer {
|
| 150 |
+
background:
|
| 151 |
+
linear-gradient(45deg, var(--darker-bg) 0%, var(--dark-bg) 100%),
|
| 152 |
+
repeating-linear-gradient(45deg, #000 0%, #000 2%, transparent 2%, transparent 4%);
|
| 153 |
+
animation: sidebarPulse 10s infinite alternate;
|
| 154 |
+
}
|
| 155 |
+
|
| 156 |
+
@keyframes sidebarPulse {
|
| 157 |
+
0% { background-position: 0% 50%; }
|
| 158 |
+
100% { background-position: 100% 50%; }
|
| 159 |
+
}
|
| 160 |
+
|
| 161 |
+
.element-container {
|
| 162 |
+
position: relative;
|
| 163 |
+
}
|
| 164 |
+
|
| 165 |
+
.element-container::before {
|
| 166 |
+
content: '';
|
| 167 |
+
position: absolute;
|
| 168 |
+
top: -5px;
|
| 169 |
+
left: -5px;
|
| 170 |
+
right: -5px;
|
| 171 |
+
bottom: -5px;
|
| 172 |
+
border: 1px solid var(--neon-blue);
|
| 173 |
+
border-radius: 10px;
|
| 174 |
+
opacity: 0.5;
|
| 175 |
+
pointer-events: none;
|
| 176 |
+
}
|
| 177 |
+
|
| 178 |
+
.stMarkdown a {
|
| 179 |
+
color: var(--neon-pink);
|
| 180 |
+
text-decoration: none;
|
| 181 |
+
position: relative;
|
| 182 |
transition: all 0.3s ease;
|
| 183 |
}
|
| 184 |
|
| 185 |
+
.stMarkdown a::after {
|
| 186 |
+
content: '';
|
| 187 |
+
position: absolute;
|
| 188 |
+
width: 100%;
|
| 189 |
+
height: 1px;
|
| 190 |
+
bottom: -2px;
|
| 191 |
+
left: 0;
|
| 192 |
+
background-color: var(--neon-pink);
|
| 193 |
+
transform: scaleX(0);
|
| 194 |
+
transform-origin: bottom right;
|
| 195 |
+
transition: transform 0.3s ease;
|
| 196 |
}
|
| 197 |
|
| 198 |
+
.stMarkdown a:hover::after {
|
| 199 |
+
transform: scaleX(1);
|
| 200 |
+
transform-origin: bottom left;
|
| 201 |
+
}
|
| 202 |
+
|
| 203 |
+
/* Cyberpunk-style progress bar */
|
| 204 |
.stProgress > div > div {
|
| 205 |
+
background-color: var(--neon-blue);
|
| 206 |
+
background-image: linear-gradient(
|
| 207 |
+
45deg,
|
| 208 |
+
var(--neon-pink) 25%,
|
| 209 |
+
transparent 25%,
|
| 210 |
+
transparent 50%,
|
| 211 |
+
var(--neon-pink) 50%,
|
| 212 |
+
var(--neon-pink) 75%,
|
| 213 |
+
transparent 75%,
|
| 214 |
+
transparent
|
| 215 |
+
);
|
| 216 |
background-size: 40px 40px;
|
| 217 |
animation: progress-bar-stripes 1s linear infinite;
|
| 218 |
}
|
|
|
|
| 222 |
100% { background-position: 0 0; }
|
| 223 |
}
|
| 224 |
|
| 225 |
+
/* Glowing checkbox */
|
| 226 |
.stCheckbox > label > div {
|
| 227 |
+
border-color: var(--neon-blue);
|
| 228 |
+
transition: all 0.3s ease;
|
| 229 |
}
|
| 230 |
|
| 231 |
.stCheckbox > label > div[data-checked="true"] {
|
| 232 |
+
background-color: var(--neon-blue);
|
| 233 |
+
box-shadow: 0 0 10px var(--neon-blue);
|
| 234 |
}
|
| 235 |
|
| 236 |
+
/* Futuristic radio button */
|
| 237 |
+
.stRadio > div {
|
| 238 |
+
background-color: rgba(0, 255, 255, 0.1);
|
| 239 |
+
border-radius: 10px;
|
| 240 |
+
padding: 10px;
|
| 241 |
}
|
| 242 |
|
| 243 |
+
.stRadio > div > label > div {
|
| 244 |
+
border-color: var(--neon-blue);
|
| 245 |
+
transition: all 0.3s ease;
|
| 246 |
}
|
| 247 |
|
| 248 |
+
.stRadio > div > label > div[data-checked="true"] {
|
| 249 |
+
background-color: var(--neon-blue);
|
| 250 |
+
box-shadow: 0 0 10px var(--neon-blue);
|
| 251 |
+
}
|
| 252 |
+
|
| 253 |
+
/* Cyberpunk-style tables */
|
| 254 |
+
.stDataFrame table {
|
| 255 |
+
border-collapse: separate;
|
| 256 |
+
border-spacing: 0;
|
| 257 |
+
border: 1px solid var(--neon-blue);
|
| 258 |
+
border-radius: 10px;
|
| 259 |
+
overflow: hidden;
|
| 260 |
+
}
|
| 261 |
+
|
| 262 |
+
.stDataFrame th {
|
| 263 |
+
background-color: rgba(0, 255, 255, 0.2);
|
| 264 |
+
color: var(--neon-blue);
|
| 265 |
+
text-transform: uppercase;
|
| 266 |
+
letter-spacing: 1px;
|
| 267 |
+
}
|
| 268 |
+
|
| 269 |
+
.stDataFrame td {
|
| 270 |
+
border-bottom: 1px solid rgba(0, 255, 255, 0.2);
|
| 271 |
+
}
|
| 272 |
+
|
| 273 |
+
.stDataFrame tr:last-child td {
|
| 274 |
+
border-bottom: none;
|
| 275 |
+
}
|
| 276 |
+
|
| 277 |
+
/* Futuristic file uploader */
|
| 278 |
+
.stFileUploader > div {
|
| 279 |
+
border: 2px dashed var(--neon-blue);
|
| 280 |
+
border-radius: 10px;
|
| 281 |
+
background-color: rgba(0, 255, 255, 0.05);
|
| 282 |
+
transition: all 0.3s ease;
|
| 283 |
+
}
|
| 284 |
+
|
| 285 |
+
.stFileUploader > div:hover {
|
| 286 |
+
background-color: rgba(0, 255, 255, 0.1);
|
| 287 |
+
box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
|
| 288 |
+
}
|
| 289 |
+
|
| 290 |
+
/* Cyberpunk-style tooltips */
|
| 291 |
+
.stTooltipIcon {
|
| 292 |
+
color: var(--neon-pink);
|
| 293 |
+
transition: all 0.3s ease;
|
| 294 |
+
}
|
| 295 |
+
|
| 296 |
+
.stTooltipIcon:hover {
|
| 297 |
+
color: var(--neon-blue);
|
| 298 |
+
text-shadow: 0 0 5px var(--neon-blue);
|
| 299 |
+
}
|
| 300 |
+
|
| 301 |
+
/* Futuristic date input */
|
| 302 |
+
.stDateInput > div > div > input {
|
| 303 |
+
background-color: rgba(0, 255, 255, 0.1);
|
| 304 |
+
border: 1px solid var(--neon-blue);
|
| 305 |
border-radius: 5px;
|
| 306 |
+
color: var(--neon-blue);
|
| 307 |
+
backdrop-filter: blur(5px);
|
| 308 |
}
|
| 309 |
|
| 310 |
+
.stDateInput > div > div > input:focus {
|
| 311 |
+
box-shadow: 0 0 20px var(--neon-blue);
|
| 312 |
}
|
| 313 |
|
| 314 |
+
/* Cyberpunk-style code blocks */
|
| 315 |
+
.stCodeBlock {
|
| 316 |
+
background-color: rgba(0, 0, 0, 0.6);
|
| 317 |
+
border: 1px solid var(--neon-green);
|
| 318 |
+
border-radius: 5px;
|
| 319 |
+
color: var(--neon-green);
|
| 320 |
+
font-family: 'Roboto Mono', monospace;
|
| 321 |
+
padding: 10px;
|
| 322 |
+
position: relative;
|
| 323 |
+
overflow: hidden;
|
| 324 |
+
}
|
| 325 |
+
|
| 326 |
+
.stCodeBlock::before {
|
| 327 |
+
content: '';
|
| 328 |
+
position: absolute;
|
| 329 |
+
top: -10px;
|
| 330 |
+
left: -10px;
|
| 331 |
+
right: -10px;
|
| 332 |
+
bottom: -10px;
|
| 333 |
+
background: linear-gradient(45deg, var(--neon-green), transparent);
|
| 334 |
+
opacity: 0.1;
|
| 335 |
+
z-index: -1;
|
| 336 |
}
|
| 337 |
</style>
|
| 338 |
"""
|
|
|
|
| 344 |
AVATAR_WIDTH, AVATAR_HEIGHT = 600, 800
|
| 345 |
|
| 346 |
# Your Streamlit app code goes here
|
| 347 |
+
st.title("NeuraSense AI - Cyberpunk Edition")
|
| 348 |
+
|
| 349 |
|
| 350 |
# Set up DialoGPT model
|
| 351 |
@st.cache_resource
|