magical-tales / ui /styles.py
agharsallah
adding readme
208a2f2
"""
CSS styles for the Magic Story Creator application
"""
# The main CSS for the application
main_css = """
:root {
--border-radius: 15px;
--shadow: 0 4px 8px rgba(0,0,0,0.1);
--bg-surface: #ffffff;
--bg-accent-yellow: #FFF8E1;
--bg-accent-blue: #E3F2FD;
--bg-accent-pink: #FCE4EC;
--text-main: #212121;
--text-heading: #C62828;
--text-subheading: #1565C0;
--text-accent: #00897B;
--text-warning: #FF8F00;
--text-on-accent: #ffffff;
--accent-green: #43A047;
--accent-yellow: #FFD600;
--accent-blue: #1976D2;
--accent-pink-dark: #ff96b9;
--accent-pink-light: #ab1447;
--accent-purple: #8E24AA;
--interactive-hover: #1565C0;
--shadow-color: #B0BEC5;
--hover-color: #F06292;
}
.gradio-container {
margin: 10 auto;
font-family: 'Comic Sans MS', cursive, sans-serif;
background-image: url("/gradio_api/file=assets/images/bg.jpg");
background-repeat: no-repeat;
background-size: cover;
background-attachment: fixed;
}
.main-header {
color: var(--text-heading);
text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
font-size: 2.8em;
margin-bottom: 20px;
text-align: center;
}
.sub-title {
color: var(--accent-purple);
text-align: center;
font-size: 1.5em;
}
.sub-header {
color: var(--text-subheading);
}
.step-header {
font-size: 1.5em;
font-weight: bold;
text-align: center;
color: var(--text-subheading);
}
.image-next-header {
width: 80px;
height: 80px;
display: block;
}
.image-header-wrapper {
display: flex;
align-items: center;
justify-content: center;
text-align: center;
width: 100%;
}
.text {
color: var(--text-main);
}
.box {
background-color: var(--bg-surface);
border: 2px solid var(--text-main);
border-radius: var(--border-radius);
padding: 15px;
box-shadow: var(--shadow);
margin-bottom: 20px;
flex: 1;
min-width: 200px;
p, strong {
color: var(--text-main);
}
}
.box-header{
color: var(--accent-blue);
}
.gr-accordion {
border-radius: var(--border-radius);
overflow: hidden;
box-shadow: var(--shadow);
margin-bottom: 15px;
background-color: var(--bg-accent-yellow);
button {
font-weight: bold;
color: var(--text-main) ;
}
}
.audio-button {
color: var(--bg-surface)!important;
}
.audio-output .controls span, .audio-output .controls svg{
color: var(--bg-surface)!important;
}
.tab-container {
button:not([aria-selected="true"]) {
background-color: transparent;
color: var(--text-main);
}
button:hover {
background-color: var(--bg-accent-blue);
}
}
#language-input, #age-slider, #subject-input, #reading-time-slider {
min-height: 100px;
}
#story-tone-buttons > span, #story-type-buttons > span,
#age-slider label span, #language-input label span,
#interests-input label span,
#subject-input label span, #reading-time-slider label span,
#model-selector div span {
display: block;
font-weight: bold;
font-size: 1.1em;
margin-bottom: 16px;
@media (prefers-color-scheme: dark) {
color: var(--accent-pink-dark)!important;
};
@media (prefers-color-scheme: light) {
color: var(--accent-pink-light)!important;
};
}
.radio-label {
display: block;
font-weight: bold;
color: var(--accent-pink);
font-size: 1.1em;
}
.radio-options {
display: flex;
flex-wrap: wrap;
gap: 10px;
justify-content: center;
}
.radio-option {
width: 100px;
height: 120px;
border: 3px solid #d4e6ff;
border-radius: 15px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
cursor: pointer;
padding: 10px;
background-color: white;
transition: all 0.3s ease;
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.radio-option:hover {
transform: translateY(-5px);
box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}
.radio-option.selected {
border-color: #5d9df5;
background-color: #f0f7ff;
box-shadow: 0 0 0 3px rgba(93, 157, 245, 0.3);
}
.radio-option img {
width: 50px;
height: 50px;
margin-bottom: 10px;
transition: all 0.3s ease;
}
.radio-option.selected img {
transform: scale(1.1);
}
.radio-option span {
font-weight: bold;
color: #4a6baf;
text-align: center;
}
.hidden-radio {
display: none !important;
}
/* Animations for page transitions */
@keyframes fadeIn {
from { opacity: 0; transform: translateY(20px); }
to { opacity: 1; transform: translateY(0); }
}
.story-container {
animation: fadeIn 0.7s ease-out;
}
.chapter-accordion {
animation: fadeIn 0.5s ease-out;
animation-fill-mode: both;
}
.chapter-accordion:nth-child(1) { animation-delay: 0.1s; }
.chapter-accordion:nth-child(2) { animation-delay: 0.2s; }
.chapter-accordion:nth-child(3) { animation-delay: 0.3s; }
.chapter-accordion:nth-child(4) { animation-delay: 0.4s; }
.chapter-accordion:nth-child(5) { animation-delay: 0.5s; }
.readme-content{
background-color: var(--bg-surface);
border: 2px solid var(--text-main);
border-radius: var(--border-radius);
padding: 15px;
box-shadow: var(--shadow);
margin-bottom: 20px;
p,li, strong,b {
color: #000000!important;
}
h1, h2, h3 {
color: var(--text-heading);
}
}
"""