File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
packages/modelviewer.dev/examples Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -174,15 +174,26 @@ <h4 id="intro"><span class="font-medium">Animated Hotspots. </span></h4>
174
174
let tailRect ;
175
175
176
176
function onResize ( ) {
177
- baseRect = modelViewer1 . getBoundingClientRect ( ) ;
177
+ const arStatus = modelViewer1 . getAttribute ( 'ar-status' ) ;
178
+ baseRect = ( arStatus == "not-presenting" || arStatus == "failed" ) ?
179
+ modelViewer1 . getBoundingClientRect ( ) : new DOMRect ( ) ;
178
180
noseRect = document . querySelector ( '#nose' ) . getBoundingClientRect ( ) ;
179
181
hoofRect = document . querySelector ( '#hoof' ) . getBoundingClientRect ( ) ;
180
182
tailRect = document . querySelector ( '#tail' ) . getBoundingClientRect ( ) ;
181
183
}
182
184
183
185
window . addEventListener ( "resize" , onResize ) ;
184
186
185
- modelViewer1 . addEventListener ( 'ar-status' , onResize ) ;
187
+ modelViewer1 . addEventListener ( 'ar-status' , ( event ) => {
188
+ lines . forEach ( ( element ) => {
189
+ if ( event . detail . status !== 'session-started' ) {
190
+ element . classList . remove ( 'hide' ) ;
191
+ } else {
192
+ element . classList . add ( 'hide' ) ;
193
+ }
194
+ } ) ;
195
+ onResize ( ) ;
196
+ } ) ;
186
197
187
198
modelViewer1 . addEventListener ( 'load' , ( ) => {
188
199
onResize ( ) ;
Original file line number Diff line number Diff line change @@ -305,7 +305,7 @@ <h2 class="demo-title">Combining Effects</h2>
305
305
</ div >
306
306
< example-snippet stamp-to ="combining-effects " highlight-as ="html ">
307
307
< template >
308
- < model-viewer id ="effectsViewer " camera-controls touch-action ="pan-y " src ="../../shared-assets/models/EmissiveStrengthTest.glb " ar alt ="A 3D ">
308
+ < model-viewer id ="effectsViewer " camera-controls scale =" 0.1 0.1 0.1 " touch-action ="pan-y " src ="../../shared-assets/models/EmissiveStrengthTest.glb " ar alt ="A 3D ">
309
309
< effect-composer render-mode ="quality ">
310
310
< outline-effect color ="blue " blend-mode ="skip "> </ outline-effect >
311
311
< ssao-effect blend-mode ="skip "> </ ssao-effect >
You can’t perform that action at this time.
0 commit comments