syncmaster5 / fast_loading.py
aseelflihan's picture
Initial commit without node_modules
88fbdc0
"""
Fast Loading Configuration for Streamlit
تحسين سرعة تحميل Streamlit
"""
import streamlit as st
def apply_fast_loading_config():
"""Apply configurations for faster loading"""
# Custom CSS to prevent flash of unstyled content
st.markdown("""
<style>
/* Hide loading spinner faster */
.stSpinner {
display: none !important;
}
/* Faster fade-in */
.main .block-container {
animation: fadeIn 0.1s ease-in-out;
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
/* Optimize fonts loading */
body {
font-display: swap;
}
/* Remove unnecessary margins */
.block-container {
padding-top: 1rem;
}
</style>
""", unsafe_allow_html=True)
def show_instant_content():
"""Show content immediately without waiting"""
st.markdown("""
<div style="text-align: center; padding: 20px;">
<h1>🎵 SyncMaster</h1>
<p>منصة المزامنة الذكية بين الصوت والنص</p>
<div style="background: linear-gradient(45deg, #1f77b4, #17becf);
color: white; padding: 10px; border-radius: 5px; margin: 10px;">
✅ التطبيق جاهز للاستخدام
</div>
</div>
""", unsafe_allow_html=True)