3D-Renderer-omeka-module/view/common/block-layout/render-3d.phtml

82 lines
1.8 KiB
PHTML
Raw Normal View History

2021-04-04 17:47:14 +02:00
2021-10-06 12:43:24 +02:00
<?php
$this->headLink()->appendStylesheet($this->assetUrl('css/render3d.css',
2021-04-04 17:47:14 +02:00
'Render3D'));
2021-10-06 12:43:24 +02:00
?>
2021-04-04 17:47:14 +02:00
<script>
console.log(<?= json_encode($urls, JSON_UNESCAPED_SLASHES) ?>)
</script>
2021-10-06 12:43:24 +02:00
<!--
<style>
#<?= $id ?> {
height: <?= $height ?>px;
width: <?= $width ?>px;
}
</style>
-->
<style>
model-viewer {
width: 100%;
height: 500px;
outline: none;
background-color: transparent;
}
</style>
<div class="model-3d-wrap archive-item-block">
<?php if ($renderSourceLink) { ?>
<div class="source-link">
<a href="<?= $item_url ?>">Source</a>
</div>
2021-04-09 10:05:52 +02:00
<?php } ?>
2021-10-06 12:43:24 +02:00
<div id="<?= $id ?>" style="display:absolute">
<model-viewer id="<?= $id ?>_3d_model"
reveal="interaction"
src="<?= $urls[0] ?>"
alt="A 3D model of a robot"
auto-rotate=""
camera-controls=""
background-color="#455A64"
<?php if ($skybox) { ?>
skybox-image="{{ object['skybox'] }}"
<?php } ?>
>
<?php if($addPreLoadImage) { ?>
<div id="lazy-load-poster"
class="lazy-load-poster"
slot="poster">
</div>
<div id="button-load"
class="button-load"
slot="poster">
Load 3D Model
</div>
<?php } ?>
</model-viewer>
</div>
2021-04-09 10:05:52 +02:00
2021-05-31 20:09:46 +02:00
<?php if ($title) { ?>
<div class="item_title">
<?= $title ?>
</div>
2021-10-06 12:43:24 +02:00
<?php } ?>
</div>
2021-04-04 17:47:14 +02:00
2021-10-06 12:43:24 +02:00
<script type="module" src="/modules/Render3D/asset/vendor/google/model-viewer.js"></script>
2021-04-04 17:47:14 +02:00
2021-10-06 12:43:24 +02:00
<?php
/*
echo $this->inlineScript()
->prependFile($this->assetUrl('/vendor/google/model-viewer.js?v=1"',
'Render3D'));
*/
/*
$this->headScript()->appendFile($this->assetUrl('/vendor/google/model-viewer.js?v=1',
'Render3D'));
*/
?>