diff options
| author | s-ol <s-ol@users.noreply.github.com> | 2020-11-28 12:59:56 +0000 |
|---|---|---|
| committer | s-ol <s-ol@users.noreply.github.com> | 2020-11-28 16:41:05 +0000 |
| commit | 7c96fd084fe1f45427a0cd7cd0037091415ee4d2 (patch) | |
| tree | 8022e688c88557b3ddd49798eb1e3d01654cb3b6 | |
| parent | make runtime JS scripts part of PLUGINS system (diff) | |
| download | mmm-7c96fd084fe1f45427a0cd7cd0037091415ee4d2.tar.gz mmm-7c96fd084fe1f45427a0cd7cd0037091415ee4d2.zip | |
add GLTF model viewer plugin
| -rw-r--r-- | mmm/mmmfs/plugins/gltf.moon | 23 | ||||
| -rw-r--r-- | mmm/mmmfs/plugins/init.moon | 1 |
2 files changed, 24 insertions, 0 deletions
diff --git a/mmm/mmmfs/plugins/gltf.moon b/mmm/mmmfs/plugins/gltf.moon new file mode 100644 index 0000000..28a6cf8 --- /dev/null +++ b/mmm/mmmfs/plugins/gltf.moon @@ -0,0 +1,23 @@ +dom = require 'mmm.dom' + +{ + converts: { + { + inp: 'URL -> model/gltf-binary' + out: 'mmm/dom' + cost: 1 + transform: (href) => + dom['model-viewer'] { + src: href + 'auto-rotate': true + 'camera-controls': true + 'camera-orbit': "548.2deg 117deg 282.4m" + } + } + } + + scripts: [[ + <script type="module" src="https://unpkg.com/@google/model-viewer/dist/model-viewer.min.js"></script> + <script nomodule src="https://unpkg.com/@google/model-viewer/dist/model-viewer-legacy.js"></script> + ]] +} diff --git a/mmm/mmmfs/plugins/init.moon b/mmm/mmmfs/plugins/init.moon index 93190b2..b19c88f 100644 --- a/mmm/mmmfs/plugins/init.moon +++ b/mmm/mmmfs/plugins/init.moon @@ -297,6 +297,7 @@ add_plugin 'mermaid' add_plugin 'twitter' add_plugin 'youtube' add_plugin 'cites' +add_plugin 'gltf' if STATIC add_plugin 'static' |
