[READ-ONLY] Mirror of https://github.com/probablykasper/cpc. Text calculator with support for units and conversion cpc.kasper.space
calculator cli conversion converter library math package units units-converter wasm website
0

Configure Feed

Select the types of activity you want to include in your feed.

web: Add "Clear history" button

Kasper (Jun 20, 2026, 3:26 AM +0200) f6f771c6 f5c05500

+34 -21
+34 -21
web/src/routes/+page.svelte
··· 41 41 <main class="w-full px-4 lg:px-8 text-base lg:text-lg"> 42 42 <nav class="flex items-center justify-between py-4 lg:py-6"> 43 43 <h1 class="text-3xl font-bold text-amber-600 dark:text-amber-400">cpc</h1> 44 - <a 45 - href="https://github.com/probablykasper/cpc" 46 - aria-label="GitHub repository" 47 - class="svelte-1ugh5mt" 48 - > 49 - <svg 50 - height="24" 51 - viewBox="-2 -2 28 28" 52 - width="24" 53 - xmlns="http://www.w3.org/2000/svg" 54 - class="svelte-8lfi33 svelte-1ugh5mt" 55 - ><path 56 - d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22" 57 - fill="none" 58 - stroke="currentColor" 59 - stroke-linecap="round" 60 - stroke-linejoin="round" 61 - stroke-width="2" 62 - class="svelte-8lfi33" 63 - ></path></svg 44 + <div class="flex items-center gap-4"> 45 + {#if calc_history.current.length > 0} 46 + <button 47 + type="button" 48 + class="text-sm p-2 opacity-65 hover:opacity-100 transition-opacity ease-out duration-150 cursor-pointer" 49 + onclick={() => { 50 + calc_history.current = []; 51 + }} 52 + > 53 + Clear history 54 + </button> 55 + {/if} 56 + <a 57 + href="https://github.com/probablykasper/cpc" 58 + aria-label="GitHub repository" 59 + class="svelte-1ugh5mt" 64 60 > 65 - </a> 61 + <svg 62 + height="24" 63 + viewBox="-2 -2 28 28" 64 + width="24" 65 + xmlns="http://www.w3.org/2000/svg" 66 + class="svelte-8lfi33 svelte-1ugh5mt" 67 + ><path 68 + d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22" 69 + fill="none" 70 + stroke="currentColor" 71 + stroke-linecap="round" 72 + stroke-linejoin="round" 73 + stroke-width="2" 74 + class="svelte-8lfi33" 75 + ></path></svg 76 + > 77 + </a> 78 + </div> 66 79 </nav> 67 80 <!-- svelte-ignore a11y_autofocus --> 68 81 <input