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 20
20
height : 20px ;
21
21
margin-top : 2px ;
22
22
margin-right : 2px ;
23
- border-radius : 10px ;
23
+ border-radius : 2px ;
24
+ box-shadow : 1px 1px 1px #000000aa ;
24
25
}
25
26
</style >
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ import './mods/variantPreviewCubeFaceMod'
45
45
import './mods/showDefaultPoseMod'
46
46
import './mods/addLocatorActionMod'
47
47
import './mods/blockbenchReadMod'
48
+ import './mods/formatIconMod'
48
49
// Outliner
49
50
import './outliner/textDisplay'
50
51
import './outliner/vanillaItemDisplay'
Original file line number Diff line number Diff line change @@ -18,8 +18,9 @@ function createIconImg() {
18
18
Object . assign ( IMG . style , {
19
19
position : 'relative' ,
20
20
top : '2px' ,
21
- borderRadius : '8px ' ,
21
+ borderRadius : '2px ' ,
22
22
marginRight : '6px' ,
23
+ boxShadow : '1px 1px 1px #000000aa' ,
23
24
} )
24
25
return IMG
25
26
}
@@ -37,6 +38,9 @@ BLOCKBENCH_MENU_BAR.appendChild(MENU.label)
37
38
events . SELECT_PROJECT . subscribe ( project => {
38
39
MENU . label . style . display = project . format === BLUEPRINT_FORMAT ? 'inline-block' : 'none'
39
40
} )
41
+ events . UNSELECT_AJ_PROJECT . subscribe ( ( ) => {
42
+ MENU . label . style . display = 'none'
43
+ } )
40
44
41
45
MenuBar . addAction (
42
46
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