|
1017 | 1017 | use:tooltip={{ text: $currentFileName ? `Save '${$currentFileName}'` : "Save", shortcut: "Ctrl+S" }} |
1018 | 1018 | aria-label="Save" |
1019 | 1019 | > |
1020 | | - {#if saveFlash === 'save'} |
1021 | | - <Icon name="check" size={16} /> |
1022 | | - {:else} |
1023 | | - <Icon name="upload" size={16} /> |
1024 | | - {/if} |
| 1020 | + <span class="icon-crossfade"> |
| 1021 | + {#if saveFlash === 'save'} |
| 1022 | + <span class="icon-crossfade-item" in:fade={{ duration: 200 }} out:fade={{ duration: 200 }}> |
| 1023 | + <Icon name="check" size={16} /> |
| 1024 | + </span> |
| 1025 | + {:else} |
| 1026 | + <span class="icon-crossfade-item" in:fade={{ duration: 200 }} out:fade={{ duration: 200 }}> |
| 1027 | + <Icon name="upload" size={16} /> |
| 1028 | + </span> |
| 1029 | + {/if} |
| 1030 | + </span> |
1025 | 1031 | </button> |
1026 | 1032 | <button |
1027 | 1033 | class="toolbar-btn" |
1028 | 1034 | onclick={() => handleSaveAs()} |
1029 | 1035 | use:tooltip={{ text: "Save As", shortcut: "Ctrl+Shift+S" }} |
1030 | 1036 | aria-label="Save As" |
1031 | 1037 | > |
1032 | | - {#if saveFlash === 'save-as'} |
1033 | | - <Icon name="check" size={16} /> |
1034 | | - {:else} |
1035 | | - <Icon name="upload-plus" size={16} /> |
1036 | | - {/if} |
| 1038 | + <span class="icon-crossfade"> |
| 1039 | + {#if saveFlash === 'save-as'} |
| 1040 | + <span class="icon-crossfade-item" in:fade={{ duration: 200 }} out:fade={{ duration: 200 }}> |
| 1041 | + <Icon name="check" size={16} /> |
| 1042 | + </span> |
| 1043 | + {:else} |
| 1044 | + <span class="icon-crossfade-item" in:fade={{ duration: 200 }} out:fade={{ duration: 200 }}> |
| 1045 | + <Icon name="upload-plus" size={16} /> |
| 1046 | + </span> |
| 1047 | + {/if} |
| 1048 | + </span> |
1037 | 1049 | </button> |
1038 | 1050 | <button class="toolbar-btn" onclick={() => exportDialogOpen = true} use:tooltip={{ text: "Python Code", shortcut: "Ctrl+E" }} aria-label="View Python Code"> |
1039 | 1051 | <Icon name="braces" size={16} /> |
|
1416 | 1428 | background: color-mix(in srgb, var(--error) 15%, var(--surface-raised)); |
1417 | 1429 | } |
1418 | 1430 |
|
| 1431 | + .icon-crossfade { |
| 1432 | + position: relative; |
| 1433 | + display: flex; |
| 1434 | + align-items: center; |
| 1435 | + justify-content: center; |
| 1436 | + width: 16px; |
| 1437 | + height: 16px; |
| 1438 | + } |
| 1439 | +
|
| 1440 | + .icon-crossfade-item { |
| 1441 | + position: absolute; |
| 1442 | + display: flex; |
| 1443 | + } |
| 1444 | +
|
1419 | 1445 | /* Logo overlay */ |
1420 | 1446 | .logo-overlay { |
1421 | 1447 | position: fixed; |
|
0 commit comments