Spaces:
Paused

2fdevvd / styles.py
bluskyyy's picture
Upload 17 files
065179a verified
Raw History Blame Contribute Delete
11.3 kB
# styles.py
# ํฐํŠธ์–ด์ธ ๋งํฌ
fontawesome_link = """
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" crossorigin="anonymous" referrerpolicy="no-referrer" />
"""
# CSS ์Šคํƒ€์ผ ์ •์˜
custom_css = """
:root {
--primary-color: #32CD32;
--secondary-color: #90EE90;
--accent-color: #228B22;
--background-color: #F0FFF0;
--card-bg: #ffffff;
--text-color: #2E4C2E;
--border-radius: 18px;
--shadow: 0 8px 30px rgba(50, 205, 50, 0.08);
}
body {
font-family: 'Pretendard', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
background-color: var(--background-color);
color: var(--text-color);
line-height: 1.6;
}
/* Gradio ์ปจํ…Œ์ด๋„ˆ ์˜ค๋ฒ„๋ผ์ด๋“œ */
.gradio-container {
max-width: 100% !important;
width: 100% !important;
margin: 0 auto !important;
padding: 0 !important;
background-color: var(--background-color) !important;
box-sizing: border-box !important;
}
/* ์ถ”๊ฐ€: ๋‚ด๋ถ€ ์ปจํ…Œ์ด๋„ˆ๋„ 100% ๋„ˆ๋น„๋กœ ์„ค์ • */
.contain {
max-width: 100% !important;
width: 100% !important;
}
/* ์ถ”๊ฐ€: ๊ฐ ํ–‰(Row)๋„ 100% ๋„ˆ๋น„๋กœ ์„ค์ • */
.gr-padded {
padding: 0 !important;
width: 100% !important;
max-width: 100% !important;
}
/* ํŒจ๋„ ์Šคํƒ€์ผ๋ง */
.gr-group {
background-color: var(--card-bg);
border-radius: var(--border-radius) !important;
box-shadow: var(--shadow) !important;
padding: 1.5rem !important;
margin-bottom: 1.5rem !important;
border: 1px solid rgba(0, 0, 0, 0.04) !important;
transition: transform 0.3s ease;
}
.gr-group:hover {
transform: translateY(-5px);
}
/* ์„น์…˜ ์ œ๋ชฉ */
.section-title {
font-size: 22px !important;
font-weight: 700 !important;
color: #333333 !important;
margin-bottom: 1rem !important;
padding-bottom: 0.5rem !important;
border-bottom: 2px solid var(--primary-color) !important;
display: flex;
align-items: center;
}
.section-title span {
color: var(--primary-color);
}
/* ๋ฒ„ํŠผ ์Šคํƒ€์ผ๋ง */
.custom-button {
background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) !important;
color: white !important;
font-weight: 600 !important;
border: none !important;
border-radius: 30px !important;
padding: 12px 24px !important;
box-shadow: 0 4px 8px rgba(50, 205, 50, 0.25) !important;
transition: all 0.3s ease !important;
text-transform: none !important;
display: flex !important;
align-items: center !important;
justify-content: center !important;
}
.custom-button:hover {
transform: translateY(-2px) !important;
box-shadow: 0 6px 12px rgba(50, 205, 50, 0.3) !important;
}
.custom-button.primary {
background: linear-gradient(135deg, var(--accent-color), var(--primary-color)) !important;
}
/* ์ด๋ฏธ์ง€ ์ปจํ…Œ์ด๋„ˆ */
.image-container {
border-radius: var(--border-radius);
overflow: hidden;
border: 1px solid rgba(0, 0, 0, 0.08);
transition: all 0.3s ease;
background-color: white;
}
.image-container:hover {
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}
/* ํƒญ ์Šคํƒ€์ผ ๊ฐœ์„  */
.tabs {
border-bottom: none !important;
}
.tab-nav {
background-color: transparent !important;
border-bottom: 1px solid #eeeeee !important;
padding: 0 !important;
}
.tab-nav button {
border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
margin-right: 5px !important;
padding: 12px 20px !important;
font-size: 18px !important;
font-weight: 600 !important;
border: 1px solid #eeeeee !important;
border-bottom: none !important;
background-color: rgba(255, 255, 255, 0.7) !important;
color: var(--text-color) !important;
transition: all 0.3s ease !important;
min-width: 150px !important;
text-align: center !important;
}
.tab-nav button.selected {
background-color: var(--primary-color) !important;
color: white !important;
border-color: var(--primary-color) !important;
box-shadow: 0 -2px 6px rgba(50, 205, 50, 0.2) !important;
}
.tab-nav button:hover:not(.selected) {
background-color: var(--background-color) !important;
border-bottom: none !important;
}
/* ์ž…๋ ฅ ํ•„๋“œ ์Šคํƒ€์ผ */
.gr-input, .gr-text-input, .gr-sample-inputs {
border-radius: var(--border-radius) !important;
border: 1px solid #dddddd !important;
padding: 12px !important;
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05) !important;
transition: all 0.3s ease !important;
}
.gr-input:focus, .gr-text-input:focus {
border-color: var(--primary-color) !important;
outline: none !important;
box-shadow: 0 0 0 2px rgba(50, 205, 50, 0.2) !important;
}
/* ๋ฒ„ํŠผ ๊ทธ๋ฃน */
.button-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
gap: 0.8rem;
margin-bottom: 1.2rem;
}
/* ๋ฉ”์ธ ์ปจํ…์ธ  ์Šคํฌ๋กค๋ฐ” */
::-webkit-scrollbar {
width: 8px;
height: 8px;
}
::-webkit-scrollbar-track {
background: rgba(0, 0, 0, 0.05);
border-radius: 10px;
}
::-webkit-scrollbar-thumb {
background: var(--primary-color);
border-radius: 10px;
}
/* ํŽธ์ง‘๊ธฐ ํŠน๋ณ„ ์Šคํƒ€์ผ */
.editor-section {
background-color: var(--card-bg);
border-radius: var(--border-radius);
box-shadow: var(--shadow);
padding: 1.5rem;
margin-bottom: 1.5rem;
}
.editor-title {
font-size: 1.5rem;
font-weight: 700;
color: var(--primary-color);
margin-bottom: 1rem;
display: flex;
align-items: center;
}
.editor-title i {
margin-right: 0.5rem;
}
.download-button {
background-color: var(--accent-color) !important;
color: white !important;
border: none !important;
padding: 10px !important;
font-size: 12px !important;
border-radius: var(--border-radius) !important;
font-weight: 600 !important;
transition: all 0.3s ease !important;
}
.download-button:hover {
transform: translateY(-2px) !important;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
}
.download-container {
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
}
.download-output {
width: 100%;
margin-top: 1rem;
}
/* ์• ๋‹ˆ๋ฉ”์ด์…˜ ์Šคํƒ€์ผ */
@keyframes fadeIn {
from { opacity: 0; transform: translateY(10px); }
to { opacity: 1; transform: translateY(0); }
}
.fade-in {
animation: fadeIn 0.5s ease-out;
}
/* Examples ์„น์…˜ ์Šคํƒ€์ผ */
.examples-section {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
gap: 1.5rem;
margin-top: 1rem;
}
.example-item {
background-color: white;
border-radius: var(--border-radius);
overflow: hidden;
box-shadow: var(--shadow);
transition: transform 0.3s ease;
}
.example-item:hover {
transform: translateY(-5px);
}
/* ๊ฐ€์ด๋“œ ์ปจํ…Œ์ด๋„ˆ ์Šคํƒ€์ผ ์ถ”๊ฐ€ */
.guide-container {
background-color: var(--card-bg);
border-radius: var(--border-radius);
box-shadow: var(--shadow);
padding: 1.5rem;
margin-bottom: 1.5rem;
border: 1px solid rgba(50, 205, 50, 0.1);
}
.guide-title {
font-size: 1.5rem;
font-weight: 700;
color: var(--primary-color);
margin-bottom: 1.5rem;
padding-bottom: 0.5rem;
border-bottom: 2px solid var(--primary-color);
display: flex;
align-items: center;
}
.guide-title i {
margin-right: 0.8rem;
font-size: 1.5rem;
}
.guide-item {
display: flex;
margin-bottom: 1rem;
align-items: flex-start;
}
.guide-number {
background-color: var(--primary-color);
color: white;
width: 25px;
height: 25px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-weight: bold;
margin-right: 10px;
flex-shrink: 0;
}
.guide-text {
flex: 1;
line-height: 1.6;
}
.guide-text a {
color: var(--primary-color);
text-decoration: underline;
font-weight: 600;
}
.guide-text a:hover {
color: var(--accent-color);
}
.guide-highlight {
background-color: rgba(50, 205, 50, 0.1);
padding: 2px 5px;
border-radius: 4px;
font-weight: 500;
}
/* ๋ฐ˜์‘ํ˜• */
@media (max-width: 768px) {
.button-grid {
grid-template-columns: repeat(2, 1fr);
}
.examples-section {
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}
}
"""
# ์‚ฌ์šฉ ๊ฐ€์ด๋“œ HTML
image_generator_guide_html = """
<div class="guide-container">
<div class="guide-title"><i class="fas fa-book"></i> ์ด๋ฏธ์ง€ ์ƒ์„ฑ๊ธฐ ์‚ฌ์šฉ ๊ฐ€์ด๋“œ</div>
<div class="guide-item">
<div class="guide-number">1</div>
<div class="guide-text">
<strong class="guide-highlight">Gemini API ํ‚ค๊ฐ€ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.</strong> ๋ฌด๋ฃŒ์ด๋‹ˆ <a href="https://aistudio.google.com/apikey" target="_blank">Google AI Studio</a>๋ฅผ ํ†ตํ•ด ๋ฐœ๊ธ‰๋ฐ›์•„ ์‚ฌ์šฉํ•ด์ฃผ์„ธ์š”.
</div>
</div>
<div class="guide-item">
<div class="guide-number">2</div>
<div class="guide-text">
์ตœ์†Œ ํ•˜๋‚˜์˜ ์ด๋ฏธ์ง€๋ฅผ ์—…๋กœ๋“œํ•˜์„ธ์š”. ์—ฌ๋Ÿฌ ์ด๋ฏธ์ง€๋ฅผ ์—…๋กœ๋“œํ•˜๋ฉด ์ž๋™์œผ๋กœ ํ•ฉ์„ฑ๋ฉ๋‹ˆ๋‹ค.
</div>
</div>
<div class="guide-item">
<div class="guide-number">3</div>
<div class="guide-text">
ํ”„๋กฌํ”„ํŠธ๋ฅผ ์ž…๋ ฅํ•˜๊ฑฐ๋‚˜ ๋น„์›Œ๋‘๋ฉด ์ž๋™์œผ๋กœ ํ•ฉ์„ฑ๋ฉ๋‹ˆ๋‹ค. '#1', '#2', '#3'์œผ๋กœ ๊ฐ ์ด๋ฏธ์ง€๋ฅผ ์ฐธ์กฐํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
</div>
</div>
<div class="guide-item">
<div class="guide-number">4</div>
<div class="guide-text">
๋น ๋ฅธ ํ”„๋กฌํ”„ํŠธ ํ…œํ”Œ๋ฆฟ์„ ์‚ฌ์šฉํ•˜์—ฌ ๊ธ€์ž ์ง€์šฐ๊ธฐ, ๋ฐฐ๊ฒฝ ๋ฐ”๊พธ๊ธฐ ๋“ฑ์˜ ํšจ๊ณผ๋ฅผ ์ ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
</div>
</div>
<div class="guide-item">
<div class="guide-number">5</div>
<div class="guide-text">
ํ•œ ๋ฒˆ์— ํ•œ ์žฅ ๋˜๋Š” ๋„ค ์žฅ์˜ ์ด๋ฏธ์ง€๋ฅผ ์ƒ์„ฑํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
</div>
</div>
</div>
"""
image_editor_guide_html = """
<div class="guide-container">
<div class="guide-title"><i class="fas fa-book"></i> ์ด๋ฏธ์ง€ ํŽธ์ง‘๊ธฐ ์‚ฌ์šฉ ๊ฐ€์ด๋“œ</div>
<div class="guide-item">
<div class="guide-number">1</div>
<div class="guide-text">ํŽธ์ง‘ํ•  ์ด๋ฏธ์ง€๋ฅผ ์—…๋กœ๋“œํ•˜์„ธ์š”.</div>
</div>
<div class="guide-item">
<div class="guide-number">2</div>
<div class="guide-text">์Šฌ๋ผ์ด๋”๋ฅผ ์กฐ์ •ํ•˜์—ฌ ๋ฐ๊ธฐ, ๋Œ€๋น„, ์ฑ„๋„ ๋“ฑ์˜ ๊ฐ’์„ ๋ณ€๊ฒฝํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.</div>
</div>
<div class="guide-item">
<div class="guide-number">3</div>
<div class="guide-text">ํŽธ์ง‘์ด ์™„๋ฃŒ๋˜๋ฉด 'JPG๋กœ ๋ณ€ํ™˜ํ•˜๊ธฐ' ๋ฒ„ํŠผ์„ ํด๋ฆญํ•˜์—ฌ ๊ฒฐ๊ณผ๋ฌผ์„ ๋‹ค์šด๋กœ๋“œํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.</div>
</div>
</div>
"""
# ์ œ๋ชฉ๊ณผ ์‚ฌ์šฉ ๊ฐ€์ด๋“œ
header_html = """
<div style="text-align: center; padding: 2rem; background: linear-gradient(135deg, #32CD32, #90EE90); color: white; border-radius: 18px; margin-bottom: 1.5rem; box-shadow: 0 8px 30px rgba(50, 205, 50, 0.08);">
<h1 style="margin: 0; font-size: 2.5rem; font-weight: 700; letter-spacing: -0.5px;">โœจ AI ์ด๋ฏธ์ง€ ์ƒ์„ฑ & ํŽธ์ง‘ ๋„๊ตฌ โœจ</h1>
<p style="margin: 0.75rem 0 0; font-size: 1.1rem; opacity: 0.9;">Gemini API๋ฅผ ํ™œ์šฉํ•œ ๊ณ ์„ฑ๋Šฅ ์ด๋ฏธ์ง€ ์ƒ์„ฑ ๋ฐ ํŽธ์ง‘ ์„œ๋น„์Šค</p>
</div>
"""