File tree Expand file tree Collapse file tree 5 files changed +52
-2
lines changed Expand file tree Collapse file tree 5 files changed +52
-2
lines changed Original file line number Diff line number Diff line change 1+ <script lang =" ts" context =" module" >
2+ import { onDestroy } from ' svelte'
3+ import AnimatedJavaIcon from ' ../assets/animated_java_icon.svg'
4+ </script >
5+
6+ <script lang =" ts" >
7+ let selected = false
8+
9+ const parent = document .querySelector (' [format=animated_java_blueprint]' )!
10+ const interval = setInterval (() => {
11+ selected = parent .classList .contains (' selected' )
12+ }, 16 )
13+
14+ onDestroy (() => {
15+ clearInterval (interval )
16+ })
17+ </script >
18+
19+ <span class =" icon_wrapper f_left" >
20+ <img src ={AnimatedJavaIcon } alt =" " />
21+ </span >
22+
23+ <style >
24+ img {
25+ border-radius : 4px ;
26+ width : 24px ;
27+ height : 24px ;
28+ margin-left : 0.5px ;
29+ margin-top : 2px ;
30+ box-shadow : 1px 1px 1px #000000aa ;
31+ }
32+ </style >
Original file line number Diff line number Diff line change 2020 height : 20px ;
2121 margin-top : 2px ;
2222 margin-right : 2px ;
23- border-radius : 10px ;
23+ border-radius : 2px ;
24+ box-shadow : 1px 1px 1px #000000aa ;
2425 }
2526 </style >
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ import './mods/variantPreviewCubeFaceMod'
4545import './mods/showDefaultPoseMod'
4646import './mods/addLocatorActionMod'
4747import './mods/blockbenchReadMod'
48+ import './mods/formatIconMod'
4849// Outliner
4950import './outliner/textDisplay'
5051import './outliner/vanillaItemDisplay'
Original file line number Diff line number Diff line change @@ -18,8 +18,9 @@ function createIconImg() {
1818 Object . assign ( IMG . style , {
1919 position : 'relative' ,
2020 top : '2px' ,
21- borderRadius : '8px ' ,
21+ borderRadius : '2px ' ,
2222 marginRight : '6px' ,
23+ boxShadow : '1px 1px 1px #000000aa' ,
2324 } )
2425 return IMG
2526}
@@ -37,6 +38,9 @@ BLOCKBENCH_MENU_BAR.appendChild(MENU.label)
3738events . SELECT_PROJECT . subscribe ( project => {
3839 MENU . label . style . display = project . format === BLUEPRINT_FORMAT ? 'inline-block' : 'none'
3940} )
41+ events . UNSELECT_AJ_PROJECT . subscribe ( ( ) => {
42+ MENU . label . style . display = 'none'
43+ } )
4044
4145MenuBar . addAction (
4246 createAction ( `${ PACKAGE . name } :about` , {
Original file line number Diff line number Diff line change 1+ import Icon from '../components/icon.svelte'
2+ import { injectSvelteCompomponent } from '../util/injectSvelte'
3+
4+ void injectSvelteCompomponent ( {
5+ elementSelector : ( ) => document . querySelector ( '[format=animated_java_blueprint]' ) ,
6+ svelteComponent : Icon ,
7+ svelteComponentProperties : { } ,
8+ prepend : true ,
9+ postMount : ( ) => {
10+ document . querySelector ( '[format=animated_java_blueprint] span i' ) ?. parentElement ?. remove ( )
11+ } ,
12+ } )
You can’t perform that action at this time.
0 commit comments