forked from ml-evs/this-material-does-not-exist
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from stan-donarise/main
Get rid of unnecessary server side and rewrite in $mol
- Loading branch information
Showing
23 changed files
with
746 additions
and
463 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* -text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: build demo | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- uses: hyoo-ru/mam_build@master2 | ||
with: | ||
package: optimade/tmdne | ||
modules: app | ||
|
||
- uses: JamesIves/github-pages-deploy-action@4.1.7 | ||
with: | ||
branch: gh-pages | ||
folder: optimade/tmdne/app/- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-* |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 Matthew Evans | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
MIT License | ||
Copyright (c) 2023 Matthew Evans | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
<h1 align="center">💎 <a href="thismaterialdoesnotexist.com">this-material-does-not-exist</a> 💎</h1> | ||
|
||
Get given random crystal structures predicted by ML materials discovery projects, and vote on whether you think it should be synthesizable (or, at least, whether it is worth trying!) | ||
|
||
Currently uses [crystaltoolkit](https://docs.crystaltoolkit.org) and data from the | ||
[OPTIMADE API](https://optimade.org) for the recent [Google DeepMind | ||
paper](https://github.com/google-deepmind/materials_discovery). | ||
|
||
![2023-12-10-001838_1095x878_scrot](https://github.com/ml-evs/this-material-does-not-exist/assets/7916000/678ba7ec-d929-438e-8637-3dad5bf26493) | ||
<h1 align="center">💎 <a href="thismaterialdoesnotexist.com">this-material-does-not-exist</a> 💎</h1> | ||
|
||
Get given random crystal structures predicted by ML materials discovery projects, and vote on whether you think it should be synthesizable (or, at least, whether it is worth trying!) | ||
|
||
Currently uses [crystaltoolkit](https://docs.crystaltoolkit.org) and data from the | ||
[OPTIMADE API](https://optimade.org) for the recent [Google DeepMind | ||
paper](https://github.com/google-deepmind/materials_discovery). | ||
|
||
![2023-12-10-001838_1095x878_scrot](https://github.com/ml-evs/this-material-does-not-exist/assets/7916000/678ba7ec-d929-438e-8637-3dad5bf26493) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
namespace $.$$ { | ||
|
||
$mol_style_define( $optimade_tmdne_app, { | ||
|
||
overflow: 'hidden', | ||
flex: { | ||
direction: 'column', | ||
}, | ||
align: { | ||
items: 'center', | ||
}, | ||
|
||
Player: { | ||
flex: { | ||
grow: 1, | ||
}, | ||
width: '100%', | ||
opacity: 1, | ||
transition: 'opacity 0.15s', | ||
'[card_holding]': { | ||
'true': { | ||
opacity: 0.1, | ||
}, | ||
}, | ||
}, | ||
|
||
Head_space: { | ||
position: 'absolute', | ||
top: $mol_gap.block, | ||
left: 0, | ||
right: 0, | ||
flex: { | ||
grow: 1, | ||
}, | ||
pointerEvents: 'none', | ||
}, | ||
|
||
Head_card: { | ||
pointerEvents: 'auto', | ||
margin: 'auto', | ||
}, | ||
|
||
Head_title: { | ||
userSelect: 'none', | ||
justify: { | ||
content: 'center', | ||
}, | ||
}, | ||
|
||
Prediction: { | ||
userSelect: 'none', | ||
font: { | ||
size: '0.7rem', | ||
}, | ||
lineHeight: '16px', | ||
flex: { | ||
grow: 0, | ||
wrap: 'wrap', | ||
}, | ||
position: 'absolute', | ||
left: $mol_gap.block, | ||
bottom: '11rem', | ||
pointerEvents: 'none', | ||
opacity: 1, | ||
transition: 'opacity 0.15s', | ||
'[rotating]': { | ||
'true': { | ||
opacity: 0, | ||
}, | ||
}, | ||
}, | ||
|
||
Param: { | ||
gap: '0.3rem', | ||
flex: { | ||
wrap: 'wrap', | ||
}, | ||
}, | ||
|
||
Param_name: { | ||
font: { | ||
weight: 700, | ||
}, | ||
}, | ||
|
||
Param_symbol_html: { | ||
flex: { | ||
direction: 'row', | ||
}, | ||
}, | ||
|
||
Param_unit: { | ||
flex: { | ||
direction: 'row', | ||
}, | ||
}, | ||
|
||
Param_mae_unit: { | ||
flex: { | ||
direction: 'row', | ||
}, | ||
}, | ||
|
||
Param_value: { | ||
gap: '0.25rem', | ||
}, | ||
|
||
Foot: { | ||
justify: { | ||
content: 'space-between', | ||
}, | ||
width: '24rem', | ||
position: 'absolute', | ||
bottom: '4rem', | ||
|
||
pointerEvents: 'none', | ||
transition: 'opacity 0.2s', | ||
opacity: 1, | ||
'[rotating]': { | ||
'true': { | ||
opacity: 0, | ||
}, | ||
}, | ||
}, | ||
|
||
Hint_no: { | ||
pointerEvents: 'auto', | ||
color: '#ff6666', | ||
}, | ||
|
||
Hint_yes: { | ||
pointerEvents: 'auto', | ||
color: $mol_theme.current, | ||
}, | ||
|
||
} ) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
$optimade_tmdne_app $mol_view | ||
title \This material does not exist | ||
number? 1 | ||
plugins / | ||
<= Theme $mol_theme_auto | ||
auto / | ||
<= update | ||
rotating? false | ||
number_swiped? 0 | ||
number_prefetch? 0 | ||
sub / | ||
<= Player $optimade_cifplayer_player | ||
fullscreen? => player_fullscreen? | ||
attr * | ||
fullscreen <= player_fullscreen? | ||
card_holding <= card_holding | ||
data <= json null | ||
Fullscreen null | ||
Overlays null | ||
event * | ||
pointerdown? <=> player_pointerdown? null | ||
pointerup? <=> player_pointerup? null | ||
<= Head_space $mol_view | ||
sub / | ||
<= Head_card $mol_list | ||
sub / | ||
<= Head_title $mol_paragraph | ||
title \Does this material exist? | ||
<= Prediction $mol_list | ||
attr * | ||
rotating <= rotating | ||
sub <= params / | ||
<= Param* $mol_view | ||
sub / | ||
<= Param_name* $mol_paragraph | ||
minimal_height 16 | ||
title <= param_name* \ | ||
<= Param_symbol_html* $optimade_tmdne_html_view | ||
html <= param_symbol* \ | ||
\= | ||
<= Param_value* $mol_view | ||
minimal_height 16 | ||
sub / | ||
<= param_value* \ | ||
<= Param_unit* $optimade_tmdne_html_view | ||
html <= param_unit* \ | ||
<= Param_mae* $mol_view | ||
sub / | ||
\(± | ||
<= param_mae* \ | ||
<= Param_mae_unit* $optimade_tmdne_html_view | ||
html <= param_unit* \ | ||
\) | ||
<= Foot $mol_view | ||
attr * | ||
rotating <= rotating | ||
sub / | ||
<= Hint_no $mol_button_minor | ||
title \ᐊ No | ||
click? <=> click_no? null | ||
<= Hint_yes $mol_button_minor | ||
title \Yes ᐅ | ||
click? <=> click_yes? null | ||
^ cards / <= Card* $optimade_tmdne_card | ||
name <= card_name* \ | ||
loaded <= card_loaded* false | ||
why? <=> why*? \ | ||
pointer_holding? <=> card_holding? false | ||
on_swiped <= update null | ||
swipe_to_right => swipe_to_right* | ||
swipe_to_left => swipe_to_left* |
Oops, something went wrong.