Upload 1581 files
Browse files- .gitattributes +9 -0
- assets/building_b1.png +3 -0
- assets/building_b2.png +3 -0
- assets/building_b3.png +3 -0
- assets/building_b4.png +3 -0
- assets/building_b5.png +3 -0
- assets/building_b6.png +3 -0
- assets/building_b7.png +3 -0
- assets/building_b8.png +3 -0
- assets/map_chibi.jpg +2 -2
- assets/map_chibi_old.jpg +3 -0
- css/base.css +50 -48
- css/game.css +60 -58
- js/db.js +2 -1
- js/game.js +12 -12
- tools/make_transparent.py +66 -0
.gitattributes
CHANGED
|
@@ -52,3 +52,12 @@ assets/building_b5.jpg filter=lfs diff=lfs merge=lfs -text
|
|
| 52 |
assets/building_b6.jpg filter=lfs diff=lfs merge=lfs -text
|
| 53 |
assets/building_b7.jpg filter=lfs diff=lfs merge=lfs -text
|
| 54 |
assets/building_b8.jpg filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
assets/building_b6.jpg filter=lfs diff=lfs merge=lfs -text
|
| 53 |
assets/building_b7.jpg filter=lfs diff=lfs merge=lfs -text
|
| 54 |
assets/building_b8.jpg filter=lfs diff=lfs merge=lfs -text
|
| 55 |
+
assets/building_b1.png filter=lfs diff=lfs merge=lfs -text
|
| 56 |
+
assets/building_b2.png filter=lfs diff=lfs merge=lfs -text
|
| 57 |
+
assets/building_b3.png filter=lfs diff=lfs merge=lfs -text
|
| 58 |
+
assets/building_b4.png filter=lfs diff=lfs merge=lfs -text
|
| 59 |
+
assets/building_b5.png filter=lfs diff=lfs merge=lfs -text
|
| 60 |
+
assets/building_b6.png filter=lfs diff=lfs merge=lfs -text
|
| 61 |
+
assets/building_b7.png filter=lfs diff=lfs merge=lfs -text
|
| 62 |
+
assets/building_b8.png filter=lfs diff=lfs merge=lfs -text
|
| 63 |
+
assets/map_chibi_old.jpg filter=lfs diff=lfs merge=lfs -text
|
assets/building_b1.png
ADDED
|
Git LFS Details
|
assets/building_b2.png
ADDED
|
Git LFS Details
|
assets/building_b3.png
ADDED
|
Git LFS Details
|
assets/building_b4.png
ADDED
|
Git LFS Details
|
assets/building_b5.png
ADDED
|
Git LFS Details
|
assets/building_b6.png
ADDED
|
Git LFS Details
|
assets/building_b7.png
ADDED
|
Git LFS Details
|
assets/building_b8.png
ADDED
|
Git LFS Details
|
assets/map_chibi.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
assets/map_chibi_old.jpg
ADDED
|
Git LFS Details
|
css/base.css
CHANGED
|
@@ -1,49 +1,51 @@
|
|
| 1 |
/* =============================================================
|
| 2 |
-
設計系統:
|
| 3 |
============================================================= */
|
| 4 |
:root {
|
| 5 |
-
--bg-0: #
|
| 6 |
-
--bg-1: #ffffff;
|
| 7 |
-
--bg-2: #
|
| 8 |
-
--bg-3: #
|
| 9 |
-
--line: rgba(
|
| 10 |
-
--text: #
|
| 11 |
-
--text-dim: #
|
| 12 |
-
--text-mute: #
|
| 13 |
-
--accent: #
|
| 14 |
-
--accent-2: #
|
| 15 |
-
--gold: #
|
| 16 |
-
--gold-2: #
|
| 17 |
-
--
|
| 18 |
-
--
|
| 19 |
-
--
|
| 20 |
-
--
|
| 21 |
-
--
|
|
|
|
| 22 |
--radius-sm: 10px;
|
| 23 |
-
--shadow: 0 8px 24px -4px rgba(
|
| 24 |
-
--shadow-glow: 0 0 0 1px rgba(
|
| 25 |
--font: 'Inter', 'Noto Sans TC', system-ui, -apple-system, 'Microsoft JhengHei', sans-serif;
|
| 26 |
}
|
| 27 |
|
| 28 |
html[data-theme="dark"] {
|
| 29 |
-
--bg-0: #
|
| 30 |
-
--bg-1: #
|
| 31 |
-
--bg-2: #
|
| 32 |
-
--bg-3: #
|
| 33 |
-
--line: rgba(
|
| 34 |
-
--text: #
|
| 35 |
-
--text-dim: #
|
| 36 |
-
--text-mute: #
|
| 37 |
-
--accent: #
|
| 38 |
-
--accent-2: #
|
| 39 |
-
--gold: #
|
| 40 |
-
--gold-2: #
|
|
|
|
| 41 |
--mint: #34d399;
|
| 42 |
-
--rose: #
|
| 43 |
-
--amber: #
|
| 44 |
--sky: #38bdf8;
|
| 45 |
--shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
|
| 46 |
-
--shadow-glow: 0 0 0 1px rgba(
|
| 47 |
}
|
| 48 |
|
| 49 |
* { box-sizing: border-box; }
|
|
@@ -52,8 +54,8 @@ body {
|
|
| 52 |
font-family: var(--font);
|
| 53 |
color: var(--text);
|
| 54 |
background:
|
| 55 |
-
radial-gradient(1200px 600px at 10% -10%, rgba(
|
| 56 |
-
radial-gradient(900px 500px at 110% 10%, rgba(
|
| 57 |
var(--bg-0);
|
| 58 |
min-height: 100vh;
|
| 59 |
font-size: 15px;
|
|
@@ -91,12 +93,12 @@ html[data-theme="dark"] .btn:hover:not(:disabled) { background: #26345a; }
|
|
| 91 |
.btn:active:not(:disabled) { transform: translateY(0) scale(.97); }
|
| 92 |
.btn:disabled { opacity: .45; cursor: not-allowed; }
|
| 93 |
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: #fff; }
|
| 94 |
-
.btn-primary:hover:not(:disabled) { background: linear-gradient(135deg, #
|
| 95 |
-
.btn-gold { background: linear-gradient(135deg, #
|
| 96 |
-
.btn-gold:hover:not(:disabled) { background: linear-gradient(135deg, #
|
| 97 |
.btn-ghost { background: transparent; border-color: transparent; }
|
| 98 |
.btn-ghost:hover:not(:disabled) { background: var(--bg-3); border-color: var(--line); }
|
| 99 |
-
.btn-danger { background: rgba(
|
| 100 |
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
|
| 101 |
.btn.is-loading { position: relative; color: transparent !important; }
|
| 102 |
.btn.is-loading::after {
|
|
@@ -113,7 +115,7 @@ html[data-theme="dark"] .btn:hover:not(:disabled) { background: #26345a; }
|
|
| 113 |
background: var(--bg-1); border: 1px solid var(--line); outline: none; color: var(--text);
|
| 114 |
transition: border-color .2s, box-shadow .2s;
|
| 115 |
}
|
| 116 |
-
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(
|
| 117 |
textarea.input { min-height: 120px; resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
|
| 118 |
|
| 119 |
/* ---------- 卡片 ---------- */
|
|
@@ -134,15 +136,15 @@ html[data-theme="dark"] .card {
|
|
| 134 |
padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700;
|
| 135 |
background: rgba(100, 116, 139, .12); color: var(--text-dim);
|
| 136 |
}
|
| 137 |
-
.badge-mint { background: rgba(
|
| 138 |
-
.badge-gold { background: rgba(
|
| 139 |
-
.badge-rose { background: rgba(
|
| 140 |
-
.badge-accent { background: rgba(
|
| 141 |
.badge-sky { background: rgba(2, 132, 199, .14); color: var(--sky); }
|
| 142 |
|
| 143 |
-
.progress { height: 8px; border-radius: 99px; background: rgba(
|
| 144 |
.progress > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .4s ease; }
|
| 145 |
-
.progress.gold > i { background: linear-gradient(90deg, #
|
| 146 |
.progress.mint > i { background: linear-gradient(90deg, #10b981, var(--mint)); }
|
| 147 |
|
| 148 |
/* ---------- Toast ---------- */
|
|
|
|
| 1 |
/* =============================================================
|
| 2 |
+
設計系統:治癒溫暖沙盤學院風格(以 #f9e9da, #ef5a56, #f4d474 為核心)
|
| 3 |
============================================================= */
|
| 4 |
:root {
|
| 5 |
+
--bg-0: #f9e9da; /* 柔和暖杏底色(用戶色票) */
|
| 6 |
+
--bg-1: #ffffff; /* 典雅純白卡片底 */
|
| 7 |
+
--bg-2: #fcf4eb; /* 暖杏淡米色(次級卡片/輸入框) */
|
| 8 |
+
--bg-3: #f3decb; /* 暖杏加深(按鈕/邊框底) */
|
| 9 |
+
--line: rgba(180, 130, 100, 0.20); /* 溫潤暖褐邊框線 */
|
| 10 |
+
--text: #2c201b; /* 深暖褐黑,高對比清晰耐看 */
|
| 11 |
+
--text-dim: #685247; /* 次級暖褐 */
|
| 12 |
+
--text-mute: #998074; /* 柔和灰褐 */
|
| 13 |
+
--accent: #ef5a56; /* 主行動活力珊瑚朱紅(用戶色票) */
|
| 14 |
+
--accent-2: #dc4844; /* 漸層深朱紅 */
|
| 15 |
+
--gold: #f4d474; /* 溫暖麥黃金(用戶色票) */
|
| 16 |
+
--gold-2: #dfbc55; /* 漸層小麥金 */
|
| 17 |
+
--gold-dark: #a87915; /* 高對比小麥金文字用 */
|
| 18 |
+
--mint: #10b981; /* 翡翠綠(成功/達標) */
|
| 19 |
+
--rose: #ef5a56; /* 警示朱紅 */
|
| 20 |
+
--amber: #f4d474; /* 暖黃 */
|
| 21 |
+
--sky: #0284c7; /* 霽藍 */
|
| 22 |
+
--radius: 16px;
|
| 23 |
--radius-sm: 10px;
|
| 24 |
+
--shadow: 0 8px 24px -4px rgba(120, 70, 50, 0.08), 0 2px 6px -1px rgba(120, 70, 50, 0.04);
|
| 25 |
+
--shadow-glow: 0 0 0 1px rgba(239, 90, 86, 0.25), 0 10px 25px -5px rgba(239, 90, 86, 0.35);
|
| 26 |
--font: 'Inter', 'Noto Sans TC', system-ui, -apple-system, 'Microsoft JhengHei', sans-serif;
|
| 27 |
}
|
| 28 |
|
| 29 |
html[data-theme="dark"] {
|
| 30 |
+
--bg-0: #0f1422;
|
| 31 |
+
--bg-1: #161e31;
|
| 32 |
+
--bg-2: #1e2842;
|
| 33 |
+
--bg-3: #283556;
|
| 34 |
+
--line: rgba(180, 195, 220, 0.16);
|
| 35 |
+
--text: #f5f0eb;
|
| 36 |
+
--text-dim: #abb8cf;
|
| 37 |
+
--text-mute: #7c8ba3;
|
| 38 |
+
--accent: #ff6b67;
|
| 39 |
+
--accent-2: #ef5a56;
|
| 40 |
+
--gold: #f5d880;
|
| 41 |
+
--gold-2: #f4d474;
|
| 42 |
+
--gold-dark: #f4d474;
|
| 43 |
--mint: #34d399;
|
| 44 |
+
--rose: #ff6b67;
|
| 45 |
+
--amber: #fcd34d;
|
| 46 |
--sky: #38bdf8;
|
| 47 |
--shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
|
| 48 |
+
--shadow-glow: 0 0 0 1px rgba(239, 90, 86, 0.35), 0 10px 30px -10px rgba(239, 90, 86, 0.45);
|
| 49 |
}
|
| 50 |
|
| 51 |
* { box-sizing: border-box; }
|
|
|
|
| 54 |
font-family: var(--font);
|
| 55 |
color: var(--text);
|
| 56 |
background:
|
| 57 |
+
radial-gradient(1200px 600px at 10% -10%, rgba(239, 90, 86, 0.08), transparent 60%),
|
| 58 |
+
radial-gradient(900px 500px at 110% 10%, rgba(244, 212, 116, 0.15), transparent 60%),
|
| 59 |
var(--bg-0);
|
| 60 |
min-height: 100vh;
|
| 61 |
font-size: 15px;
|
|
|
|
| 93 |
.btn:active:not(:disabled) { transform: translateY(0) scale(.97); }
|
| 94 |
.btn:disabled { opacity: .45; cursor: not-allowed; }
|
| 95 |
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: #fff; }
|
| 96 |
+
.btn-primary:hover:not(:disabled) { background: linear-gradient(135deg, #f86a66, #e04541); box-shadow: var(--shadow-glow); }
|
| 97 |
+
.btn-gold { background: linear-gradient(135deg, #f4d474, #dfbc55); color: #3d2600; border-color: transparent; font-weight: 800; }
|
| 98 |
+
.btn-gold:hover:not(:disabled) { background: linear-gradient(135deg, #fae08f, #cfab45); box-shadow: 0 8px 24px -4px rgba(244, 212, 116, 0.45); }
|
| 99 |
.btn-ghost { background: transparent; border-color: transparent; }
|
| 100 |
.btn-ghost:hover:not(:disabled) { background: var(--bg-3); border-color: var(--line); }
|
| 101 |
+
.btn-danger { background: rgba(239, 90, 86, .12); border-color: rgba(239, 90, 86, .35); color: var(--rose); }
|
| 102 |
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
|
| 103 |
.btn.is-loading { position: relative; color: transparent !important; }
|
| 104 |
.btn.is-loading::after {
|
|
|
|
| 115 |
background: var(--bg-1); border: 1px solid var(--line); outline: none; color: var(--text);
|
| 116 |
transition: border-color .2s, box-shadow .2s;
|
| 117 |
}
|
| 118 |
+
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(239, 90, 86, .2); }
|
| 119 |
textarea.input { min-height: 120px; resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
|
| 120 |
|
| 121 |
/* ---------- 卡片 ---------- */
|
|
|
|
| 136 |
padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700;
|
| 137 |
background: rgba(100, 116, 139, .12); color: var(--text-dim);
|
| 138 |
}
|
| 139 |
+
.badge-mint { background: rgba(16, 185, 129, .14); color: var(--mint); }
|
| 140 |
+
.badge-gold { background: rgba(244, 212, 116, .26); color: var(--gold-dark); }
|
| 141 |
+
.badge-rose { background: rgba(239, 90, 86, .14); color: var(--rose); }
|
| 142 |
+
.badge-accent { background: rgba(239, 90, 86, .15); color: var(--accent); }
|
| 143 |
.badge-sky { background: rgba(2, 132, 199, .14); color: var(--sky); }
|
| 144 |
|
| 145 |
+
.progress { height: 8px; border-radius: 99px; background: rgba(180, 130, 100, .15); overflow: hidden; }
|
| 146 |
.progress > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .4s ease; }
|
| 147 |
+
.progress.gold > i { background: linear-gradient(90deg, #f4d474, #dfbc55); }
|
| 148 |
.progress.mint > i { background: linear-gradient(90deg, #10b981, var(--mint)); }
|
| 149 |
|
| 150 |
/* ---------- Toast ---------- */
|
css/game.css
CHANGED
|
@@ -57,11 +57,11 @@ html[data-theme="dark"] .map-card { background: linear-gradient(180deg, rgba(23,
|
|
| 57 |
|
| 58 |
.territory-map-wrap {
|
| 59 |
position: relative; width: 100%; border-radius: 16px; overflow: hidden;
|
| 60 |
-
box-shadow: 0
|
| 61 |
-
aspect-ratio: 16 / 9; max-height:
|
| 62 |
}
|
| 63 |
.territory-map { position: relative; width: 100%; height: 100%; }
|
| 64 |
-
.map-bg { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(1.05) contrast(1.
|
| 65 |
|
| 66 |
.map-spots { position: absolute; inset: 0; pointer-events: none; }
|
| 67 |
.map-spot {
|
|
@@ -70,55 +70,57 @@ html[data-theme="dark"] .map-card { background: linear-gradient(180deg, rgba(23,
|
|
| 70 |
transition: all .2s cubic-bezier(.34,1.56,.64,1);
|
| 71 |
}
|
| 72 |
.map-spot:hover { transform: translate(-50%, -55%) scale(1.1); z-index: 20; }
|
| 73 |
-
.spot-
|
| 74 |
-
position: relative; width:
|
| 75 |
display: flex; align-items: center; justify-content: center;
|
| 76 |
-
|
| 77 |
-
border: 2px solid var(--line); box-shadow: 0 6px 16px rgba(0,0,0,.15);
|
| 78 |
-
transition: all .25s ease;
|
| 79 |
}
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
.spot-label {
|
| 84 |
-
padding:
|
| 85 |
-
background:
|
| 86 |
-
color: var(--text); white-space: nowrap; box-shadow: 0
|
|
|
|
| 87 |
}
|
| 88 |
-
html[data-theme="dark"] .spot-label { background: rgba(
|
| 89 |
|
| 90 |
/* 據點三種狀態 */
|
| 91 |
-
.map-spot.locked .spot-
|
| 92 |
-
.map-spot.locked .spot-
|
| 93 |
-
.map-spot.locked .spot-label { opacity: .6; }
|
| 94 |
|
| 95 |
-
.map-spot.ready .spot-
|
| 96 |
-
|
| 97 |
}
|
| 98 |
-
.map-spot.ready .spot-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
border: 2px solid var(--gold); pointer-events: none;
|
| 103 |
-
animation: spotPulse 1.6s infinite ease-out;
|
| 104 |
}
|
| 105 |
-
.map-spot.ready .spot-label { border-color: var(--
|
| 106 |
@keyframes spotPulse {
|
| 107 |
-
0% { transform: scale(
|
| 108 |
-
100% { transform: scale(1.
|
| 109 |
}
|
| 110 |
|
| 111 |
-
.map-spot.active .spot-
|
| 112 |
-
|
| 113 |
-
box-shadow: 0 0 16px rgba(16,185,129,.4), 0 6px 16px rgba(0,0,0,.15);
|
| 114 |
}
|
| 115 |
-
.map-spot.active.evolved .spot-
|
| 116 |
-
|
| 117 |
-
box-shadow: 0 0 20px rgba(124,58,237,.5);
|
| 118 |
}
|
| 119 |
.spot-flag {
|
| 120 |
-
position: absolute; top: -6px; right: -
|
| 121 |
-
filter: drop-shadow(0 2px 4px rgba(0,0,0,.
|
| 122 |
animation: flagWave 2s infinite ease-in-out alternate;
|
| 123 |
}
|
| 124 |
@keyframes flagWave { 0% { transform: rotate(-5deg); } 100% { transform: rotate(10deg); } }
|
|
@@ -145,27 +147,27 @@ html[data-theme="dark"] .spot-label { background: rgba(11,15,26,.88); border-col
|
|
| 145 |
.side { width: 300px; flex-shrink: 0; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 140px; }
|
| 146 |
.work-card { position: relative; overflow: hidden; display: flex; justify-content: center; padding: 22px; }
|
| 147 |
.work-btn {
|
| 148 |
-
width: 180px; height: 180px; border-radius: 50%; border: 0; cursor: pointer; color: #
|
| 149 |
-
background: radial-gradient(circle at 35% 30%, #
|
| 150 |
-
box-shadow: 0 0 0 6px rgba(
|
| 151 |
display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
|
| 152 |
transition: transform .08s ease, box-shadow .2s;
|
| 153 |
-webkit-tap-highlight-color: transparent;
|
| 154 |
}
|
| 155 |
-
.work-btn:hover { transform: scale(1.04); box-shadow: 0 0 0 10px rgba(
|
| 156 |
.work-btn:active { transform: scale(.94); }
|
| 157 |
.work-emoji { font-size: 44px; }
|
| 158 |
-
.work-label { font-weight: 900; font-size: 18px; }
|
| 159 |
-
.work-val { font-weight: 700; font-size: 13px; opacity: .
|
| 160 |
.float-layer { position: absolute; inset: 0; pointer-events: none; }
|
| 161 |
-
.float-num { position: absolute; font-weight: 900; color:
|
| 162 |
html[data-theme="dark"] .float-num { text-shadow: 0 2px 8px rgba(0,0,0,.6); }
|
| 163 |
@keyframes floatUp { from { opacity: 1; transform: translate(-50%, 0); } to { opacity: 0; transform: translate(-50%, -70px); } }
|
| 164 |
|
| 165 |
.kv { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
|
| 166 |
.kv li { display: flex; justify-content: space-between; gap: 8px; }
|
| 167 |
.kv li span:first-child { color: var(--text-dim); }
|
| 168 |
-
.hint-card { border-color: rgba(
|
| 169 |
.hint-card b { color: var(--accent); }
|
| 170 |
|
| 171 |
.build-head { justify-content: space-between; margin-bottom: 12px; }
|
|
@@ -176,25 +178,25 @@ html[data-theme="dark"] .float-num { text-shadow: 0 2px 8px rgba(0,0,0,.6); }
|
|
| 176 |
|
| 177 |
.b-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
|
| 178 |
.b-card {
|
| 179 |
-
position: relative; display: grid; grid-template-columns:
|
| 180 |
border-radius: var(--radius); border: 1px solid var(--line);
|
| 181 |
background: var(--bg-1);
|
| 182 |
transition: transform .15s ease, box-shadow .2s, border-color .2s;
|
| 183 |
}
|
| 184 |
html[data-theme="dark"] .b-card { background: linear-gradient(180deg, rgba(31,42,68,.8), rgba(23,32,54,.8)); }
|
| 185 |
-
.b-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: rgba(
|
| 186 |
.b-card.evolved { border-color: rgba(124,58,237,.5); box-shadow: 0 0 0 1px rgba(124,58,237,.25), 0 8px 24px -10px rgba(124,58,237,.4); }
|
| 187 |
-
.b-card.locked { opacity: .55;
|
| 188 |
.b-card.locked:hover { transform: none; }
|
| 189 |
.b-icon {
|
| 190 |
-
width: 62px; height: 62px; border-radius: 16px; overflow: hidden; padding:
|
| 191 |
display: flex; align-items: center; justify-content: center;
|
| 192 |
background: var(--bg-2); border: 2px solid var(--line);
|
| 193 |
-
box-shadow: 0 4px 10px rgba(
|
| 194 |
}
|
| 195 |
-
.b-thumb { width: 100%; height: 100%; object-fit:
|
| 196 |
-
.b-card:hover .b-thumb { transform: scale(1.
|
| 197 |
-
.b-card.locked .b-thumb { opacity: .
|
| 198 |
.b-card.evolved .b-icon { border-color: var(--accent-2); box-shadow: 0 0 12px rgba(124,58,237,.35); }
|
| 199 |
|
| 200 |
.work-thumb {
|
|
@@ -243,10 +245,10 @@ html[data-theme="dark"] .r-card { background: var(--bg-2); }
|
|
| 243 |
.r-sub { font-size: 12px; color: var(--text-dim); }
|
| 244 |
.r-reward { font-size: 12px; color: var(--sky); }
|
| 245 |
|
| 246 |
-
/* 排行榜專屬樣式 */
|
| 247 |
.row-me {
|
| 248 |
-
background: rgba(
|
| 249 |
font-weight: 700;
|
|
|
|
| 250 |
}
|
| 251 |
.rank-crown {
|
| 252 |
display: inline-flex;
|
|
@@ -257,9 +259,9 @@ html[data-theme="dark"] .r-card { background: var(--bg-2); }
|
|
| 257 |
padding: 3px 8px;
|
| 258 |
border-radius: 999px;
|
| 259 |
}
|
| 260 |
-
.crown-1 { background:
|
| 261 |
-
.crown-2 { background: #
|
| 262 |
-
.crown-3 { background: #
|
| 263 |
.rank-num { font-weight: 800; font-size: 13px; color: var(--text-dim); }
|
| 264 |
.r-reward { font-size: 12px; color: var(--sky); }
|
| 265 |
|
|
|
|
| 57 |
|
| 58 |
.territory-map-wrap {
|
| 59 |
position: relative; width: 100%; border-radius: 16px; overflow: hidden;
|
| 60 |
+
box-shadow: 0 12px 36px -10px rgba(120,70,50,.2), inset 0 0 0 1px rgba(180,130,100,.15);
|
| 61 |
+
aspect-ratio: 16 / 9; max-height: 480px; background: #faede1;
|
| 62 |
}
|
| 63 |
.territory-map { position: relative; width: 100%; height: 100%; }
|
| 64 |
+
.map-bg { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(1.05) contrast(1.02); }
|
| 65 |
|
| 66 |
.map-spots { position: absolute; inset: 0; pointer-events: none; }
|
| 67 |
.map-spot {
|
|
|
|
| 70 |
transition: all .2s cubic-bezier(.34,1.56,.64,1);
|
| 71 |
}
|
| 72 |
.map-spot:hover { transform: translate(-50%, -55%) scale(1.1); z-index: 20; }
|
| 73 |
+
.spot-building-wrap {
|
| 74 |
+
position: relative; width: 78px; height: 78px;
|
| 75 |
display: flex; align-items: center; justify-content: center;
|
| 76 |
+
transition: transform .25s cubic-bezier(.34,1.56,.64,1);
|
|
|
|
|
|
|
| 77 |
}
|
| 78 |
+
.spot-building-img {
|
| 79 |
+
width: 100%; height: 100%; object-fit: contain; display: block;
|
| 80 |
+
filter: drop-shadow(0 6px 14px rgba(45,32,28, 0.32));
|
| 81 |
+
transition: filter .25s ease, transform .25s ease;
|
| 82 |
+
}
|
| 83 |
+
.map-spot:hover { z-index: 30; }
|
| 84 |
+
.map-spot:hover .spot-building-wrap { transform: translateY(-8px) scale(1.18); }
|
| 85 |
+
.map-spot:hover .spot-building-img {
|
| 86 |
+
filter: drop-shadow(0 14px 22px rgba(45,32,28, 0.45)) drop-shadow(0 0 12px rgba(244,212,116, 0.7));
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
.spot-label {
|
| 90 |
+
padding: 3px 9px; border-radius: 99px; font-size: 11px; font-weight: 800;
|
| 91 |
+
background: rgba(255, 255, 255, 0.94); border: 1px solid var(--line);
|
| 92 |
+
color: var(--text); white-space: nowrap; box-shadow: 0 4px 10px rgba(120,70,50, 0.12);
|
| 93 |
+
backdrop-filter: blur(6px); margin-top: -4px;
|
| 94 |
}
|
| 95 |
+
html[data-theme="dark"] .spot-label { background: rgba(22,30,49, 0.92); border-color: rgba(255,255,255,.15); color: #fff; }
|
| 96 |
|
| 97 |
/* 據點三種狀態 */
|
| 98 |
+
.map-spot.locked .spot-building-img { opacity: .36; filter: grayscale(1) drop-shadow(0 2px 6px rgba(0,0,0,.2)); }
|
| 99 |
+
.map-spot.locked .spot-label { opacity: .65; border-color: rgba(180,130,100, 0.2); }
|
|
|
|
| 100 |
|
| 101 |
+
.map-spot.ready .spot-building-img {
|
| 102 |
+
filter: saturate(1.2) drop-shadow(0 0 10px rgba(239,90,86, 0.65));
|
| 103 |
}
|
| 104 |
+
.map-spot.ready .spot-building-wrap::after {
|
| 105 |
+
content: ''; position: absolute; inset: -4px; border-radius: 50%;
|
| 106 |
+
border: 2px dashed var(--accent); pointer-events: none;
|
| 107 |
+
animation: spotPulse 1.8s infinite ease-out;
|
|
|
|
|
|
|
| 108 |
}
|
| 109 |
+
.map-spot.ready .spot-label { border-color: var(--accent); color: var(--accent); font-weight: 900; }
|
| 110 |
@keyframes spotPulse {
|
| 111 |
+
0% { transform: scale(0.9); opacity: .9; }
|
| 112 |
+
100% { transform: scale(1.4); opacity: 0; }
|
| 113 |
}
|
| 114 |
|
| 115 |
+
.map-spot.active .spot-building-img {
|
| 116 |
+
filter: drop-shadow(0 8px 16px rgba(45,32,28, 0.35));
|
|
|
|
| 117 |
}
|
| 118 |
+
.map-spot.active.evolved .spot-building-img {
|
| 119 |
+
filter: drop-shadow(0 8px 20px rgba(124,58,237,.55)) drop-shadow(0 0 14px rgba(244,212,116, 0.6));
|
|
|
|
| 120 |
}
|
| 121 |
.spot-flag {
|
| 122 |
+
position: absolute; top: -6px; right: -4px; font-size: 18px; z-index: 5;
|
| 123 |
+
filter: drop-shadow(0 2px 4px rgba(0,0,0,.35));
|
| 124 |
animation: flagWave 2s infinite ease-in-out alternate;
|
| 125 |
}
|
| 126 |
@keyframes flagWave { 0% { transform: rotate(-5deg); } 100% { transform: rotate(10deg); } }
|
|
|
|
| 147 |
.side { width: 300px; flex-shrink: 0; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 140px; }
|
| 148 |
.work-card { position: relative; overflow: hidden; display: flex; justify-content: center; padding: 22px; }
|
| 149 |
.work-btn {
|
| 150 |
+
width: 180px; height: 180px; border-radius: 50%; border: 0; cursor: pointer; color: #382000;
|
| 151 |
+
background: radial-gradient(circle at 35% 30%, #fff4d4, #f4d474 48%, #dfbc55);
|
| 152 |
+
box-shadow: 0 0 0 6px rgba(244,212,116,.3), 0 16px 36px -8px rgba(239,90,86,.35), inset 0 -6px 14px rgba(180,120,40,.2);
|
| 153 |
display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
|
| 154 |
transition: transform .08s ease, box-shadow .2s;
|
| 155 |
-webkit-tap-highlight-color: transparent;
|
| 156 |
}
|
| 157 |
+
.work-btn:hover { transform: scale(1.04); box-shadow: 0 0 0 10px rgba(244,212,116,.4), 0 20px 45px -8px rgba(239,90,86,.45), inset 0 -6px 14px rgba(180,120,40,.2); }
|
| 158 |
.work-btn:active { transform: scale(.94); }
|
| 159 |
.work-emoji { font-size: 44px; }
|
| 160 |
+
.work-label { font-weight: 900; font-size: 18px; color: #382000; }
|
| 161 |
+
.work-val { font-weight: 700; font-size: 13px; opacity: .88; color: #523100; }
|
| 162 |
.float-layer { position: absolute; inset: 0; pointer-events: none; }
|
| 163 |
+
.float-num { position: absolute; font-weight: 900; color: #ef5a56; text-shadow: 0 1px 4px rgba(255,255,255,.9); animation: floatUp .9s ease-out forwards; }
|
| 164 |
html[data-theme="dark"] .float-num { text-shadow: 0 2px 8px rgba(0,0,0,.6); }
|
| 165 |
@keyframes floatUp { from { opacity: 1; transform: translate(-50%, 0); } to { opacity: 0; transform: translate(-50%, -70px); } }
|
| 166 |
|
| 167 |
.kv { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
|
| 168 |
.kv li { display: flex; justify-content: space-between; gap: 8px; }
|
| 169 |
.kv li span:first-child { color: var(--text-dim); }
|
| 170 |
+
.hint-card { border-color: rgba(239,90,86,.3); font-size: 14px; background: rgba(239,90,86,.04); }
|
| 171 |
.hint-card b { color: var(--accent); }
|
| 172 |
|
| 173 |
.build-head { justify-content: space-between; margin-bottom: 12px; }
|
|
|
|
| 178 |
|
| 179 |
.b-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
|
| 180 |
.b-card {
|
| 181 |
+
position: relative; display: grid; grid-template-columns: 62px 1fr; gap: 14px; padding: 14px;
|
| 182 |
border-radius: var(--radius); border: 1px solid var(--line);
|
| 183 |
background: var(--bg-1);
|
| 184 |
transition: transform .15s ease, box-shadow .2s, border-color .2s;
|
| 185 |
}
|
| 186 |
html[data-theme="dark"] .b-card { background: linear-gradient(180deg, rgba(31,42,68,.8), rgba(23,32,54,.8)); }
|
| 187 |
+
.b-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: rgba(239,90,86,.4); }
|
| 188 |
.b-card.evolved { border-color: rgba(124,58,237,.5); box-shadow: 0 0 0 1px rgba(124,58,237,.25), 0 8px 24px -10px rgba(124,58,237,.4); }
|
| 189 |
+
.b-card.locked { opacity: .55; }
|
| 190 |
.b-card.locked:hover { transform: none; }
|
| 191 |
.b-icon {
|
| 192 |
+
width: 62px; height: 62px; border-radius: 16px; overflow: hidden; padding: 4px;
|
| 193 |
display: flex; align-items: center; justify-content: center;
|
| 194 |
background: var(--bg-2); border: 2px solid var(--line);
|
| 195 |
+
box-shadow: 0 4px 10px rgba(120,70,50,.08);
|
| 196 |
}
|
| 197 |
+
.b-thumb { width: 100%; height: 100%; object-fit: contain; display: block; transition: transform .3s ease; }
|
| 198 |
+
.b-card:hover .b-thumb { transform: scale(1.1); }
|
| 199 |
+
.b-card.locked .b-thumb { opacity: .4; filter: grayscale(1); }
|
| 200 |
.b-card.evolved .b-icon { border-color: var(--accent-2); box-shadow: 0 0 12px rgba(124,58,237,.35); }
|
| 201 |
|
| 202 |
.work-thumb {
|
|
|
|
| 245 |
.r-sub { font-size: 12px; color: var(--text-dim); }
|
| 246 |
.r-reward { font-size: 12px; color: var(--sky); }
|
| 247 |
|
|
|
|
| 248 |
.row-me {
|
| 249 |
+
background: rgba(239, 90, 86, 0.12) !important;
|
| 250 |
font-weight: 700;
|
| 251 |
+
border-left: 3px solid var(--accent) !important;
|
| 252 |
}
|
| 253 |
.rank-crown {
|
| 254 |
display: inline-flex;
|
|
|
|
| 259 |
padding: 3px 8px;
|
| 260 |
border-radius: 999px;
|
| 261 |
}
|
| 262 |
+
.crown-1 { background: rgba(244, 212, 116, 0.35); color: #8c5d00; border: 1px solid #f4d474; box-shadow: 0 2px 8px rgba(244,212,116,0.3); }
|
| 263 |
+
.crown-2 { background: #faefe4; color: #524036; border: 1px solid #ebd5c3; }
|
| 264 |
+
.crown-3 { background: #fbeae8; color: #b83a36; border: 1px solid #fad2cf; }
|
| 265 |
.rank-num { font-weight: 800; font-size: 13px; color: var(--text-dim); }
|
| 266 |
.r-reward { font-size: 12px; color: var(--sky); }
|
| 267 |
|
js/db.js
CHANGED
|
@@ -457,7 +457,8 @@ class LocalBackend {
|
|
| 457 |
let _db = null;
|
| 458 |
export async function getDB() {
|
| 459 |
if (_db) return _db;
|
| 460 |
-
const
|
|
|
|
| 461 |
const backend = useFirebase ? new FirebaseBackend() : new LocalBackend();
|
| 462 |
try {
|
| 463 |
await backend.init();
|
|
|
|
| 457 |
let _db = null;
|
| 458 |
export async function getDB() {
|
| 459 |
if (_db) return _db;
|
| 460 |
+
const isDemoParam = typeof location !== 'undefined' && new URLSearchParams(location.search).has('demo');
|
| 461 |
+
const useFirebase = !!(firebaseConfig && firebaseConfig.apiKey) && !isDemoParam;
|
| 462 |
const backend = useFirebase ? new FirebaseBackend() : new LocalBackend();
|
| 463 |
try {
|
| 464 |
await backend.init();
|
js/game.js
CHANGED
|
@@ -248,14 +248,14 @@ $$('#buyAmt button').forEach(b => {
|
|
| 248 |
|
| 249 |
// 8 大要塞在沙盤大地圖上的百分比座標定位
|
| 250 |
const MAP_POS = {
|
| 251 |
-
b1: { x:
|
| 252 |
-
b2: { x:
|
| 253 |
-
b3: { x:
|
| 254 |
-
b4: { x:
|
| 255 |
-
b5: { x:
|
| 256 |
-
b6: { x:
|
| 257 |
-
b7: { x:
|
| 258 |
-
b8: { x:
|
| 259 |
};
|
| 260 |
|
| 261 |
function renderMapSpots() {
|
|
@@ -282,8 +282,8 @@ function renderMapSpots() {
|
|
| 282 |
iconBadge = '<span class="spot-flag">🎌</span>';
|
| 283 |
}
|
| 284 |
return `<div class="map-spot ${stateCls}" style="left:${pos.x}%; top:${pos.y}%;" data-bid="${b.id}" title="${b.name}">
|
| 285 |
-
<div class="spot-
|
| 286 |
-
<img class="spot-img" src="assets/building_${b.id}.
|
| 287 |
${iconBadge}
|
| 288 |
</div>
|
| 289 |
<div class="spot-label">${b.name} <small>${statusText}</small></div>
|
|
@@ -336,7 +336,7 @@ function renderBuild() {
|
|
| 336 |
const ev = dState.evolved.has(b.id);
|
| 337 |
if (!un) {
|
| 338 |
return `<div class="b-card locked" id="bcard_${b.id}">
|
| 339 |
-
<div class="b-icon"><img src="assets/building_${b.id}.
|
| 340 |
<div>
|
| 341 |
<div class="b-name">${b.name} <span class="badge">未開拓</span></div>
|
| 342 |
<div class="b-meta">需通過 ${b.unlockUnits} 個策驗單元開闢</div>
|
|
@@ -351,7 +351,7 @@ function renderBuild() {
|
|
| 351 |
const mPct = mNext ? (st.lv / mNext) * 100 : 100;
|
| 352 |
|
| 353 |
return `<div class="b-card ${ev ? 'evolved' : ''} ${st.lv === 0 ? 'unclaimed' : ''}" id="bcard_${b.id}">
|
| 354 |
-
<div class="b-icon"><img src="assets/building_${b.id}.
|
| 355 |
<div>
|
| 356 |
<div class="b-name">${b.name} <span class="badge">${st.lv === 0 ? '待出兵' : 'Lv.' + st.lv}</span>
|
| 357 |
<span class="b-stars">${'★'.repeat(baseStars)}${'☆'.repeat(STAR_BASE_MAX - baseStars)}${extraStars ? ` <b>+${extraStars}</b>` : ''}</span>
|
|
|
|
| 248 |
|
| 249 |
// 8 大要塞在沙盤大地圖上的百分比座標定位
|
| 250 |
const MAP_POS = {
|
| 251 |
+
b1: { x: 20, y: 36 }, // 斥候哨所 (西北梯田高臺)
|
| 252 |
+
b2: { x: 50, y: 70 }, // 屯田糧倉 (中央南側金色平原大方塊地塊)
|
| 253 |
+
b3: { x: 40, y: 52 }, // 軍械鐵坊 (中西河畔工坊地塊)
|
| 254 |
+
b4: { x: 33, y: 68 }, // 邊境驛站 (西南商路橋頭地塊)
|
| 255 |
+
b5: { x: 82, y: 32 }, // 採礦重鎮 (東北雪山礦脈崖壁)
|
| 256 |
+
b6: { x: 72, y: 62 }, // 軍機策府 (東南書院平臺地塊)
|
| 257 |
+
b7: { x: 18, y: 78 }, // 水師戰塢 (西南碧藍水寨碼頭)
|
| 258 |
+
b8: { x: 60, y: 28 }, // 霸業王城 (北方巔峰雄偉城堡地塊)
|
| 259 |
};
|
| 260 |
|
| 261 |
function renderMapSpots() {
|
|
|
|
| 282 |
iconBadge = '<span class="spot-flag">🎌</span>';
|
| 283 |
}
|
| 284 |
return `<div class="map-spot ${stateCls}" style="left:${pos.x}%; top:${pos.y}%;" data-bid="${b.id}" title="${b.name}">
|
| 285 |
+
<div class="spot-building-wrap">
|
| 286 |
+
<img class="spot-building-img" src="assets/building_${b.id}.png" alt="${b.name}">
|
| 287 |
${iconBadge}
|
| 288 |
</div>
|
| 289 |
<div class="spot-label">${b.name} <small>${statusText}</small></div>
|
|
|
|
| 336 |
const ev = dState.evolved.has(b.id);
|
| 337 |
if (!un) {
|
| 338 |
return `<div class="b-card locked" id="bcard_${b.id}">
|
| 339 |
+
<div class="b-icon"><img src="assets/building_${b.id}.png" class="b-thumb" alt="${b.name}"></div>
|
| 340 |
<div>
|
| 341 |
<div class="b-name">${b.name} <span class="badge">未開拓</span></div>
|
| 342 |
<div class="b-meta">需通過 ${b.unlockUnits} 個策驗單元開闢</div>
|
|
|
|
| 351 |
const mPct = mNext ? (st.lv / mNext) * 100 : 100;
|
| 352 |
|
| 353 |
return `<div class="b-card ${ev ? 'evolved' : ''} ${st.lv === 0 ? 'unclaimed' : ''}" id="bcard_${b.id}">
|
| 354 |
+
<div class="b-icon"><img src="assets/building_${b.id}.png" class="b-thumb" alt="${b.name}"></div>
|
| 355 |
<div>
|
| 356 |
<div class="b-name">${b.name} <span class="badge">${st.lv === 0 ? '待出兵' : 'Lv.' + st.lv}</span>
|
| 357 |
<span class="b-stars">${'★'.repeat(baseStars)}${'☆'.repeat(STAR_BASE_MAX - baseStars)}${extraStars ? ` <b>+${extraStars}</b>` : ''}</span>
|
tools/make_transparent.py
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import numpy as np
|
| 2 |
+
from PIL import Image, ImageFilter
|
| 3 |
+
from collections import deque
|
| 4 |
+
import os
|
| 5 |
+
|
| 6 |
+
def remove_background(im_path, out_path, tol=33):
|
| 7 |
+
im = Image.open(im_path).convert('RGBA')
|
| 8 |
+
w, h = im.size
|
| 9 |
+
arr = np.array(im)
|
| 10 |
+
rgb = arr[:, :, :3].astype(np.float32)
|
| 11 |
+
|
| 12 |
+
# 取邊緣像素做背景色基準
|
| 13 |
+
border_pixels = np.concatenate([
|
| 14 |
+
rgb[0:4, :, :].reshape(-1, 3),
|
| 15 |
+
rgb[h-4:h, :, :].reshape(-1, 3),
|
| 16 |
+
rgb[:, 0:4, :].reshape(-1, 3),
|
| 17 |
+
rgb[:, w-4:w, :].reshape(-1, 3)
|
| 18 |
+
], axis=0)
|
| 19 |
+
bg_color = np.median(border_pixels, axis=0)
|
| 20 |
+
|
| 21 |
+
# 計算各像素與背景色的歐氏距離
|
| 22 |
+
dist = np.linalg.norm(rgb - bg_color, axis=2)
|
| 23 |
+
|
| 24 |
+
# 邊界 BFS 蔓延遮罩
|
| 25 |
+
bg_mask = np.zeros((h, w), dtype=bool)
|
| 26 |
+
visited = np.zeros((h, w), dtype=bool)
|
| 27 |
+
queue = deque()
|
| 28 |
+
|
| 29 |
+
for x in range(w):
|
| 30 |
+
if dist[0, x] < tol: queue.append((0, x)); visited[0, x] = True
|
| 31 |
+
if dist[h-1, x] < tol: queue.append((h-1, x)); visited[h-1, x] = True
|
| 32 |
+
for y in range(h):
|
| 33 |
+
if dist[y, 0] < tol and not visited[y, 0]: queue.append((y, 0)); visited[y, 0] = True
|
| 34 |
+
if dist[y, w-1] < tol and not visited[y, w-1]: queue.append((y, w-1)); visited[y, w-1] = True
|
| 35 |
+
|
| 36 |
+
while queue:
|
| 37 |
+
cy, cx = queue.popleft()
|
| 38 |
+
bg_mask[cy, cx] = True
|
| 39 |
+
for ny, nx in ((cy-1, cx), (cy+1, cx), (cy, cx-1), (cy, cx+1)):
|
| 40 |
+
if 0 <= ny < h and 0 <= nx < w and not visited[ny, nx]:
|
| 41 |
+
visited[ny, nx] = True
|
| 42 |
+
if dist[ny, nx] < tol:
|
| 43 |
+
queue.append((ny, nx))
|
| 44 |
+
|
| 45 |
+
# 前景遮罩 = 非背景 (0=透明, 255=實體)
|
| 46 |
+
fg_mask = (~bg_mask).astype(np.uint8) * 255
|
| 47 |
+
alpha_img = Image.fromarray(fg_mask, mode='L')
|
| 48 |
+
|
| 49 |
+
# 形態學過濾:MinFilter 消除孤立小顆粒/星芒殘留
|
| 50 |
+
alpha_clean = alpha_img.filter(ImageFilter.MinFilter(5))
|
| 51 |
+
alpha_clean = alpha_clean.filter(ImageFilter.MaxFilter(5))
|
| 52 |
+
|
| 53 |
+
# 邊緣羽化平滑
|
| 54 |
+
alpha_smooth = alpha_clean.filter(ImageFilter.GaussianBlur(radius=1.2))
|
| 55 |
+
|
| 56 |
+
arr[:, :, 3] = np.array(alpha_smooth)
|
| 57 |
+
res = Image.fromarray(arr, mode='RGBA')
|
| 58 |
+
res.save(out_path, 'PNG')
|
| 59 |
+
print(f'Cutout done: {out_path}')
|
| 60 |
+
|
| 61 |
+
if __name__ == '__main__':
|
| 62 |
+
for i in range(1, 9):
|
| 63 |
+
src = f'assets/building_b{i}.jpg'
|
| 64 |
+
dst = f'assets/building_b{i}.png'
|
| 65 |
+
if os.path.exists(src):
|
| 66 |
+
remove_background(src, dst)
|