From 19a028eb9b84d602a92a8278e28b364079fb6cab Mon Sep 17 00:00:00 2001 From: stan-donarise Date: Sun, 19 Jan 2025 22:27:34 +0300 Subject: [PATCH 1/4] textarea font inherit --- app/app.view.css.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/app.view.css.ts b/app/app.view.css.ts index d4ad490..363512e 100644 --- a/app/app.view.css.ts +++ b/app/app.view.css.ts @@ -45,6 +45,12 @@ namespace $.$$ { }, }, + Data_text: { + font: { + family: 'inherit', + }, + }, + Body: { flex: { direction: 'column', From 67bb59032359c6f6a4df4d05f668515ab058a4e0 Mon Sep 17 00:00:00 2001 From: stan-donarise Date: Sun, 19 Jan 2025 22:28:45 +0300 Subject: [PATCH 2/4] hide $mol_pick on three_view click #51 --- lib/three/view/view.view.tree | 2 ++ lib/three/view/view.view.web.ts | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/lib/three/view/view.view.tree b/lib/three/view/view.view.tree index 61837e6..1931daa 100644 --- a/lib/three/view/view.view.tree +++ b/lib/three/view/view.view.tree @@ -12,3 +12,5 @@ $optimade_cifplayer_lib_three_view $mol_view <= controls_target_changed null <= resize null <= start_render_loop null + event * + pointerdown? <=> pointerdown? null diff --git a/lib/three/view/view.view.web.ts b/lib/three/view/view.view.web.ts index 9cedaa8..38f26ca 100644 --- a/lib/three/view/view.view.web.ts +++ b/lib/three/view/view.view.web.ts @@ -129,6 +129,10 @@ namespace $.$$ { this.renderer()?.dispose() } + pointerdown() { + this.focused( true ) + } + } From fce9962c93880a7ece25c0f2970bf072edcb826f Mon Sep 17 00:00:00 2001 From: stan-donarise Date: Sun, 19 Jan 2025 22:40:26 +0300 Subject: [PATCH 3/4] files renaming --- app/{app.view.tree => app.web.view.tree} | 2 ++ app/{app.view.web.ts => app.web.view.ts} | 0 player/{player.view.tree => player.web.view.tree} | 2 +- player/{player.view.web.ts => player.web.view.ts} | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) rename app/{app.view.tree => app.web.view.tree} (95%) rename app/{app.view.web.ts => app.web.view.ts} (100%) rename player/{player.view.tree => player.web.view.tree} (99%) rename player/{player.view.web.ts => player.web.view.ts} (99%) diff --git a/app/app.view.tree b/app/app.web.view.tree similarity index 95% rename from app/app.view.tree rename to app/app.web.view.tree index 55cd4dc..5742551 100644 --- a/app/app.view.tree +++ b/app/app.web.view.tree @@ -29,6 +29,8 @@ $optimade_cifplayer_app $mol_drop data <= data_str? \ vibrate? => vibrate? unvibrate => unvibrate + fullscreen false + light_theme_auto null Start $mol_view sub / <= Start_message $mol_text diff --git a/app/app.view.web.ts b/app/app.web.view.ts similarity index 100% rename from app/app.view.web.ts rename to app/app.web.view.ts diff --git a/player/player.view.tree b/player/player.web.view.tree similarity index 99% rename from player/player.view.tree rename to player/player.web.view.tree index 01ffa2b..1fbeace 100644 --- a/player/player.view.tree +++ b/player/player.web.view.tree @@ -20,7 +20,7 @@ $optimade_cifplayer_player $mol_view <= Theme $mol_theme_auto - auto / - <= external_theme_auto null + <= light_theme_auto null <= dir_light null <= ambient_light null ^ atom_boxes / diff --git a/player/player.view.web.ts b/player/player.web.view.ts similarity index 99% rename from player/player.view.web.ts rename to player/player.web.view.ts index a235d5e..ef5bd4d 100644 --- a/player/player.view.web.ts +++ b/player/player.web.view.ts @@ -11,7 +11,7 @@ namespace $.$$ { export class $optimade_cifplayer_player extends $.$optimade_cifplayer_player { @ $mol_mem - external_theme_auto() { + light_theme_auto() { this.$.$mol_lights( true ) } From a8eaf26c7b1dfc6de3c4bebf1ac3551920cd496d Mon Sep 17 00:00:00 2001 From: stan-donarise Date: Sun, 19 Jan 2025 22:56:01 +0300 Subject: [PATCH 4/4] center camera based on translations #50 --- player/player.web.view.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/player/player.web.view.ts b/player/player.web.view.ts index ef5bd4d..7d1f7f7 100644 --- a/player/player.web.view.ts +++ b/player/player.web.view.ts @@ -157,18 +157,20 @@ namespace $.$$ { @ $mol_mem controls_target() { - const cell_center = this.cell_center() + let cell_center = this.cell_center() if( !cell_center ) { const atoms = this.structure_3d_data().atoms - return atoms.reduce(( acc: InstanceType< THREE["Vector3"] >, atom ) => { + cell_center = atoms.reduce(( acc: InstanceType< THREE["Vector3"] >, atom ) => { const { x, y, z } = atom return acc.add( new THREE.Vector3( x, y, z ) ) }, new THREE.Vector3() ).divideScalar( atoms.length ) } - return this.centered() ? cell_center.clone() : new THREE.Vector3() + const [ a, b, c ] = this.translate_cells() + + return this.centered() ? cell_center.clone().multiply( new THREE.Vector3( a, b, c ) ) : new THREE.Vector3() } @ $mol_mem