diff --git a/app/app.view.tree b/app/app.view.tree index e6fa209..cb97206 100644 --- a/app/app.view.tree +++ b/app/app.view.tree @@ -64,6 +64,7 @@ $optimade_tmdne_app $mol_view click? <=> click_yes? null ^ cards / <= Card* $optimade_tmdne_card name <= card_name* \ + json_link <=> card_link* \ loaded <= card_loaded* false why? <=> why*? \ pointer_holding? <=> card_holding? false diff --git a/app/app.view.ts b/app/app.view.ts index a4b1b9c..bee3279 100644 --- a/app/app.view.ts +++ b/app/app.view.ts @@ -39,10 +39,18 @@ namespace $.$$ { return formula_html( str ) } + @ $mol_mem_key + card_link( n: number ) { + let link = this.fetch_by_number( n )?.data[ 0 ]?.attributes?._gnome_material_id + return `https://optimade-gnome.odbx.science/v1/structures/data/gnome_data/by_id.zip/data/gnome_data/by_id/${link}.CIF` + } + + @ $mol_mem_key card_loaded( n: number ) { try { this.card_name( n ) + this.card_link( n ) return this.number() === n } catch (error) { if( $mol_promise_like( error ) ) return false diff --git a/card/card.view.css.ts b/card/card.view.css.ts index 0fb9d55..8e16488 100644 --- a/card/card.view.css.ts +++ b/card/card.view.css.ts @@ -81,6 +81,16 @@ namespace $.$$ { weight: 700, size: '1.5rem', }, + pointerEvents: 'auto', + }, + + Name_content:{ + flex:{ + direction: 'row' + }, + justify: { + content: 'center', + }, }, Question: { diff --git a/card/card.view.tree b/card/card.view.tree index fecfe84..415f4ff 100644 --- a/card/card.view.tree +++ b/card/card.view.tree @@ -8,9 +8,12 @@ $optimade_tmdne_card $optimade_tmdne_swipe attr * card_position <= card_position \ sub / - <= Name $mol_html_view - minimal_height 22 - html <= name \ + <= Name $mol_link + uri <= json_link \ + sub / + <= Name_content $mol_html_view + minimal_height 22 + html <= name \ <= Question $mol_paragraph title \Do you think it's synthesizable? <= Why_label $mol_view