|
276 | 276 | } |
277 | 277 |
|
278 | 278 | const cost = modeInfo!.cost; |
279 | | - if (inputFormat === 'absolute') { |
280 | | - // Convert absolute -> normalized (divide by cost) |
281 | | - buckets = buckets.map(b => ({ ...b, min_payout: +(b.min_payout / cost), max_payout: +(b.max_payout / cost) })); |
282 | | - inputFormat = 'normalized'; |
283 | | - } else { |
| 279 | + // Swap based on the current ABS/NORM display toggle (displayMode). |
| 280 | + // If currently showing normalized values, convert them to absolute (multiply by cost), |
| 281 | + // otherwise convert absolute -> normalized (divide by cost). |
| 282 | + if (displayMode === 'norm') { |
284 | 283 | // Convert normalized -> absolute (multiply by cost) |
285 | 284 | buckets = buckets.map(b => ({ ...b, min_payout: +(b.min_payout * cost), max_payout: +(b.max_payout * cost) })); |
| 285 | + displayMode = 'abs'; |
286 | 286 | inputFormat = 'absolute'; |
| 287 | + } else { |
| 288 | + // Convert absolute -> normalized (divide by cost) |
| 289 | + buckets = buckets.map(b => ({ ...b, min_payout: +(b.min_payout / cost), max_payout: +(b.max_payout / cost) })); |
| 290 | + displayMode = 'norm'; |
| 291 | + inputFormat = 'normalized'; |
287 | 292 | } |
288 | 293 | // Clear any prior errors |
289 | 294 | error = null; |
|
842 | 847 | >MANUAL</button> |
843 | 848 | </div> |
844 | 849 |
|
845 | | - <!-- Bonus Mode / Units Banner --> |
846 | | - {#if modeInfo?.is_bonus_mode} |
847 | | - <div class="px-4 py-3 rounded-xl bg-violet-500/10 border border-violet-500/30"> |
848 | | - <div class="flex items-center gap-2 mb-2"> |
849 | | - <svg class="w-4 h-4 text-violet-400" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"> |
850 | | - <path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /> |
851 | | - </svg> |
852 | | - <span class="text-sm font-mono text-violet-400">BONUS MODE</span> |
853 | | - <span class="px-2 py-0.5 text-xs font-mono bg-violet-500/20 text-violet-300 rounded">Cost: {modeInfo.cost}x</span> |
854 | | - |
855 | | - <!-- Input format selector + convert button --> |
856 | | - <span class="ml-auto flex items-center gap-2"> |
857 | | - <span class="text-xs font-mono text-violet-300/80">Bucket ranges:</span> |
858 | | - <select |
859 | | - bind:value={inputFormat} |
860 | | - class="bg-[var(--color-graphite)] border border-white/10 rounded px-2 py-1 text-xs font-mono text-[var(--color-light)] focus:outline-none" |
861 | | - aria-label="Bucket range units" |
862 | | - title="Choose how you want to type bucket Min/Max values" |
863 | | - > |
864 | | - <option value="absolute">Absolute (x)</option> |
865 | | - <option value="normalized">Normalized (x / cost)</option> |
866 | | - </select> |
867 | | - |
868 | | - <button |
869 | | - class="p-1 rounded text-xs bg-[var(--color-slate)]/20 text-[var(--color-mist)] hover:bg-[var(--color-slate)]/30 transition-colors" |
870 | | - onclick={convertBucketsFormat} |
871 | | - title="Convert all current bucket Min/Max values to the other unit using the mode cost" |
872 | | - aria-label="Convert bucket values between absolute and normalized" |
873 | | - > |
874 | | - <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"> |
875 | | - <path stroke-linecap="round" stroke-linejoin="round" d="M7 7h10M7 7l3 3M7 7l3-3M17 17H7M17 17l-3-3M17 17l-3 3" /> |
876 | | - </svg> |
877 | | - </button> |
878 | | - </span> |
879 | | - </div> |
880 | | - |
881 | | - <div class="text-xs font-mono text-violet-200/70 space-y-2"> |
882 | | - <p> |
883 | | - In bonus modes, the optimizer uses <span class="text-violet-300">normalized</span> payouts where |
884 | | - <span class="text-emerald-400">1.0x</span> means "one mode cost". |
885 | | - If you select <span class="text-violet-300">Absolute</span> ranges, they are converted automatically before optimizing. |
886 | | - </p> |
887 | | - |
888 | | - <div class="space-y-1"> |
889 | | - <p><span class="text-violet-300">Absolute</span>: type the multipliers exactly as shown in your distribution/payout table (e.g. 500x = 500x).</p> |
890 | | - <p><span class="text-violet-300">Normalized</span>: type optimizer units (absolute ÷ cost).</p> |
891 | | - </div> |
892 | | - |
893 | | - <p class="text-violet-200/60"> |
894 | | - The swap button converts the current bucket values to quickly view and edit buckets in the other unit and switches the selected range unit (Absolute ↔ Normalized) so everything stays consistent. |
895 | | - </p> |
896 | | - </div> |
897 | | - </div> |
898 | | - {/if} |
| 850 | + <!-- NOTE: Top explanatory bonus-mode banner removed per UX request. --> |
899 | 851 |
|
900 | 852 | <!-- ═══════ PRESETS MODE ═══════ --> |
901 | 853 | {#if uiMode === 'presets'} |
|
1174 | 1126 | <div class="flex gap-0.5 p-0.5 bg-[var(--color-slate)]/30 rounded"> |
1175 | 1127 | <button |
1176 | 1128 | class="px-2 py-1 text-xs font-mono rounded transition-all |
1177 | | - {displayMode === 'abs' ? 'bg-[var(--color-violet)]/20 text-[var(--color-violet)]' : 'text-[var(--color-mist)]/70 hover:text-[var(--color-mist)]'}" |
| 1129 | + {displayMode === 'abs' ? 'bg-[var(--color-violet)]/20 text-[var(--color-violet)]' : 'text-[var(--color-mist)]/70 hover:text-[var(--color-mist)]'}" |
1178 | 1130 | onclick={() => displayMode = 'abs'} |
1179 | 1131 | title="Absolute values (multiplied by cost)" |
1180 | 1132 | >ABS</button> |
1181 | 1133 | <button |
1182 | 1134 | class="px-2 py-1 text-xs font-mono rounded transition-all |
1183 | | - {displayMode === 'norm' ? 'bg-[var(--color-emerald)]/20 text-[var(--color-emerald)]' : 'text-[var(--color-mist)]/70 hover:text-[var(--color-mist)]'}" |
| 1135 | + {displayMode === 'norm' ? 'bg-[var(--color-emerald)]/20 text-[var(--color-emerald)]' : 'text-[var(--color-mist)]/70 hover:text-[var(--color-mist)]'}" |
1184 | 1136 | onclick={() => displayMode = 'norm'} |
1185 | 1137 | title="Normalized values (divided by cost)" |
1186 | 1138 | >NORM</button> |
1187 | 1139 | </div> |
| 1140 | + |
| 1141 | + <!-- Convert/Switch button moved from the removed banner --> |
| 1142 | + <button |
| 1143 | + class="p-1 rounded text-xs bg-[var(--color-slate)]/20 text-[var(--color-mist)] hover:bg-[var(--color-slate)]/30 transition-colors" |
| 1144 | + onclick={convertBucketsFormat} |
| 1145 | + title="Convert current bucket Min/Max values between absolute and normalized units" |
| 1146 | + aria-label="Convert bucket values between absolute and normalized" |
| 1147 | + > |
| 1148 | + <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"> |
| 1149 | + <path stroke-linecap="round" stroke-linejoin="round" d="M7 7h10M7 7l3 3M7 7l3-3M17 17H7M17 17l-3-3M17 17l-3 3" /> |
| 1150 | + </svg> |
| 1151 | + </button> |
| 1152 | + |
1188 | 1153 | <span class="px-2 py-0.5 text-xs font-mono bg-[var(--color-cyan)]/20 text-[var(--color-cyan)] rounded">NEW</span> |
1189 | 1154 | </div> |
1190 | 1155 | {/if} |
|
1254 | 1219 | </div> |
1255 | 1220 | {/if} |
1256 | 1221 |
|
1257 | | - <!-- Bonus Mode Info (simplified) --> |
1258 | | - {#if modeInfo?.is_bonus_mode} |
1259 | | - <div class="px-3 py-2 rounded-lg bg-violet-500/10 border border-violet-500/20"> |
1260 | | - <div class="flex items-center gap-2 text-xs font-mono"> |
1261 | | - <span class="text-violet-400">BONUS MODE</span> |
1262 | | - <span class="px-1.5 py-0.5 bg-violet-500/20 text-violet-300 rounded">Cost: {modeInfo.cost}x</span> |
1263 | | - <span class="text-violet-200/70 ml-2"> |
1264 | | - {displayMode === 'abs' ? 'Showing absolute values' : 'Showing normalized values'} |
1265 | | - </span> |
1266 | | - </div> |
1267 | | - </div> |
1268 | | - {/if} |
| 1222 | + <!-- Bonus Mode Info (simplified) --> |
| 1223 | + {#if modeInfo?.is_bonus_mode} |
| 1224 | + <div class="px-3 py-2 rounded-lg bg-violet-500/10 border border-violet-500/20"> |
| 1225 | + <div class="flex items-center gap-2 text-xs font-mono"> |
| 1226 | + <span class="text-violet-400">BONUS MODE</span> |
| 1227 | + <span class="px-1.5 py-0.5 bg-violet-500/20 text-violet-300 rounded">Cost: {modeInfo.cost}x</span> |
| 1228 | + <span class="text-violet-200/70 ml-2"> |
| 1229 | + {displayMode === 'abs' ? 'Showing absolute values' : 'Showing normalized values'} |
| 1230 | + </span> |
| 1231 | + </div> |
| 1232 | + </div> |
| 1233 | + {/if} |
1269 | 1234 |
|
1270 | 1235 | <!-- Profile Selector Panel --> |
1271 | 1236 | {#if showProfiles && profileConfigs.length > 0} |
|
0 commit comments