File size: 6,196 Bytes
72a5beb |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 |
"""
UI関連のスタイルを定義するモジュール
"""
from diffusers_helper.gradio.progress_bar import make_progress_bar_css
from locales.i18n import translate
def get_app_css():
"""
アプリケーションのCSSスタイルを返す
Returns:
str: CSSスタイル定義
"""
return make_progress_bar_css() + """
.title-suffix {
color: currentColor;
opacity: 0.05;
}
/* 赤枠のキーフレーム - 偶数パターン用 */
.highlighted-keyframe-red {
border: 4px solid #ff3860 !important;
box-shadow: 0 0 10px rgba(255, 56, 96, 0.5) !important;
background-color: rgba(255, 56, 96, 0.05) !important;
position: relative;
}
/* 赤枠キーフレームに「偶数番号」のラベルを追加 */
.highlighted-keyframe-red::after {
""" + 'content: "' + translate("偶数セクションのコピー元") + '"' + """;
position: absolute;
top: 5px;
right: 5px;
background: rgba(255, 56, 96, 0.8);
color: white;
padding: 2px 6px;
font-size: 10px;
border-radius: 4px;
pointer-events: none;
}
/* 青枠のキーフレーム - 奇数パターン用 */
.highlighted-keyframe-blue {
border: 4px solid #3273dc !important;
box-shadow: 0 0 10px rgba(50, 115, 220, 0.5) !important;
background-color: rgba(50, 115, 220, 0.05) !important;
position: relative;
}
/* 青枠キーフレームに「奇数番号」のラベルを追加 */
.highlighted-keyframe-blue::after {
""" + 'content: "' + translate("奇数セクションのコピー元") + '"' + """;
position: absolute;
top: 5px;
right: 5px;
background: rgba(50, 115, 220, 0.8);
color: white;
padding: 2px 6px;
font-size: 10px;
border-radius: 4px;
pointer-events: none;
}
/* 引き続きサポート(古いクラス名)- 前方互換性用 */
.highlighted-keyframe {
border: 4px solid #ff3860 !important;
box-shadow: 0 0 10px rgba(255, 56, 96, 0.5) !important;
background-color: rgba(255, 56, 96, 0.05) !important;
}
/* 赤枠用セクション番号ラベル */
.highlighted-label-red label {
color: #ff3860 !important;
font-weight: bold !important;
}
/* 青枠用セクション番号ラベル */
.highlighted-label-blue label {
color: #3273dc !important;
font-weight: bold !important;
}
/* 引き続きサポート(古いクラス名)- 前方互換性用 */
.highlighted-label label {
color: #ff3860 !important;
font-weight: bold !important;
}
/* オールパディングの高さ調整 */
#all_padding_checkbox {
padding-top: 1.5rem;
min-height: 5.8rem;
}
#all_padding_checkbox .wrap {
align-items: flex-start;
}
#all_padding_checkbox .label-wrap {
margin-bottom: 0.8rem;
font-weight: 500;
font-size: 14px;
}
#all_padding_checkbox .info {
margin-top: 0.2rem;
}
/* セクション間の区切り線を太くする */
.section-row {
border-bottom: 4px solid #3273dc;
margin-bottom: 20px;
padding-bottom: 15px;
margin-top: 10px;
position: relative;
}
/* セクション番号を目立たせる */
.section-row .gr-form:first-child label {
font-weight: bold;
font-size: 1.1em;
color: #3273dc;
background-color: rgba(50, 115, 220, 0.1);
padding: 5px 10px;
border-radius: 4px;
margin-bottom: 10px;
display: inline-block;
}
/* セクションの背景を少し強調 */
.section-row {
background-color: rgba(50, 115, 220, 0.03);
border-radius: 8px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
/* セクション間の余白を増やす */
.section-container > .gr-block:not(:first-child) {
margin-top: 10px;
}
/* アコーディオンセクションのスタイル */
.section-accordion {
margin-top: 15px;
margin-bottom: 15px;
border-left: 4px solid #3273dc;
padding-left: 10px;
}
.section-accordion h3 button {
font-weight: bold;
color: #3273dc;
}
.section-accordion .gr-block {
border-radius: 8px;
}
/* 保存対象の設定項目を薄い青色でハイライト(ライト/ダークモード対応) */
.saveable-setting {
background-color: rgba(240, 248, 255, 0.5) !important; /* 薄い青色を透過指定(ライトモード) */
border-left: 3px solid #90caf9 !important; /* 薄いボーダー色 */
}
/* システムのダークモード対応 */
@media (prefers-color-scheme: dark) {
.saveable-setting {
background-color: rgba(25, 35, 60, 0.4) !important; /* ダークモードでの背景色 */
border-left: 3px solid #64b5f6 !important; /* ダークモードでのボーダー色(少し明るめ) */
}
}
/* Gradioのダークテーマ対応 */
.dark .saveable-setting {
background-color: rgba(25, 35, 60, 0.4) !important; /* ダークモードでの背景色 */
border-left: 3px solid #64b5f6 !important; /* ダークモードでのボーダー色(少し明るめ) */
}
/* 保存対象項目のラベルにアイコンを追加 */
.saveable-setting label::before {
content: "💾 ";
margin-right: 5px;
}
/* ダークモードでのラベル色調整 */
.dark .saveable-setting label {
color: #90caf9 !important; /* ダークモードで少し明るい青に */
}
/* markdownタイトル用 */
.markdown-title {
padding: 3px;
}
/* markdownサブタイトル用 */
.markdown-subtitle {
padding: 2px;
}
/* markdown領域用 */
.markdown-desc {
padding: 2px;
}
/* グルーピング用ボーダー */
.group-border {
border: solid 1px;
}
""" |