added on WebSTLs (webstls.com) at 2026-07-01 22:27:02
| 1 | <!DOCTYPE html> | |
| 2 | <html lang="en"> | |
| 3 | <head> | |
| 4 | <meta charset="UTF-8"> | |
| 5 | <link rel="icon" type="image/svg+xml" href="/assets/images/favicon.svg"> | |
| 6 | <title>My Subscriptions · $store_name</title> | |
| 7 | <link rel="stylesheet" href="/assets/css/site.css"> | |
| 8 | <style>:root { $theme_css_vars }</style> | |
| 9 | <style> | |
| 10 | body { background:var(--col-bg); color:var(--col-text); font-family:var(--font-ui,sans-serif); margin:0; } | |
| 11 | .ms-wrap { max-width:760px; margin:0 auto; padding:60px 24px 80px; } | |
| 12 | h1 { font-family:var(--font-display,inherit); margin:0 0 24px; color:var(--col-text); } | |
| 13 | .ms-card { background:var(--col-surface-1); border:1px solid var(--col-border); border-radius:14px; padding:22px 26px; margin-bottom:14px; } | |
| 14 | .ms-head { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:14px; flex-wrap:wrap; } | |
| 15 | .ms-title { font-size:20px; font-weight:700; color:var(--col-text); } | |
| 16 | .ms-pill { font-size:10px; padding:3px 9px; border-radius:5px; letter-spacing:1px; font-weight:700; text-transform:uppercase; } | |
| 17 | .ms-pill.active { background:rgba(34,197,94,0.18); color:#86efac; } | |
| 18 | .ms-pill.canceled { background:rgba(239,68,68,0.18); color:#fca5a5; } | |
| 19 | .ms-meter { background:var(--col-surface-2); height:10px; border-radius:5px; overflow:hidden; margin:10px 0 6px; } | |
| 20 | .ms-meter .fill { background:linear-gradient(90deg, var(--col-accent), var(--col-accent-bright)); height:100%; } | |
| 21 | .ms-meta { font-size:13px; color:var(--col-text-2); } | |
| 22 | .ms-empty { padding:60px 24px; text-align:center; border:1px dashed var(--col-border-2); border-radius:14px; color:var(--col-text-2); } | |
| 23 | .ms-cancel { background:none; border:1px solid rgba(239,68,68,0.35); color:#fca5a5; padding:8px 16px; border-radius:8px; cursor:pointer; font-size:13px; font-weight:600; } | |
| 24 | .ms-cancel:hover { background:rgba(239,68,68,0.10); } | |
| 25 | </style> | |
| 26 | </head> | |
| 27 | <body> | |
| 28 | <main class="ms-wrap"> | |
| 29 | <h1>My subscriptions at $store_name</h1> | |
| 30 | ||
| 31 | [if:$canceled_flash] | |
| 32 | <div style="padding:10px 14px;margin-bottom:18px;background:rgba(34,197,94,0.10);border:1px solid rgba(34,197,94,0.30);border-radius:8px;color:#86efac;font-size:13px">Subscription canceled. You keep benefits until the end of the current period.</div> | |
| 33 | [/if] | |
| 34 | ||
| 35 | [if:!$has_subs] | |
| 36 | <div class="ms-empty"> | |
| 37 | <h2 style="color:#fff;margin-bottom:8px;font-family:var(--font-display,inherit)">No subscriptions yet</h2> | |
| 38 | <p>$store_name's subscription plans appear on the storefront when published. Subscribe to download files monthly or get a printed item shipped on a cadence.</p> | |
| 39 | <a href="/store.cgi?id=$store_id" style="display:inline-block;margin-top:12px;padding:10px 18px;background:linear-gradient(135deg, var(--col-accent), var(--col-accent-bright));color:#fff;text-decoration:none;border-radius:8px;font-weight:600">Browse plans</a> | |
| 40 | </div> | |
| 41 | [/if] | |
| 42 | ||
| 43 | [if:$has_subs] | |
| 44 | [loop:@subs] | |
| 45 | <div class="ms-card"> | |
| 46 | <div class="ms-head"> | |
| 47 | <div> | |
| 48 | <div class="ms-title">$loop1.plan_name</div> | |
| 49 | <div class="ms-meta">$loop1.kind_label · $loop1.price_label every $loop1.cadence days</div> | |
| 50 | </div> | |
| 51 | [if:$loop1.is_active]<span class="ms-pill active">Active</span>[/if] | |
| 52 | [if:$loop1.is_canceled]<span class="ms-pill canceled">Canceled</span>[/if] | |
| 53 | </div> | |
| 54 | ||
| 55 | <div class="ms-meta">This period: <strong>$loop1.used</strong> of $loop1.quota used · $loop1.remaining remaining</div> | |
| 56 | <div class="ms-meter"><div class="fill" style="width:0%" data-used="$loop1.used" data-quota="$loop1.quota"></div></div> | |
| 57 | <div class="ms-meta" style="font-size:11px;color:var(--col-text-3)">Period ends $loop1.period_end</div> | |
| 58 | ||
| 59 | [if:$loop1.is_active] | |
| 60 | <form method="POST" action="/my_subscription.cgi" style="margin-top:14px" | |
| 61 | data-confirm-title="Cancel this subscription?" | |
| 62 | data-confirm-message="You keep all benefits through the end of the current period. We won't charge you again." | |
| 63 | data-confirm-label="Cancel subscription"> | |
| 64 | <input type="hidden" name="_act" value="cancel"> | |
| 65 | <input type="hidden" name="id" value="$store_id"> | |
| 66 | <input type="hidden" name="sub_id" value="$loop1.id"> | |
| 67 | <button type="submit" class="ms-cancel">Cancel subscription</button> | |
| 68 | </form> | |
| 69 | [/if] | |
| 70 | </div> | |
| 71 | [/loop] | |
| 72 | [/if] | |
| 73 | </main> | |
| 74 | <script> | |
| 75 | document.querySelectorAll('.ms-meter .fill').forEach(function(el){ | |
| 76 | var used = parseInt(el.dataset.used,10)||0; | |
| 77 | var quota= parseInt(el.dataset.quota,10)||1; | |
| 78 | var pct = Math.min(100, Math.round(used/quota*100)); | |
| 79 | el.style.width = pct + '%'; | |
| 80 | }); | |
| 81 | </script> | |
| 82 | </body> | |
| 83 | </html> |