Files

391 lines
11 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>just-fucking-cancel</title>
<style>
:root {
--bg: #fff;
--text: #222;
--muted: #666;
--border: #ddd;
--accent: #1976d2;
--pending: #fff3cd;
--pending-border: #ffc107;
--cancelled: #e8e8e8;
--investigate: #f57c00;
--keep: #388e3c;
}
@media (prefers-color-scheme: dark) {
:root {
--bg: #1a1a1a;
--text: #e0e0e0;
--muted: #999;
--border: #333;
--accent: #64b5f6;
--pending: #3d3200;
--pending-border: #ffc107;
--cancelled: #2a2a2a;
--investigate: #ffb74d;
--keep: #81c784;
}
}
body {
max-width: 900px;
margin: 40px auto;
padding: 0 20px;
font-family: system-ui;
background: var(--bg);
color: var(--text);
}
/* SHARE CARD - Receipt style */
.share-card {
background: transparent;
color: var(--text);
padding: 1.5rem 0;
margin: 0 0 2rem 0;
text-align: left;
border-bottom: 2px dashed var(--accent);
}
.share-card .scope {
font-size: 0.875rem;
color: var(--accent);
margin-bottom: 0.75rem;
}
.share-card .breakdown {
font-size: 1.1rem;
color: var(--accent);
margin-bottom: 0.5rem;
}
.share-card h1 {
font-size: 2.75rem;
font-weight: 800;
margin: 0;
letter-spacing: -1px;
color: var(--text);
}
.share-card h1 span {
font-size: 1.25rem;
font-weight: 500;
color: var(--muted);
}
.share-card .timestamp {
font-size: 0.75rem;
color: var(--muted);
margin-top: 1rem;
}
/* Rest of page header */
.page-meta {
color: var(--muted);
font-size: 0.875rem;
margin-bottom: 2rem;
text-align: center;
}
/* Sections */
.section { margin: 2rem 0; }
.section.empty { display: none; }
.section-header {
display: flex;
align-items: center;
gap: 0.5rem;
margin-bottom: 1rem;
padding-bottom: 0.5rem;
border-bottom: 2px solid var(--border);
cursor: pointer;
}
.section-header::before {
content: '\25BC';
font-size: 0.6rem;
color: var(--muted);
transition: transform 0.2s;
}
.section.collapsed .section-header::before {
transform: rotate(-90deg);
}
.section.collapsed table,
.section.collapsed details {
display: none;
}
.section-header h2 { margin: 0; font-size: 1.25rem; }
.section-count {
margin-left: auto;
color: var(--muted);
font-size: 0.875rem;
}
/* Badges */
.badge {
padding: 4px 12px;
border-radius: 4px;
font-size: 0.7rem;
font-weight: bold;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.badge-pending { background: var(--pending-border); color: #000; }
.badge-cancelled { background: var(--keep); color: white; }
.badge-investigate { background: var(--investigate); color: white; }
.badge-keep { background: #666; color: white; }
/* Table */
table { border-collapse: collapse; width: 100%; }
td, th { border: 1px solid var(--border); padding: 10px 12px; text-align: left; }
th { background: var(--border); font-size: 0.85rem; }
.amount { font-family: monospace; text-align: right; white-space: nowrap; }
.note { font-size: 0.85rem; color: var(--muted); }
.checkbox { width: 30px; text-align: center; }
input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }
/* ROW STATES */
tr.pending {
background: var(--pending);
}
tr.pending td:first-child {
border-left: 4px solid var(--pending-border);
}
tr.cancelled {
background: var(--cancelled);
color: var(--muted);
}
tr.cancelled td {
text-decoration: line-through;
text-decoration-color: var(--muted);
}
tr.cancelled .status-cell {
text-decoration: none;
font-style: italic;
}
tr.investigate td:first-child { border-left: 4px solid var(--investigate); }
tr.keep td:first-child { border-left: 4px solid var(--keep); }
/* Category headers in tables */
.category-header {
background: var(--border);
font-weight: bold;
color: var(--muted);
font-size: 0.8rem;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.category-header td { border-left: none !important; }
/* Details/expand sections */
details { margin-top: 1rem; }
summary { cursor: pointer; font-weight: 600; }
summary:hover { color: var(--accent); }
/* Privacy toggle */
.privacy-toggle {
margin-left: 1rem;
padding: 4px 10px;
font-size: 0.75rem;
background: var(--border);
border: none;
border-radius: 4px;
cursor: pointer;
color: var(--muted);
}
.privacy-toggle:hover { background: var(--accent); color: white; }
body.privacy-mode .service-name {
filter: blur(5px);
user-select: none;
}
body.privacy-mode .service-name:hover {
filter: none;
}
/* Floating copy button */
.floating-copy {
position: fixed;
bottom: 20px;
right: 20px;
background: var(--text);
color: var(--bg);
border: none;
padding: 12px 20px;
border-radius: 8px;
font-size: 0.9rem;
font-weight: 600;
cursor: pointer;
display: none;
box-shadow: 0 2px 10px rgba(0,0,0,0.2);
z-index: 1000;
}
.floating-copy:hover { opacity: 0.9; }
.floating-copy.visible { display: block; }
.floating-copy.copied { background: var(--keep); }
</style>
</head>
<body>
<!-- SHARE CARD - Update after analysis -->
<div class="share-card">
<p class="scope">found N subscriptions · N transactions</p>
<p class="breakdown">Cancelled N · Keeping N</p>
<h1>just saved $XX,XXX/yr <span>($X,XXX/mo)</span></h1>
<p class="timestamp">last run DATE at TIME</p>
</div>
<p class="page-meta">
Subscription audit
<button class="privacy-toggle" onclick="togglePrivacy()">Hide names</button>
</p>
<!-- CANCELLED - Done, strikethrough -->
<div class="section" id="section-cancelled">
<div class="section-header" onclick="this.parentElement.classList.toggle('collapsed')">
<span class="badge badge-cancelled">Done</span>
<h2>Cancel</h2>
<span class="section-count" data-section="cancelled"></span>
</div>
<table>
<tr>
<th style="width:30px"></th>
<th>Service</th>
<th>Monthly</th>
<th>Status</th>
</tr>
<!-- TEMPLATE: Cancelled items
<tr class="cancelled" data-status="cancelled">
<td>✓</td>
<td><strong class="service-name">Service Name</strong></td>
<td class="amount">$XX</td>
<td class="status-cell">Cancelled DATE</td>
</tr>
-->
</table>
</div>
<!-- INVESTIGATE - Needs decision -->
<div class="section" id="section-investigate">
<div class="section-header" onclick="this.parentElement.classList.toggle('collapsed')">
<span class="badge badge-investigate">Decide</span>
<h2>Needs Decision</h2>
<span class="section-count" data-section="investigate"></span>
</div>
<table>
<tr>
<th class="checkbox">Cancel?</th>
<th>Service</th>
<th>Monthly</th>
<th>Issue</th>
</tr>
<!-- TEMPLATE: Items needing decision
<tr class="investigate" data-status="investigate">
<td class="checkbox"><input type="checkbox"></td>
<td><strong class="service-name">Service Name</strong></td>
<td class="amount">$XX</td>
<td class="note">Why this needs review</td>
</tr>
-->
</table>
</div>
<!-- KEEPING - No checkbox needed -->
<div class="section" id="section-keep">
<div class="section-header" onclick="this.parentElement.classList.toggle('collapsed')">
<span class="badge badge-keep">Keep</span>
<h2>Keeping</h2>
<span class="section-count" data-section="keep"></span>
</div>
<table>
<tr>
<th>Service</th>
<th>Monthly</th>
<th>Reason</th>
</tr>
<!-- TEMPLATE: Category header (optional)
<tr class="category-header"><td colspan="3">Category Name</td></tr>
-->
<!-- TEMPLATE: Keep items
<tr class="keep" data-status="keep">
<td><strong class="service-name">Service Name</strong></td>
<td class="amount">$XX</td>
<td class="note">Why keeping</td>
</tr>
-->
</table>
</div>
<!-- Floating copy button -->
<button class="floating-copy" onclick="copyChecked()">Copy selected</button>
<script>
function togglePrivacy() {
document.body.classList.toggle('privacy-mode');
const btn = document.querySelector('.privacy-toggle');
btn.textContent = document.body.classList.contains('privacy-mode') ? 'Show names' : 'Hide names';
}
function updateCounts() {
document.querySelectorAll('[data-section]').forEach(el => {
const section = el.dataset.section;
const count = document.querySelectorAll(`[data-status="${section}"]`).length;
el.textContent = count > 0 ? `${count} items` : '';
});
}
function updateFloatingButton() {
const checked = document.querySelectorAll('input[type="checkbox"]:checked');
const btn = document.querySelector('.floating-copy');
btn.classList.toggle('visible', checked.length > 0);
btn.textContent = checked.length > 0 ? `Copy ${checked.length} selected` : 'Copy selected';
}
function copyChecked() {
const checked = document.querySelectorAll('input[type="checkbox"]:checked');
const items = [];
checked.forEach(cb => {
const row = cb.closest('tr');
const name = row.querySelector('.service-name')?.textContent || '';
const amount = row.querySelector('.amount')?.textContent || '';
if (name) items.push(`${name} (${amount})`);
});
const text = `Cancel these: ${items.join(', ')}`;
navigator.clipboard.writeText(text).then(() => {
const btn = document.querySelector('.floating-copy');
btn.classList.add('copied');
btn.textContent = 'Copied!';
setTimeout(() => {
btn.classList.remove('copied');
updateFloatingButton();
}, 1500);
});
}
document.querySelectorAll('input[type="checkbox"]').forEach(cb => {
cb.addEventListener('change', function() {
const row = this.closest('tr');
if (this.checked) {
row.classList.add('pending');
row.dataset.status = 'pending';
} else {
row.classList.remove('pending');
const section = row.closest('.section').id.replace('section-', '');
row.dataset.status = section;
}
updateCounts();
updateFloatingButton();
hideEmptySections();
});
});
function hideEmptySections() {
document.querySelectorAll('.section').forEach(section => {
const rows = section.querySelectorAll('tr[data-status]');
section.classList.toggle('empty', rows.length === 0);
});
}
updateCounts();
updateFloatingButton();
hideEmptySections();
</script>
</body>
</html>