admin管理员组文章数量:1331849
Using model-viewer (/examples/loading/index.html#glbModel)
I want to give loading color of my model-viewer
as red but I did not find anything related to that in the documentation.
Here is codepen link:
<!-- Loads <model-viewer> for modern browsers-->
<script type="module" src="/@google/model-viewer@latest/dist/model-viewer.js"></script>
<!-- Loads <model-viewer> for old browsers like IE11-->
<script type="nomodule" src="/@google/model-viewer@latest/dist/model-viewer-legacy.js"></script>
<main>
<section class="has-dflex-center">
<div class="lx-container-80">
<div class="lx-row">
<div class="lx-card bs-lg">
<model-viewer src=".glb?1542147958948" ios-src=".usdz?v=1569545377878" poster=".png?v=1599079951717" alt="A 3D model of an astronaut!" shadow-intensity="1" camera-controls="true" auto-rotate="true" ar="true"></model-viewer>
<p class="text"><i class="fas fa-hand-point-right"></i> This pen is a basic demo of the <model-viewer> web ponent. It makes displaying 3D and AR content on the web easy!</p>
</div>
</div>
</div>
</section>
</main>
Using model-viewer (https://modelviewer.dev/examples/loading/index.html#glbModel)
I want to give loading color of my model-viewer
as red but I did not find anything related to that in the documentation.
Here is codepen link: https://codepen.io/luxonauta/pen/vYKYppq?editors=1010
<!-- Loads <model-viewer> for modern browsers-->
<script type="module" src="https://unpkg./@google/model-viewer@latest/dist/model-viewer.js"></script>
<!-- Loads <model-viewer> for old browsers like IE11-->
<script type="nomodule" src="https://unpkg./@google/model-viewer@latest/dist/model-viewer-legacy.js"></script>
<main>
<section class="has-dflex-center">
<div class="lx-container-80">
<div class="lx-row">
<div class="lx-card bs-lg">
<model-viewer src="https://cdn.glitch./36cb8393-65c6-408d-a538-055ada20431b/Astronaut.glb?1542147958948" ios-src="https://cdn.glitch./36cb8393-65c6-408d-a538-055ada20431b/Astronaut.usdz?v=1569545377878" poster="https://cdn.glitch./36cb8393-65c6-408d-a538-055ada20431b%2Fposter-astronaut.png?v=1599079951717" alt="A 3D model of an astronaut!" shadow-intensity="1" camera-controls="true" auto-rotate="true" ar="true"></model-viewer>
<p class="text"><i class="fas fa-hand-point-right"></i> This pen is a basic demo of the <model-viewer> web ponent. It makes displaying 3D and AR content on the web easy!</p>
</div>
</div>
</div>
</section>
</main>
Codepen link demo is fully working only red color is not implemented here: https://codepen.io/luxonauta/pen/vYKYppq?editors=1010
Please help me thanks in advance !!
Share Improve this question edited Jan 13, 2022 at 0:48 brianpeiris 10.8k1 gold badge33 silver badges45 bronze badges asked Jan 12, 2022 at 10:44 EaBengaluruEaBengaluru 812 gold badges30 silver badges72 bronze badges2 Answers
Reset to default 7You should apply custom css variables.
model-viewer {
--progress-bar-color: red;
}
You can easily change the background color with CSS. Right now your demo has
model-viewer {
width: 100%;
height: 25rem;
background-color: #70bcd1;
}
Just change the background color to red:
model-viewer {
width: 100%;
height: 25rem;
background-color: #f00;
}
本文标签: javascriptHow to give modelviewer loader color as redStack Overflow
版权声明:本文标题:javascript - How to give model-viewer loader color as red - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742273760a2444802.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论