@@ -11,6 +11,9 @@ import { createDelegate } from "dreamland/core";
1111import type { Tab } from "../Tab" ;
1212import { UrlInput } from "./UrlInput" ;
1313import { browser } from "../Browser" ;
14+ import { Icon } from "./Icon" ;
15+
16+ export const animateDownloadFly = createDelegate < void > ( ) ;
1417
1518export const Spacer : Component = function ( cx ) {
1619 return < div > </ div > ;
@@ -116,6 +119,20 @@ export const Omnibox: Component<{
116119 ] ) ;
117120 } ;
118121
122+ animateDownloadFly . listen ( ( ) => {
123+ let fly : HTMLElement = cx . root . querySelector ( ".downloadfly" ) ! ;
124+ fly . addEventListener (
125+ "transitionend" ,
126+ ( ) => {
127+ fly . style . opacity = "0" ;
128+ fly . classList . add ( "down" ) ;
129+ } ,
130+ { once : true }
131+ ) ;
132+ fly . style . opacity = "1" ;
133+ fly . classList . remove ( "down" ) ;
134+ } ) ;
135+
119136 const historyMenu = ( e : MouseEvent ) => {
120137 if ( browser . activetab . history . states . length > 1 ) {
121138 createMenu (
@@ -171,6 +188,9 @@ export const Omnibox: Component<{
171188 } }
172189 icon = { iconDownload }
173190 > </ IconButton >
191+ < div class = "downloadfly down" >
192+ < Icon icon = { iconDownload } > </ Icon >
193+ </ div >
174194 < CircularProgress
175195 progress = { use ( browser . downloadProgress ) }
176196 > </ CircularProgress >
@@ -228,4 +248,37 @@ Omnibox.style = css`
228248 position : relative;
229249 gap : 0.2em ;
230250 }
251+
252+ .downloadfly {
253+ position : absolute;
254+ top : 0 ;
255+ box-sizing : border-box;
256+ aspect-ratio : 1 / 1 ;
257+ align-items : center;
258+ justify-content : center;
259+ width : 100% ;
260+
261+ display : flex;
262+ outline : none;
263+ border : none;
264+ font-size : 1.25em ;
265+ background : none;
266+ color : var (--fg );
267+ border-radius : 0.2em ;
268+
269+ transition : top 0.5s ease;
270+ }
271+ .downloadfly .down {
272+ top : 100vh ;
273+ }
274+ .downloadfly ::before {
275+ position : absolute;
276+ content : "" ;
277+ z-index : -1 ;
278+ height : 2em ;
279+ width : 2em ;
280+ border-radius : 50% ;
281+ opacity : 0.5 ;
282+ background : var (--bg20 );
283+ }
231284` ;
0 commit comments