Skip to content

Commit

Permalink
Change fullscreen and panel setup
Browse files Browse the repository at this point in the history
  • Loading branch information
blokhin committed Jan 14, 2025
1 parent 349b488 commit b3c0323
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 16 deletions.
1 change: 1 addition & 0 deletions player/player.view.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ namespace $.$$ {
pointerEvents: 'none',
position: 'absolute',
zIndex: 1,
fontSize: '13px',
flex: {
direction: 'column',
},
Expand Down
6 changes: 2 additions & 4 deletions player/player.view.tree
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
$optimade_cifplayer_player $mol_view
data? null
externals? null
fullscreen? true
skip_panel? false
atom_radius_scale 0.6
zoom_scale_step 0.3
-
Expand Down Expand Up @@ -100,9 +102,6 @@ $optimade_cifplayer_player $mol_view
Icon <= Center_icon $mol_icon_image_filter_center_focus
<= Tools $mol_view
sub /
<= Fullscreen $mol_check
checked? <=> fullscreen? false
Icon <= Expand_icon $mol_icon_arrow_expand_all
<= Zoom_section $mol_list
sub /
<= Zoom_up $mol_button_minor
Expand All @@ -111,7 +110,6 @@ $optimade_cifplayer_player $mol_view
<= Zoom_down $mol_button_minor
click? <=> zoom_down? null
sub / <= Zoom_down_icon $mol_icon_magnify_minus_outline
^ lights_toggle / <= Lights $mol_lights_toggle
<= Overlays $mol_view
sub <= overlays_sub /
<= Switch_overlay $mol_switch
Expand Down
16 changes: 4 additions & 12 deletions player/player.view.web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,7 @@ namespace $.$$ {

@ $mol_mem
external_theme_auto() {
const external = this.externals()?.theme
if( !external ) return

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

@ $mol_mem
lights_toggle() {
return this.externals()?.theme ? [] : super.lights_toggle()
this.$.$mol_lights( true )
}

@ $mol_mem
Expand Down Expand Up @@ -136,7 +128,7 @@ namespace $.$$ {
canvas.width = metrics.width * 3.5
canvas.height = 30

context.font = "italic 28px sans-serif"
context.font = "28px sans-serif"
context.textAlign = "center"
context.textBaseline = "middle"
context.fillStyle = this.$.$mol_lights() ? "#000" : "#fff"
Expand Down Expand Up @@ -508,7 +500,7 @@ namespace $.$$ {
atoms.forEach( ( atom: InstanceType< THREE["Object3D"] >, i: number ) => {
const start = atom.position.toArray()
const [ x, y, z ] = phonon[ i ].map( ( v, i ) => start[ i ] + v * phonon_amp )

this.tweens.add( new TWEEN.Tween( atom.position ).to( { x, y, z }, 750 )
.easing( TWEEN.Easing.Cubic.InOut ).repeat( Infinity ).yoyo( true ).start()
)
Expand Down Expand Up @@ -578,7 +570,7 @@ namespace $.$$ {
@ $mol_mem
left_panel(): readonly any[] {

if (this.externals()?.skip_panel) return []
if (this.skip_panel()) return []

try {
this.structure_3d_data()
Expand Down

0 comments on commit b3c0323

Please sign in to comment.