Skip to content

Commit

Permalink
Use a standard term
Browse files Browse the repository at this point in the history
  • Loading branch information
blokhin committed Jul 10, 2024
1 parent 7337f77 commit 2f547c3
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 46 deletions.
8 changes: 4 additions & 4 deletions player/player.view.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,22 @@ namespace $.$$ {
color: $mol_style_func.vary('--color_c')
},

Spread_label_a: {
Translate_label_a: {
color: $mol_style_func.vary('--color_a'),
padding: $mol_gap.text,
},

Spread_label_b: {
Translate_label_b: {
color: $mol_style_func.vary('--color_b'),
padding: $mol_gap.text,
},

Spread_label_c: {
Translate_label_c: {
color: $mol_style_func.vary('--color_c'),
padding: $mol_gap.text,
},

Spread_cells: {
Translate_cells: {
pointerEvents: 'auto',
Bubble: {
display: 'grid',
Expand Down
38 changes: 19 additions & 19 deletions player/player.view.tree
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ $optimade_cifplayer_player $mol_view
zoom_scale_step 0.3
vibrate? null
unvibrate null
spread_cells /
<= spread_a? 1
<= spread_b? 1
<= spread_c? 1
spread_cells_limit 50
translate_cells /
<= translate_a? 1
<= translate_b? 1
<= translate_c? 1
translate_cells_limit 50
-
plugins /
<= Theme $mol_theme_auto
Expand Down Expand Up @@ -64,31 +64,31 @@ $optimade_cifplayer_player $mol_view
<= Sym_check*0 $mol_check_box
title <= sym_name* \
checked? <=> symmetry_visible*? false
<= Spread_cells $mol_pick
<= Translate_cells $mol_pick
trigger_content /
<= spread_cell_label \1×1×1
<= translate_cell_label \1×1×1
bubble_content /
<= Spread_label_a $mol_paragraph
<= Translate_label_a $mol_paragraph
title \a
<= Spread_a $mol_number
value? <=> spread_a?
<= Translate_a $mol_number
value? <=> translate_a?
hint \1
value_min 1
value_max <= spread_limit_a 1
<= Spread_label_b $mol_paragraph
value_max <= translate_limit_a 1
<= Translate_label_b $mol_paragraph
title \b
<= Spread_b $mol_number
value? <=> spread_b?
<= Translate_b $mol_number
value? <=> translate_b?
hint \1
value_min 1
value_max <= spread_limit_b 1
<= Spread_label_c $mol_paragraph
value_max <= translate_limit_b 1
<= Translate_label_c $mol_paragraph
title \c
<= Spread_c $mol_number
value? <=> spread_c?
<= Translate_c $mol_number
value? <=> translate_c?
hint \1
value_min 1
value_max <= spread_limit_c 1
value_max <= translate_limit_c 1
<= Center $mol_check_icon
checked? <=> centered? true
Icon <= Center_icon $mol_icon_image_filter_center_focus
Expand Down
46 changes: 23 additions & 23 deletions player/player.view.web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace $.$$ {

this.$.$mol_lights( external == 'light' ? true : false )
}

@ $mol_mem
lights_toggle() {
return this.externals()?.theme ? [] : super.lights_toggle()
Expand Down Expand Up @@ -317,11 +317,11 @@ namespace $.$$ {
cell_translations() {
const translations: [ number, number, number ][] = []

const [ spread_a, spread_b, spread_c ] = this.spread_cells()
const [ translate_a, translate_b, translate_c ] = this.translate_cells()

for( let a = 0; a < spread_a; a++ ) {
for( let b = 0; b < spread_b; b++ ) {
for( let c = 0; c < spread_c; c++ ) {
for( let a = 0; a < translate_a; a++ ) {
for( let b = 0; b < translate_b; b++ ) {
for( let c = 0; c < translate_c; c++ ) {
translations.push( [ a, b, c ] )
}
}
Expand All @@ -343,9 +343,9 @@ namespace $.$$ {
this.overlay_boxes().forEach( box => {

box.children.forEach( ( label: InstanceType< THREE["Object3D"] >, i: number ) => {

label.children.forEach( ( sprite: InstanceType< THREE["Object3D"] > ) => label.remove( sprite ) )

if( overlay ) {
const sprite = this.create_sprite( String( atom_datas[ i ].overlays[ overlay ] ) )
label.add( sprite )
Expand All @@ -368,7 +368,7 @@ namespace $.$$ {

return overlay_box
}

@ $mol_mem
overlay_boxes() {
return [ this.overlay_box( [0,0,0] ) ]
Expand Down Expand Up @@ -554,35 +554,35 @@ namespace $.$$ {
}

@ $mol_mem
spread_cells() {
translate_cells() {
return [
this.spread_a() || 1,
this.spread_b() || 1,
this.spread_c() || 1,
this.translate_a() || 1,
this.translate_b() || 1,
this.translate_c() || 1,
]
}

@ $mol_mem
spread_cell_label() {
return this.spread_cells().join('×')
translate_cell_label() {
return this.translate_cells().join('×')
}

@ $mol_mem
spread_limit_a() {
const [ a, b, c ] = this.spread_cells()
return Math.floor( this.spread_cells_limit() / ( b * c ) )
translate_limit_a() {
const [ a, b, c ] = this.translate_cells()
return Math.floor( this.translate_cells_limit() / ( b * c ) )
}

@ $mol_mem
spread_limit_b() {
const [ a, b, c ] = this.spread_cells()
return Math.floor( this.spread_cells_limit() / ( a * c ) )
translate_limit_b() {
const [ a, b, c ] = this.translate_cells()
return Math.floor( this.translate_cells_limit() / ( a * c ) )
}

@ $mol_mem
spread_limit_c() {
const [ a, b, c ] = this.spread_cells()
return Math.floor( this.spread_cells_limit() / ( a * b ) )
translate_limit_c() {
const [ a, b, c ] = this.translate_cells()
return Math.floor( this.translate_cells_limit() / ( a * b ) )
}

}
Expand Down

0 comments on commit 2f547c3

Please sign in to comment.