Braincast / static /style.css
syurein
first
67041f9
raw
history blame
12 kB
/* 基本スタイル */
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
margin: 0;
background-color: #f0f0f0;
display: flex; /* 中央揃えのため */
justify-content: center; /* 中央揃えのため */
align-items: flex-start; /* 上端揃え */
min-height: 100vh;
padding: 20px 0; /* 上下に余白 */
box-sizing: border-box;
}
.screen {
width: 100%; /* 横幅いっぱい */
max-width: 400px; /* スマホ画面幅を想定 */
background-color: #fff;
border: 1px solid #ccc;
min-height: 700px; /* 高さを確保 */
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
display: flex;
flex-direction: column; /* 子要素を縦に並べる */
overflow: hidden; /* はみ出しを隠す */
}
.header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 15px;
background-color: #f8f8f8;
border-bottom: 1px solid #eee;
flex-shrink: 0; /* ヘッダーが縮まないように */
}
.header .menu-btn, .header .action-btn {
background: none;
border: none;
font-size: 24px;
cursor: pointer;
padding: 5px;
}
.header .action-btn {
width: 30px;
height: 30px;
background-color: #007bff; /* 青い丸 */
border-radius: 50%;
padding: 0; /* 内側の余白を削除 */
/* 必要ならアイコンや文字を配置 */
}
.header .title {
font-size: 18px;
font-weight: bold;
margin: 0;
text-align: center;
flex-grow: 1; /* 中央に配置するために */
}
main {
padding: 15px;
flex-grow: 1; /* 残りの高さを埋める */
overflow-y: auto; /* 内容が多い場合にスクロール */
}
/* List Styles */
ul.list {
list-style: none;
padding: 0;
margin: 0;
}
li.list-item {
border-bottom: 1px solid #eee;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0; /* paddingはボタン側で調整 */
}
li.list-item:last-child {
border-bottom: none;
}
/* ListItemをボタンとして使えるように */
.list-item-button {
display: flex;
align-items: center;
width: 100%;
padding: 12px 15px;
text-decoration: none;
color: inherit;
background-color: transparent;
border: none;
cursor: pointer;
text-align: left;
}
.list-item-button:hover {
background-color: #f9f9f9;
}
.list-item-content {
display: flex;
align-items: center;
flex-grow: 1; /* テキスト部分が幅を取るように */
margin-right: 10px; /* 矢印とのスペース */
}
.list-item-icon {
margin-right: 12px;
font-size: 22px;
color: #007bff; /* アイコンの色 */
width: 24px; /* 幅を固定して揃える */
text-align: center;
}
.list-item-text h3 {
font-size: 16px;
margin: 0 0 4px 0;
font-weight: 500;
white-space: nowrap; /* 長いタイトルを省略 */
overflow: hidden;
text-overflow: ellipsis;
}
.list-item-text p {
font-size: 13px;
color: #777;
margin: 0;
}
.list-arrow {
color: #ccc;
font-size: 20px;
flex-shrink: 0; /* 矢印が縮まないように */
}
/* Learning Screen Card */
.card {
background-color: #fff;
padding: 30px 20px; /* 少し調整 */
border-radius: 12px; /* 少し調整 */
border: 1px solid #eee; /* 境界線を追加 */
box-shadow: 0 2px 5px rgba(0,0,0,0.05);
text-align: center;
margin: 15px 0; /* 少し調整 */
min-height: 180px; /* 少し調整 */
display: flex;
flex-direction: column;
justify-content: center;
cursor: pointer; /* タップ可能を示す */
}
.card p.main-text {
margin: 0;
line-height: 1.7; /* 行間調整 */
font-size: 16px;
}
.card p.answer-text {
margin-top: 15px;
font-size: 18px;
font-weight: bold;
color: #007bff;
}
.tap-to-show {
text-align: center;
color: #888;
font-size: 14px;
margin-top: 10px;
cursor: pointer; /* タップ可能を示す */
}
/* Pagination */
.pagination {
display: flex;
justify-content: space-between;
align-items: center;
padding: 15px 0 5px 0; /* 下の余白を少し減らす */
flex-shrink: 0; /* 縮まないように */
}
.pagination button {
background: none;
border: none;
font-size: 30px;
color: #007bff;
cursor: pointer;
padding: 5px 15px; /* タップしやすく */
}
.pagination button:disabled {
color: #ccc;
cursor: default;
}
.pagination span {
font-size: 16px;
font-weight: 500;
}
/* Settings Screen */
.settings-item {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
}
.settings-item span {
flex-grow: 1;
padding-left: 12px; /* アイコンとのスペース */
}
/* Toggle Switch (簡易版) */
.toggle-switch {
position: relative;
display: inline-block;
width: 50px;
height: 24px;
cursor: pointer;
}
.toggle-switch input {
opacity: 0;
width: 0;
height: 0;
}
.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ccc;
transition: .3s;
border-radius: 24px;
}
.slider:before {
position: absolute;
content: "";
height: 18px;
width: 18px;
left: 3px;
bottom: 3px;
background-color: white;
transition: .3s;
border-radius: 50%;
}
input:checked + .slider {
background-color: #007bff;
}
input:checked + .slider:before {
transform: translateX(26px);
}
.section-title {
color: #666; /* 少し濃く */
font-size: 14px;
font-weight: 500;
margin: 20px 0 8px 0;
padding-left: 15px;
}
.logout {
color: red;
font-weight: bold;
}
/* Input Screen */
.input-area {
text-align: center;
padding-top: 40px; /* ヘッダーがない場合の余白 */
}
.input-area h2 {
font-size: 20px; /* 少し大きく */
font-weight: bold;
margin-bottom: 25px;
line-height: 1.4;
}
.input-area input[type="text"] {
width: calc(100% - 44px); /* 左右padding分引く */
padding: 12px 15px;
border: 1px solid #ccc;
border-radius: 8px;
font-size: 16px;
margin-bottom: 20px;
box-sizing: border-box;
}
.input-area .generate-button {
background-color: #ff3b30; /* iOS風の赤 */
color: white;
border: none;
padding: 12px 25px;
font-size: 16px;
font-weight: bold;
border-radius: 25px;
cursor: pointer;
display: inline-flex; /* アイコンとテキストを横並び */
align-items: center;
justify-content: center;
margin: 0 auto 25px auto;
transition: background-color 0.2s;
}
.input-area .generate-button:hover {
background-color: #e03024;
}
.input-area .generate-button:disabled {
background-color: #fca9a4;
cursor: not-allowed;
}
.input-area .generate-button .icon { /* 再生ボタン風アイコン */
margin-left: 8px;
font-size: 14px;
}
.input-area .loading-spinner {
border: 3px solid rgba(255, 255, 255, 0.3);
border-radius: 50%;
border-top-color: #fff;
width: 16px;
height: 16px;
animation: spin 1s linear infinite;
margin-right: 8px; /* テキストとのスペース */
}
@keyframes spin {
to { transform: rotate(360deg); }
}
.image-placeholder {
width: 85%; /* 画面幅に対する割合 */
max-width: 300px; /* 最大幅 */
aspect-ratio: 16 / 9; /* 縦横比 */
background-color: #e9e9e9;
border: 1px dashed #ccc;
display: flex;
align-items: center;
justify-content: center;
color: #aaa;
margin: 0 auto;
border-radius: 10px;
overflow: hidden; /* 画像表示用 */
}
.image-placeholder img {
display: block;
width: 100%;
height: 100%;
object-fit: cover;
}
.error-message {
color: red;
font-size: 13px;
margin-top: -15px; /* ボタンとの間を詰める */
margin-bottom: 15px;
min-height: 1em; /* エラーなくても高さを確保 */
}
/* static/style.css に追加 */
/* --- フッターナビゲーション --- */
.footer-nav {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
background-color: #f8f8f8;
border-top: 1px solid #e0e0e0;
display: flex;
justify-content: space-around;
padding: 4px 0 8px 0; /* 上下少し調整 */
box-shadow: 0 -1px 4px rgba(0,0,0,0.08);
z-index: 1000;
}
.footer-nav button {
background: none;
border: none;
cursor: pointer;
padding: 5px;
display: flex;
flex-direction: column;
align-items: center;
font-size: 10px;
color: #888; /* 非アクティブ時の色 */
flex-grow: 1; /* ボタンが均等に幅を取るように */
transition: color 0.2s ease;
}
.footer-nav .nav-icon {
font-size: 22px;
margin-bottom: 2px;
}
.footer-nav button.active {
color: #007bff; /* アクティブ時の色 (例: 青) */
}
/* --- main要素の底上げ --- */
/* フッターにコンテンツが隠れないように */
main {
padding-bottom: 70px; /* フッターの高さに応じて調整 */
}
/* --- ローディングスピナー (input.html用) --- */
.loading-spinner {
border: 3px solid rgba(0, 0, 0, 0.1);
border-left-color: #fff; /* スピナーの色 */
border-radius: 50%;
width: 16px;
height: 16px;
animation: spin 1s linear infinite;
display: inline-block; /* ボタン内で表示 */
margin-left: 8px; /* ボタンテキストとの間隔 */
vertical-align: middle;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
/* --- learning.html のローディング(簡易版)--- */
/* 必要であれば .loading-spinner-large などを定義 */
/* --- learning.html の解答ボタン スタイル --- */
.option-button.correct {
background-color: #d4edda; /* 緑系 */
color: #155724;
border-color: #c3e6cb;
}
.option-button.incorrect { /* これは revealAnswer では使わないかも */
background-color: #f8d7da; /* 赤系 */
color: #721c24;
border-color: #f5c6cb;
}
.option-button.disabled {
background-color: #e9ecef;
color: #6c757d;
border-color: #ced4da;
opacity: 0.7;
}
/* --- ダークモード用スタイル (一部) --- */
body.dark-mode {
background-color: #121212;
color: #e0e0e0;
}
body.dark-mode .screen { background-color: #1e1e1e; }
body.dark-mode .header { background-color: #1f1f1f; border-bottom-color: #333; }
body.dark-mode .header .title, body.dark-mode .header .menu-btn { color: #e0e0e0; }
body.dark-mode .footer-nav { background-color: #1f1f1f; border-top-color: #333; }
body.dark-mode .footer-nav button { color: #888; }
body.dark-mode .footer-nav button.active { color: #58a6ff; } /* ダークモードでのアクティブ色 */
body.dark-mode .card { background-color: #2c2c2c; border-color: #444; color: #e0e0e0; }
body.dark-mode .list-item-button { background-color: #2c2c2c; border-bottom-color: #444; }
body.dark-mode .list-item-text h3, body.dark-mode .list-item-text p { color: #e0e0e0; }
body.dark-mode .list-arrow { color: #aaa; }
body.dark-mode .settings-item span { color: #e0e0e0; }
body.dark-mode .section-title { color: #aaa; }
body.dark-mode input[type="text"] { background-color: #333; border-color: #555; color: #e0e0e0; }
body.dark-mode .generate-button { background-color: #3081d8; color: white; }
body.dark-mode .option-button { background-color: #444; color: #e0e0e0; border-color: #666; }
body.dark-mode .option-button.correct { background-color: #2a6831; color: #e0e0e0; border-color: #41984b; }
body.dark-mode .option-button.disabled { background-color: #333; color: #888; border-color: #555; opacity: 0.7; }
body.dark-mode .pagination button:disabled { color: #666; }
body.dark-mode .toggle-switch .slider { background-color: #555; }
body.dark-mode .toggle-switch input:checked + .slider { background-color: #58a6ff; }
/* 他の要素も必要に応じてダークモードスタイルを追加 */