gpt4 book ai didi

javascript - 如何将模型查看器加载器的颜色设置为红色

转载 作者:行者123 更新时间:2023-12-05 09:29:27 26 4
gpt4 key购买 nike

使用模型查看器 ( https://modelviewer.dev/examples/loading/index.html#glbModel )我想将我的 model-viewer 的加载颜色设置为红色,但我在文档中没有找到任何相关内容。

enter image description here

这是代码笔链接:https://codepen.io/luxonauta/pen/vYKYppq?editors=1010

<!-- Loads <model-viewer> for modern browsers-->
<script type="module" src="https://unpkg.com/@google/model-viewer@latest/dist/model-viewer.js"></script>
<!-- Loads <model-viewer> for old browsers like IE11-->
<script type="nomodule" src="https://unpkg.com/@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.com/36cb8393-65c6-408d-a538-055ada20431b/Astronaut.glb?1542147958948" ios-src="https://cdn.glitch.com/36cb8393-65c6-408d-a538-055ada20431b/Astronaut.usdz?v=1569545377878" poster="https://cdn.glitch.com/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 &lt;model-viewer&gt; web component. It makes displaying 3D and AR content on the web easy!</p>
</div>
</div>
</div>
</section>
</main>

Codepen 链接演示完全可用,只有红色未在此处实现:https://codepen.io/luxonauta/pen/vYKYppq?editors=1010

请帮助我提前谢谢!!

最佳答案

你应该申请 custom css variables .

model-viewer {
--progress-bar-color: red;
}

关于javascript - 如何将模型查看器加载器的颜色设置为红色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70680155/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com