File tree Expand file tree Collapse file tree 2 files changed +49
-7
lines changed
src/frontend/src/pad/containers Expand file tree Collapse file tree 2 files changed +49
-7
lines changed Original file line number Diff line number Diff line change 66 overflow : hidden ;
77}
88
9+ .terminal-iframe-wrapper {
10+ position : relative ;
11+ flex : 1 ;
12+ height : 100% ;
13+ width : 100% ;
14+ overflow : hidden ;
15+ border-bottom-left-radius : var (--embeddable-radius );
16+ border-bottom-right-radius : var (--embeddable-radius );
17+ background-color : #000000 ;
18+ }
19+
920.terminal-iframe {
1021 flex : 1 ;
1122 background-color : #000000 ;
2233 justify-content : center ;
2334 position : relative ;
2435 }
36+
37+ & --loading-fade {
38+ opacity : 0 ;
39+ transition : opacity 0.5s ease-in ;
40+ }
41+
42+ & --loaded {
43+ opacity : 1 ;
44+ transition : opacity 0.5s ease-in ;
45+ }
2546}
2647
2748.terminal-loading-animation {
3152 display : flex ;
3253 align-items : center ;
3354 justify-content : center ;
55+
56+ & --fade {
57+ opacity : 1 ;
58+ transition : opacity 0.15s ease-out ;
59+ z-index : 1 ;
60+ background-color : #000000 ;
61+ }
62+
63+ & --hidden {
64+ opacity : 0 ;
65+ pointer-events : none ;
66+ }
3467}
3568
3669.terminal-loading-logo {
Original file line number Diff line number Diff line change @@ -179,7 +179,7 @@ export const Terminal: React.FC<TerminalProps> = ({
179179 // Set a small timeout to allow the scrolling to complete first
180180 const timer = setTimeout ( ( ) => {
181181 setShouldRenderIframe ( true ) ;
182- } , 500 ) ; // 300ms delay should be enough for the scroll animation to start
182+ } , 500 ) ;
183183
184184 return ( ) => clearTimeout ( timer ) ;
185185 } , [ ] ) ;
@@ -193,12 +193,21 @@ export const Terminal: React.FC<TerminalProps> = ({
193193 return (
194194 < div className = "terminal-container" >
195195 { shouldRenderIframe ? (
196- < iframe
197- className = "terminal-iframe"
198- src = { terminalUrl }
199- title = "Terminal"
200- onLoad = { handleIframeLoad }
201- />
196+ < div className = "terminal-iframe-wrapper" >
197+ < iframe
198+ className = { `terminal-iframe ${ iframeLoaded ? 'terminal-iframe--loaded' : 'terminal-iframe--loading-fade' } ` }
199+ src = { terminalUrl }
200+ title = "Terminal"
201+ onLoad = { handleIframeLoad }
202+ />
203+ < div className = { `terminal-loading-animation terminal-loading-animation--fade ${ iframeLoaded ? 'terminal-loading-animation--hidden' : '' } ` } >
204+ < img
205+ src = "/assets/images/favicon.png"
206+ alt = "pad.ws logo"
207+ className = "terminal-loading-logo"
208+ />
209+ </ div >
210+ </ div >
202211 ) : (
203212 < div className = "terminal-iframe terminal-iframe--loading" >
204213 < div className = "terminal-loading-animation" >
You can’t perform that action at this time.
0 commit comments