added modelviewer and css

This commit is contained in:
Luca Junge 2022-11-13 20:56:17 +01:00
parent 1326d54083
commit ad7d092728
5 changed files with 113 additions and 144 deletions

View file

@ -8,15 +8,9 @@
<title>{{ title }}</title>
</head>
<body>
<main>
<model-viewer src="{{file}}" ar camera-controls shadow-intensity=1><button class="Hotspot" slot="hotspot-3" data-position="0.034086908507172255m 0.035633058045035026m 0.0008323315838707837m" data-normal="0.11076220205426575m 0.9733893287613071m 0.2006114384817127m" data-visibility-attribute="visible">
<div class="HotspotAnnotation">The Beak</div>
</button><button class="Hotspot" slot="hotspot-4" data-position="-0.0077982119614389955m -0.008128374324366697m -0.034137767670381604m" data-normal="-0.2165819895695754m 0.2073173991125989m -0.9539977661500428m" data-visibility-attribute="visible">
<div class="HotspotAnnotation">A Wing</div>
</button><button class="Hotspot" slot="hotspot-5" data-position="-0.04329843722003483m 0.011786457618276569m 0.0029983665888340706m" data-normal="-0.7752145503176167m 0.6212154023517756m 0.11460290073456728m" data-visibility-attribute="visible">
<div class="HotspotAnnotation">The Tail</div>
</button></model-viewer>
</main>
<model-viewer src="{{file if file else 'model.glb'}}" field-of-view="{{fieldofview if fieldofview else 'auto'}}" ar xr-environment camera-controls shadow-intensity=1>
{{content | safe}}
</model-viewer>
<script type="module" src="/assets/model-viewer.min.js"></script>
</body>
</html>

View file

@ -1,21 +1,20 @@
html,
body {
margin: 0;
padding: 0;
overflow: hidden;
height: 100%;
width: 100vw;
height: 100vh;
}
model-viewer {
height: 100vh;
width: 100%
width: 100%;
height: 90%;
background-color: #ffffff;
}
:not(:defined) > * {
display: none;
}
.Hotspot {
background: #fff;
border-radius: 32px;
@ -76,7 +75,6 @@ model-viewer {
transition: transform 0.3s, opacity 0.3s;
}
.progress-bar {
display: block;
width: 33%;
@ -87,7 +85,8 @@ model-viewer {
top: 50%;
transform: translate3d(-50%, -50%, 0);
border-radius: 25px;
box-shadow: 0px 3px 10px 3px rgba(0, 0, 0, 0.5), 0px 0px 5px 1px rgba(0, 0, 0, 0.6);
box-shadow: 0px 3px 10px 3px rgba(0, 0, 0, 0.5),
0px 0px 5px 1px rgba(0, 0, 0, 0.6);
border: 1px solid rgba(255, 255, 255, 0.9);
background-color: rgba(0, 0, 0, 0.5);
}
@ -106,39 +105,6 @@ model-viewer {
transition: width 0.3s;
}
#ar-button {
background-image: url(ar_icon.png);
background-repeat: no-repeat;
background-size: 20px 20px;
background-position: 12px 50%;
background-color: #fff;
position: absolute;
left: 50%;
transform: translateX(-50%);
white-space: nowrap;
bottom: 16px;
padding: 0px 16px 0px 40px;
font-family: Roboto Regular, Helvetica Neue, sans-serif;
font-size: 14px;
color: #4285f4;
height: 36px;
line-height: 36px;
border-radius: 18px;
border: 1px solid #DADCE0;
}
#ar-button:active {
background-color: #E8EAED;
}
#ar-button:focus {
outline: none;
}
#ar-button:focus-visible {
outline: 1px solid #4285f4;
}
@keyframes circle {
from {
transform: translateX(-50%) rotate(0deg) translateX(50px) rotate(0deg);

View file

@ -0,0 +1,5 @@
---
title: Stadttheater Bremerhaven
alt: Ein 3D-Modell des Stadttheaters in Bremerhaven
fieldofview: 45deg
---

Binary file not shown.

View file

@ -6,8 +6,12 @@ file: model.glb
<button class="Hotspot" slot="hotspot-3" data-position="0.034086908507172255m 0.035633058045035026m 0.0008323315838707837m" data-normal="0.11076220205426575m 0.9733893287613071m 0.2006114384817127m" data-visibility-attribute="visible">
<div class="HotspotAnnotation">The Beak</div>
</button><button class="Hotspot" slot="hotspot-4" data-position="-0.0077982119614389955m -0.008128374324366697m -0.034137767670381604m" data-normal="-0.2165819895695754m 0.2073173991125989m -0.9539977661500428m" data-visibility-attribute="visible">
</button>
<button class="Hotspot" slot="hotspot-4" data-position="-0.0077982119614389955m -0.008128374324366697m -0.034137767670381604m" data-normal="-0.2165819895695754m 0.2073173991125989m -0.9539977661500428m" data-visibility-attribute="visible">
<div class="HotspotAnnotation">A Wing</div>
</button><button class="Hotspot" slot="hotspot-5" data-position="-0.04329843722003483m 0.011786457618276569m 0.0029983665888340706m" data-normal="-0.7752145503176167m 0.6212154023517756m 0.11460290073456728m" data-visibility-attribute="visible">
</button>
<button class="Hotspot" slot="hotspot-5" data-position="-0.04329843722003483m 0.011786457618276569m 0.0029983665888340706m" data-normal="-0.7752145503176167m 0.6212154023517756m 0.11460290073456728m" data-visibility-attribute="visible">
<div class="HotspotAnnotation">The Tail</div>
</button>