Spaces:
Running
Running
added abckground video
Browse files- src/Home.py +47 -1
src/Home.py
CHANGED
|
@@ -17,7 +17,6 @@ from ase import Atoms
|
|
| 17 |
from ase.io import read as ase_read
|
| 18 |
import pandas as pd
|
| 19 |
|
| 20 |
-
|
| 21 |
# Set page configuration
|
| 22 |
st.set_page_config(
|
| 23 |
page_title='PyFock GUI - Interactive DFT Calculations',
|
|
@@ -27,6 +26,53 @@ st.set_page_config(
|
|
| 27 |
'About': "PyFock GUI - A web interface for PyFock, a pure Python DFT code with Numba JIT acceleration"
|
| 28 |
}
|
| 29 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
# Sidebar with enhanced styling
|
| 32 |
st.sidebar.image("https://raw.githubusercontent.com/manassharma07/PyFock/main/logo_crysx_pyfock.png", use_container_width=True)
|
|
|
|
| 17 |
from ase.io import read as ase_read
|
| 18 |
import pandas as pd
|
| 19 |
|
|
|
|
| 20 |
# Set page configuration
|
| 21 |
st.set_page_config(
|
| 22 |
page_title='PyFock GUI - Interactive DFT Calculations',
|
|
|
|
| 26 |
'About': "PyFock GUI - A web interface for PyFock, a pure Python DFT code with Numba JIT acceleration"
|
| 27 |
}
|
| 28 |
)
|
| 29 |
+
# === Background video styling ===
|
| 30 |
+
# CSS for Background Video and Content Styling
|
| 31 |
+
def set_css():
|
| 32 |
+
st.markdown("""
|
| 33 |
+
<style>
|
| 34 |
+
#myVideo {
|
| 35 |
+
position: fixed;
|
| 36 |
+
right: 0;
|
| 37 |
+
bottom: 0;
|
| 38 |
+
min-width: 100%;
|
| 39 |
+
min-height: 100%;
|
| 40 |
+
opacity: 0.12; /* <--- adjust video opacity here (0 to 1) */
|
| 41 |
+
pointer-events: none; /* FIX: allow scrolling */
|
| 42 |
+
}
|
| 43 |
+
.content {
|
| 44 |
+
position: fixed;
|
| 45 |
+
bottom: 0;
|
| 46 |
+
background: rgba(0, 0, 0, 0.5);
|
| 47 |
+
color: #f1f1f1;
|
| 48 |
+
width: 100%;
|
| 49 |
+
padding: 20px;
|
| 50 |
+
}
|
| 51 |
+
</style>
|
| 52 |
+
""", unsafe_allow_html=True)
|
| 53 |
+
|
| 54 |
+
# Embed Background Video
|
| 55 |
+
def embed_video():
|
| 56 |
+
video_link = "https://pyfock.bragitoff.com/background_video_pyfock.mp4"
|
| 57 |
+
st.sidebar.markdown(f"""
|
| 58 |
+
<video autoplay muted loop id="myVideo">
|
| 59 |
+
<source src="{video_link}">
|
| 60 |
+
Your browser does not support HTML5 video.
|
| 61 |
+
</video>
|
| 62 |
+
""", unsafe_allow_html=True)
|
| 63 |
+
|
| 64 |
+
set_css()
|
| 65 |
+
embed_video()
|
| 66 |
+
|
| 67 |
+
# Set page configuration
|
| 68 |
+
# st.set_page_config(
|
| 69 |
+
# page_title='PyFock GUI - Interactive DFT Calculations',
|
| 70 |
+
# layout='wide',
|
| 71 |
+
# page_icon="⚛️",
|
| 72 |
+
# menu_items={
|
| 73 |
+
# 'About': "PyFock GUI - A web interface for PyFock, a pure Python DFT code with Numba JIT acceleration"
|
| 74 |
+
# }
|
| 75 |
+
# )
|
| 76 |
|
| 77 |
# Sidebar with enhanced styling
|
| 78 |
st.sidebar.image("https://raw.githubusercontent.com/manassharma07/PyFock/main/logo_crysx_pyfock.png", use_container_width=True)
|