shx-3d-render

main
Jan Umbach 2024-06-19 17:14:01 +02:00
parent 09be2ef426
commit 1e9d5ce3f5
5 changed files with 68 additions and 1 deletions

44
assets/LogoMain.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 28 KiB

View File

@ -375,6 +375,9 @@
{% render 'shx-3d-render-input' {% render 'shx-3d-render-input'
, content_type: 'init' %} , content_type: 'init' %}
{% render 'shx-loading-spinner'
, content_type: 'head' %}
<script <script
src="{{ 'anime.min.js' | asset_url }}" src="{{ 'anime.min.js' | asset_url }}"
defer="defer" defer="defer"

View File

@ -146,12 +146,17 @@
this.content = this.container.querySelector('.shx-input-forms-content'); this.content = this.container.querySelector('.shx-input-forms-content');
this.Viewer3DContainer = document.createElement('div');
this.Viewer3DContainer.classList.add('shx-threejs-renderer-container');
this.container.appendChild(this.Viewer3DContainer);
this.Viewer3D = document.createElement('iframe'); this.Viewer3D = document.createElement('iframe');
this.Viewer3D.src = "https://3d-viewer.shinnex.de/"; this.Viewer3D.src = "https://3d-viewer.shinnex.de/";
this.Viewer3D.classList.add('shx-threejs-renderer'); this.Viewer3D.classList.add('shx-threejs-renderer');
this.Viewer3D.style.width = this.container.offsetWidth + 'px'; this.Viewer3D.style.width = this.container.offsetWidth + 'px';
this.Viewer3D.style.height = this.container.offsetWidth + 'px'; this.Viewer3D.style.height = this.container.offsetWidth + 'px';
this.container.appendChild(this.Viewer3D); this.Viewer3DContainer.appendChild(this.Viewer3D);
this.Viewer3D.onload = () => { this.Viewer3D.onload = () => {
this.Viewer3D.contentWindow.postMessage(JSON.stringify({"init":{"uuid":this.uuid}}), "*"); this.Viewer3D.contentWindow.postMessage(JSON.stringify({"init":{"uuid":this.uuid}}), "*");

View File

@ -0,0 +1,14 @@
{% assign content_type = content_type | default: 'body' %}
{% if content_type == 'body' %}
<img src="{% render 'shx-logo' %}" width="200px" height="auto">
{% elif content_type == 'head' %}
<style>
</style>
{% endif %}

1
snippets/shx-logo.liquid Normal file
View File

@ -0,0 +1 @@
{{ "LogoMain.svg" | asset_url }}