Download styles.py from bluskyyy/2fdevvd: direct link, hf CLI and curl.
- Browser
- Download file 11.3 kB
-
https://huggingface.co/spaces/bluskyyy/2fdevvd/resolve/main/styles.py
- Command line
-
hf download hf://spaces/bluskyyy/2fdevvd/styles.py
-
curl -L -o styles.py https://huggingface.co/spaces/bluskyyy/2fdevvd/resolve/main/styles.py
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> | |
| """ |