|
12 | 12 | import tippy from "svelte-tippy"; |
13 | 13 | import { flip } from "svelte/animate"; |
14 | 14 | import { cubicInOut } from "svelte/easing"; |
15 | | - import { fade, fly } from "svelte/transition"; |
| 15 | + import { fade, fly, scale } from "svelte/transition"; |
16 | 16 | import type { PlaylistFile, Song } from "../../App"; |
17 | 17 | import { |
18 | 18 | addSongsToPlaylist, |
|
1859 | 1859 | </div> |
1860 | 1860 | </div> |
1861 | 1861 | <div class="bottom" data-tauri-drag-region> |
1862 | | - {#if song} |
1863 | | - <div |
1864 | | - class="artwork-container" |
1865 | | - class:collapsed={$isArtworkCollapsed && !$isMiniPlayer} |
1866 | | - class:disabled={$isMiniPlayer} |
1867 | | - on:click={() => { |
1868 | | - if (!$isMiniPlayer) { |
1869 | | - $isArtworkCollapsed = !$isArtworkCollapsed; |
1870 | | - } |
1871 | | - }} |
1872 | | - > |
1873 | | - <div class="artwork-frame"> |
1874 | | - <canvas |
1875 | | - class="artwork" |
1876 | | - bind:this={artworkCanvas} |
1877 | | - width={210} |
1878 | | - height={210} |
1879 | | - /> |
1880 | | - </div> |
1881 | | - </div> |
1882 | | - {/if} |
1883 | 1862 | <div class="transport"> |
1884 | 1863 | <Seekbar |
1885 | 1864 | {duration} |
|
1975 | 1954 | </div> |
1976 | 1955 | </div> |
1977 | 1956 | </div> |
| 1957 | + {#if song} |
| 1958 | + <div |
| 1959 | + class="artwork-container" |
| 1960 | + class:collapsed={$isArtworkCollapsed && !$isMiniPlayer} |
| 1961 | + class:disabled={$isMiniPlayer} |
| 1962 | + on:click={() => { |
| 1963 | + if (!$isMiniPlayer) { |
| 1964 | + $isArtworkCollapsed = !$isArtworkCollapsed; |
| 1965 | + } |
| 1966 | + }} |
| 1967 | + > |
| 1968 | + <div class="artwork-frame"> |
| 1969 | + <canvas |
| 1970 | + class="artwork" |
| 1971 | + bind:this={artworkCanvas} |
| 1972 | + width={210} |
| 1973 | + height={210} |
| 1974 | + /> |
| 1975 | + </div> |
| 1976 | + </div> |
| 1977 | + {/if} |
1978 | 1978 | {/if} |
1979 | 1979 | </sidebar> |
1980 | 1980 |
|
|
1986 | 1986 | $track_info_artwork_margin: 5px; |
1987 | 1987 | $artwork_bottom: 143px; |
1988 | 1988 | $bottom_height: 340px; |
| 1989 | + $bottom_height_collapsed: 100px; |
1989 | 1990 |
|
1990 | 1991 | :global { |
1991 | 1992 | sidebar { |
|
2045 | 2046 | max-width: 210px; |
2046 | 2047 | min-width: 210px; |
2047 | 2048 | background-color: $sidebar_primary_color; |
| 2049 | + transition: grid-template-rows 0.3s cubic-bezier(0.075, 0.82, 0.165, 1); |
2048 | 2050 |
|
2049 | 2051 | .click-curtain { |
2050 | 2052 | position: fixed; |
|
2584 | 2586 | } |
2585 | 2587 | } |
2586 | 2588 |
|
| 2589 | + .artwork-spacer { |
| 2590 | + width: 210px; |
| 2591 | + &.show { |
| 2592 | + animation: in 0.2s ease-in-out forwards; |
| 2593 | + } |
| 2594 | +
|
| 2595 | + &.hide { |
| 2596 | + animation: out 0.2s ease-in-out forwards; |
| 2597 | + } |
| 2598 | +
|
| 2599 | + @keyframes in { |
| 2600 | + from { |
| 2601 | + min-height: 0px; |
| 2602 | + } |
| 2603 | + to { |
| 2604 | + min-height: 210px; |
| 2605 | + } |
| 2606 | + } |
| 2607 | + @keyframes out { |
| 2608 | + from { |
| 2609 | + min-height: 210px; |
| 2610 | + } |
| 2611 | + to { |
| 2612 | + min-height: 100px; |
| 2613 | + } |
| 2614 | + } |
| 2615 | + } |
| 2616 | +
|
2587 | 2617 | .artwork-container { |
| 2618 | + position: absolute; |
| 2619 | + bottom: 135px; |
2588 | 2620 | padding: 0em; |
2589 | | - width: 100%; |
| 2621 | + width: 210px; |
| 2622 | + margin: auto; |
| 2623 | + left: 0; |
| 2624 | + right: 0; |
2590 | 2625 | height: auto; |
2591 | | - position: relative; |
2592 | 2626 | opacity: 1; |
2593 | 2627 | box-sizing: content-box; |
2594 | | - z-index: 1; |
| 2628 | + z-index: 5; |
2595 | 2629 | cursor: zoom-out; |
| 2630 | + transition: all 0.2s cubic-bezier(0.2, 0.05, 0.02, 0.99); |
2596 | 2631 | &.collapsed { |
2597 | | - bottom: 120px; |
| 2632 | + bottom: 268px; |
2598 | 2633 | height: 80px; |
| 2634 | + left: 0; |
| 2635 | + right: 0; |
2599 | 2636 | width: 80px; |
2600 | 2637 | margin: auto; |
2601 | 2638 | cursor: zoom-in; |
2602 | | - z-index: 4; |
| 2639 | + z-index: 3; |
2603 | 2640 | .artwork-frame { |
2604 | | - transition: all 0.2s cubic-bezier(0.2, 0.01, 0.02, 0.99); |
2605 | | -
|
2606 | | - border-radius: 3px; |
2607 | | - border: 2px solid var(--panel-separator); |
| 2641 | + border-radius: 3px 3px 0px 0px; |
| 2642 | + border-top: 1px solid var(--panel-separator); |
| 2643 | + border-left: 1px solid var(--panel-separator); |
| 2644 | + border-right: 1px solid var(--panel-separator); |
2608 | 2645 | padding: 2px; |
2609 | 2646 | overflow: hidden; |
2610 | 2647 | background-color: var(--background); |
|
2864 | 2901 |
|
2865 | 2902 | .has-current-song { |
2866 | 2903 | &.artwork-collapsed { |
| 2904 | + grid-template-rows: 1fr auto $bottom_height_collapsed; |
| 2905 | + .track-info { |
| 2906 | + z-index: 4; |
| 2907 | + padding-bottom: 5px; |
| 2908 | + border-bottom: 0.7px solid var(--panel-separator); |
| 2909 | + box-shadow: 0px -16px 20px 0px rgba(0, 0, 0, 0.15); |
| 2910 | + .noise { |
| 2911 | + backdrop-filter: blur(4px); |
| 2912 | + background-color: color-mix( |
| 2913 | + in srgb, |
| 2914 | + var(--overlay-bg) 60%, |
| 2915 | + transparent |
| 2916 | + ); |
| 2917 | + } |
| 2918 | + } |
| 2919 | + .bottom { |
| 2920 | + z-index: 5; |
| 2921 | + } |
2867 | 2922 | @media only screen and (min-height: 650px) { |
2868 | 2923 | grid-template-rows: 1fr auto 135px; |
2869 | 2924 | } |
|
0 commit comments