Test clouds2 effect with simplified theme structure
This commit is contained in:
1 parent
efcdcb6765
commit
9ebbff08f1
1 file changed
+8
-24
+8
-24
@@ -336,7 +336,7 @@
|
|||||||
<div id="weather-forecast" class="weather-forecast"></div>
|
<div id="weather-forecast" class="weather-forecast"></div>
|
||||||
</div>
|
</div>
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/vanta@0.5.21/dist/vanta.clouds.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/vanta@latest/dist/vanta.clouds2.min.js"></script>
|
||||||
<script>
|
<script>
|
||||||
var effect = VANTA.CLOUDS({
|
var effect = VANTA.CLOUDS({
|
||||||
el: "#vanta",
|
el: "#vanta",
|
||||||
@@ -823,40 +823,28 @@ var weatherThemes = {
|
|||||||
sunny: {
|
sunny: {
|
||||||
skyColor: 0x54514f,
|
skyColor: 0x54514f,
|
||||||
cloudColor: 0xb0a89a,
|
cloudColor: 0xb0a89a,
|
||||||
cloudShadowColor: 0x6d6a63,
|
lightColor: 0xf3ede1,
|
||||||
sunColor: 0xf3ede1,
|
|
||||||
sunGlareColor: 0xe0914f,
|
|
||||||
sunlightColor: 0xe6dfd1,
|
|
||||||
backgroundColor: 0x54514f,
|
backgroundColor: 0x54514f,
|
||||||
speed: 1.0
|
speed: 1.0
|
||||||
},
|
},
|
||||||
cloudy: {
|
cloudy: {
|
||||||
skyColor: 0x6d6a63,
|
skyColor: 0x6d6a63,
|
||||||
cloudColor: 0x999187,
|
cloudColor: 0x999187,
|
||||||
cloudShadowColor: 0x54514f,
|
lightColor: 0xe6dfd1,
|
||||||
sunColor: 0xe6dfd1,
|
|
||||||
sunGlareColor: 0xb0a89a,
|
|
||||||
sunlightColor: 0xb0a89a,
|
|
||||||
backgroundColor: 0x3a383d,
|
backgroundColor: 0x3a383d,
|
||||||
speed: 1.2
|
speed: 1.2
|
||||||
},
|
},
|
||||||
stormy: {
|
stormy: {
|
||||||
skyColor: 0x29282c,
|
skyColor: 0x29282c,
|
||||||
cloudColor: 0x3a383d,
|
cloudColor: 0x3a383d,
|
||||||
cloudShadowColor: 0x1c1b1f,
|
lightColor: 0x999187,
|
||||||
sunColor: 0x999187,
|
|
||||||
sunGlareColor: 0x6d6a63,
|
|
||||||
sunlightColor: 0x6d6a63,
|
|
||||||
backgroundColor: 0x100f12,
|
backgroundColor: 0x100f12,
|
||||||
speed: 2.5
|
speed: 2.5
|
||||||
},
|
},
|
||||||
night: {
|
night: {
|
||||||
skyColor: 0x100f12,
|
skyColor: 0x100f12,
|
||||||
cloudColor: 0x29282c,
|
cloudColor: 0x29282c,
|
||||||
cloudShadowColor: 0x1c1b1f,
|
lightColor: 0xb0a89a,
|
||||||
sunColor: 0xb0a89a,
|
|
||||||
sunGlareColor: 0x54514f,
|
|
||||||
sunlightColor: 0x6d6a63,
|
|
||||||
backgroundColor: 0x100f12,
|
backgroundColor: 0x100f12,
|
||||||
speed: 0.4
|
speed: 0.4
|
||||||
}
|
}
|
||||||
@@ -914,7 +902,7 @@ var weatherThemes = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var result = {};
|
var result = {};
|
||||||
var keys = ['skyColor', 'cloudColor', 'cloudShadowColor', 'sunColor', 'sunGlareColor', 'sunlightColor', 'backgroundColor'];
|
var keys = ['skyColor', 'cloudColor', 'lightColor', 'backgroundColor'];
|
||||||
for (var i = 0; i < keys.length; i++) {
|
for (var i = 0; i < keys.length; i++) {
|
||||||
var k = keys[i];
|
var k = keys[i];
|
||||||
if (prevThemeColors && smoothT < 1) {
|
if (prevThemeColors && smoothT < 1) {
|
||||||
@@ -938,12 +926,8 @@ var weatherThemes = {
|
|||||||
return {
|
return {
|
||||||
sky: mixColor(c.sky, themeColors.skyColor, mix),
|
sky: mixColor(c.sky, themeColors.skyColor, mix),
|
||||||
cloud: mixColor(c.cloud, themeColors.cloudColor, mix),
|
cloud: mixColor(c.cloud, themeColors.cloudColor, mix),
|
||||||
cloudShadow: mixColor(c.cloudShadow, themeColors.cloudShadowColor, mix),
|
light: mixColor(c.sun, themeColors.lightColor, mix * 0.5),
|
||||||
sun: mixColor(c.sun, themeColors.sunColor, mix * 0.5),
|
bg: mixColor(c.bg, themeColors.backgroundColor, mix)
|
||||||
sunGlare: mixColor(c.sunGlare, themeColors.sunGlareColor, mix * 0.5),
|
|
||||||
sunLight: mixColor(c.sunLight, themeColors.sunlightColor, mix * 0.5),
|
|
||||||
bg: mixColor(c.bg, themeColors.backgroundColor, mix),
|
|
||||||
sunVis: c.sunVis
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user