feat: add zap split preset buttons

- Added 4 preset buttons: Default, Generous, Selfless, and Boris 🧡
- Default: 50/2.1/50 (You: 49%, Author: 49%, Boris: 2%)
- Generous: 5/10/75 (You: 6%, Author: 83%, Boris: 11%)
- Selfless: 1/19/80 (You: 1%, Author: 80%, Boris: 19%)
- Boris 🧡: 10/80/10 (You: 10%, Author: 10%, Boris: 80%)
- One-click setup for common zap split configurations
- Hover tooltips show actual percentage splits
This commit is contained in:
Gigi
2025-10-08 09:25:37 +01:00
parent ec4692da15
commit 7e54a01237
2 changed files with 72 additions and 0 deletions

View File

@@ -17,10 +17,52 @@ const ZapSettings: React.FC<ZapSettingsProps> = ({ settings, onUpdate }) => {
const borisPercentage = totalWeight > 0 ? (borisWeight / totalWeight) * 100 : 0
const authorPercentage = totalWeight > 0 ? (authorWeight / totalWeight) * 100 : 0
const applyPreset = (preset: { highlighter: number; boris: number; author: number }) => {
onUpdate({
zapSplitHighlighterWeight: preset.highlighter,
zapSplitBorisWeight: preset.boris,
zapSplitAuthorWeight: preset.author,
})
}
return (
<div className="settings-section">
<h3 className="section-title">Zap Splits</h3>
<div className="setting-group">
<label className="setting-label">Presets</label>
<div className="zap-preset-buttons">
<button
onClick={() => applyPreset({ highlighter: 50, boris: 2.1, author: 50 })}
className="zap-preset-btn"
title="You: 49%, Author: 49%, Boris: 2%"
>
Default
</button>
<button
onClick={() => applyPreset({ highlighter: 5, boris: 10, author: 75 })}
className="zap-preset-btn"
title="You: 6%, Author: 83%, Boris: 11%"
>
Generous
</button>
<button
onClick={() => applyPreset({ highlighter: 1, boris: 19, author: 80 })}
className="zap-preset-btn"
title="You: 1%, Author: 80%, Boris: 19%"
>
Selfless
</button>
<button
onClick={() => applyPreset({ highlighter: 10, boris: 80, author: 10 })}
className="zap-preset-btn"
title="You: 10%, Author: 10%, Boris: 80%"
>
Boris 🧡
</button>
</div>
</div>
<div className="setting-group">
<label className="setting-label">Your Share</label>
<div className="zap-split-container">

View File

@@ -2088,6 +2088,36 @@ body {
text-align: left;
}
.zap-preset-buttons {
display: flex;
gap: 0.5rem;
flex-wrap: wrap;
}
.zap-preset-btn {
padding: 0.5rem 1rem;
background: #2a2a2a;
border: 1px solid #444;
border-radius: 6px;
color: #ccc;
font-size: 0.9rem;
cursor: pointer;
transition: all 0.2s;
flex: 1;
min-width: 80px;
}
.zap-preset-btn:hover {
background: #333;
border-color: #646cff;
color: white;
transform: translateY(-1px);
}
.zap-preset-btn:active {
transform: translateY(0);
}
.settings-footer {
display: flex;
justify-content: flex-start;