|
16 | 16 | Languages, |
17 | 17 | LayoutGrid |
18 | 18 | } from '@lucide/svelte'; |
| 19 | + import { scale, fade } from 'svelte/transition'; |
19 | 20 |
|
20 | 21 | let pat = $state(authStore.github.token); |
21 | 22 | let gistId = $state(authStore.github.gistId); |
|
386 | 387 | <div role="tablist" class="tabs tabs-box mb-4"> |
387 | 388 | <button |
388 | 389 | role="tab" |
389 | | - class="tab {activeTab === 'github' ? 'tab-active' : ''}" |
| 390 | + class="tab transition-all duration-300 {activeTab === 'github' ? 'tab-active' : ''}" |
390 | 391 | onclick={() => { activeTab = 'github'; errorMessage = null; }} |
391 | 392 | > |
392 | 393 | GitHub Gist |
393 | 394 | {#if authStore.activeProvider === 'github'} |
394 | | - <div class="badge badge-primary badge-sm ml-2">Active</div> |
| 395 | + <div class="badge badge-primary badge-sm ml-2" in:scale={{duration: 200, start: 0.8}} out:scale={{duration: 200, start: 0.8}}>Active</div> |
395 | 396 | {/if} |
396 | 397 | </button> |
397 | 398 | <button |
398 | 399 | role="tab" |
399 | | - class="tab {activeTab === 'gdrive' ? 'tab-active' : ''}" |
| 400 | + class="tab transition-all duration-300 {activeTab === 'gdrive' ? 'tab-active' : ''}" |
400 | 401 | onclick={() => { activeTab = 'gdrive'; errorMessage = null; }} |
401 | 402 | > |
402 | 403 | Google Drive |
403 | 404 | {#if authStore.activeProvider === 'gdrive'} |
404 | | - <div class="badge badge-primary badge-sm ml-2">Active</div> |
| 405 | + <div class="badge badge-primary badge-sm ml-2" in:scale={{duration: 200, start: 0.8}} out:scale={{duration: 200, start: 0.8}}>Active</div> |
405 | 406 | {/if} |
406 | 407 | </button> |
407 | 408 | </div> |
|
493 | 494 | <div class="flex items-center gap-2"> |
494 | 495 | <button |
495 | 496 | type="button" |
496 | | - class="btn {authStore.activeProvider === 'github' ? 'btn-disabled' : 'btn-outline btn-accent'}" |
| 497 | + class="btn grid place-items-center transition-all duration-300 {authStore.activeProvider === 'github' ? 'btn-disabled' : 'btn-outline btn-accent'}" |
497 | 498 | onclick={() => setActiveProvider('github')} |
498 | 499 | disabled={authStore.activeProvider === 'github'} |
499 | 500 | > |
500 | | - {authStore.activeProvider === 'github' ? 'Currently Active' : 'Set as Active Sync Provider'} |
| 501 | + {#key authStore.activeProvider} |
| 502 | + <span class="col-start-1 row-start-1" in:scale={{duration:250, delay: 100, start: 0.95}} out:fade={{duration:150}}> |
| 503 | + {authStore.activeProvider === 'github' ? 'Currently Active' : 'Set as Active Sync Provider'} |
| 504 | + </span> |
| 505 | + {/key} |
501 | 506 | </button> |
502 | 507 | <button type="submit" class="btn btn-primary"> |
503 | 508 | <Save class="h-4 w-4" /> Save |
|
581 | 586 | <div class="flex items-center gap-2"> |
582 | 587 | <button |
583 | 588 | type="button" |
584 | | - class="btn {authStore.activeProvider === 'gdrive' ? 'btn-disabled' : 'btn-outline btn-accent'}" |
| 589 | + class="btn grid place-items-center transition-all duration-300 {authStore.activeProvider === 'gdrive' ? 'btn-disabled' : 'btn-outline btn-accent'}" |
585 | 590 | onclick={() => setActiveProvider('gdrive')} |
586 | 591 | disabled={authStore.activeProvider === 'gdrive'} |
587 | 592 | > |
588 | | - {authStore.activeProvider === 'gdrive' ? 'Currently Active' : 'Set as Active Sync Provider'} |
| 593 | + {#key authStore.activeProvider} |
| 594 | + <span class="col-start-1 row-start-1" in:scale={{duration:250, delay: 100, start: 0.95}} out:fade={{duration:150}}> |
| 595 | + {authStore.activeProvider === 'gdrive' ? 'Currently Active' : 'Set as Active Sync Provider'} |
| 596 | + </span> |
| 597 | + {/key} |
589 | 598 | </button> |
590 | 599 | <button type="submit" class="btn btn-primary"> |
591 | 600 | <Save class="h-4 w-4" /> Save |
|
0 commit comments