File tree Expand file tree Collapse file tree 5 files changed +65
-17
lines changed Expand file tree Collapse file tree 5 files changed +65
-17
lines changed Original file line number Diff line number Diff line change 12
12
< div class ="model-preview ">
13
13
< canvas class ="webgl ">
14
14
</ canvas >
15
- < img id ="fidget-toy " src ="../images/about/arrow_purple.svg " style ="position: absolute; left: 190px; top: 300px; ">
15
+ < img id ="fidget-toy-arrow " src ="../images/about/arrow_purple.svg " style ="position: absolute; left: 190px; top: 300px; ">
16
+ < h1 id ="fidget-toy-text " class ="fidget-toy ">
17
+ fidget< br >
18
+ toy
19
+ </ h1 >
16
20
</ img >
17
- < h1 class ="fidget-toy ">
18
- fidget< br >
19
- toy
20
- </ h1 >
21
21
</ div >
22
22
< div class ="padding logo-wrapper ">
23
23
< logo >
Original file line number Diff line number Diff line change @@ -4,7 +4,9 @@ import { PortfolioItem } from '../src/PortfolioItem.js';
4
4
// Model previewer
5
5
import { ModelPreviewer } from '../src/ModelPreviewer.js' ;
6
6
7
-
7
+ let fidgettoytext = document . getElementById ( "fidget-toy-text" ) ;
8
+ let fidgettoyarrow = document . getElementById ( "fidget-toy-arrow" ) ;
9
+ let preview = document . querySelector ( '.model-preview' ) ;
8
10
let portfolioItems = [ ] ;
9
11
10
12
portfolioItems . push (
@@ -24,5 +26,26 @@ Promise.all(promises).then(() => {
24
26
// Dark mode
25
27
const userPrefersDark = window . matchMedia && window . matchMedia ( '(prefers-color-scheme: dark)' ) . matches ;
26
28
if ( userPrefersDark ) {
27
- document . getElementById ( "fidget-toy" ) . src = "/images/about/arrow.svg" ;
29
+ fidgettoyarrow . src = "/images/about/arrow.svg" ;
30
+ }
31
+
32
+ Update ( ) ;
33
+
34
+ function Update ( ) {
35
+ requestAnimationFrame ( ( ) => Update ( ) ) ; // Only update when tab open
36
+
37
+ const isHidden = preview . style . width == `0px` ;
38
+ fidgettoytext . hidden = isHidden ;
39
+ fidgettoyarrow . hidden = isHidden ;
40
+ }
41
+
42
+ /*
43
+ window.addEventListener('resize', onWindowResize);
44
+ onWindowResize();
45
+
46
+ function onWindowResize() {
47
+ if (!shouldDisplayPreview()) {
48
+ fidgettoy.hidden = false;
49
+ }
28
50
}
51
+ */
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ class ObjectPicker {
58
58
}
59
59
}
60
60
61
- function shouldDisplayPreview ( ) {
61
+ export function shouldDisplayPreview ( ) {
62
62
return ( ( window . innerWidth || document . documentElement . clientWidth || document . body . clientWidth ) > 800 &&
63
63
( ( window . innerHeight || document . documentElement . clientHeight || document . body . clientHeight ) - 241 - 65 ) >= 386 ) ;
64
64
}
Original file line number Diff line number Diff line change @@ -915,11 +915,12 @@ overlay {
915
915
.fidget-toy
916
916
{
917
917
position : absolute;
918
- left : 275 px ;
919
- top : 298 px ;
920
- font-size : 20 px ;
918
+ left : 265 px ;
919
+ top : 288 px ;
920
+ font-size : 24 px ;
921
921
color : # f8cda8 ;
922
922
transform : rotate (-10deg );
923
+ font-family : 'Gloria Hallelujah' ;
923
924
}
924
925
925
926
/* Dark Mode */
You can’t perform that action at this time.
0 commit comments