Spaces:
Runtime error
Runtime error
design: apply user-provided soft green pastel color palette variables to root theme and Three.js 3D silo
Browse files- frontend/app.js +8 -8
- frontend/style.css +15 -15
frontend/app.js
CHANGED
|
@@ -1084,19 +1084,19 @@ function initCrisisStoryScroller() {
|
|
| 1084 |
c.style.boxShadow = "none";
|
| 1085 |
});
|
| 1086 |
entry.target.style.borderColor = "var(--cyan)";
|
| 1087 |
-
entry.target.style.background = "rgba(
|
| 1088 |
-
entry.target.style.boxShadow = "0 4px 15px rgba(
|
| 1089 |
|
| 1090 |
// Get parameters
|
| 1091 |
const targetHeight = entry.target.getAttribute("data-height");
|
| 1092 |
const targetTons = entry.target.getAttribute("data-tons");
|
| 1093 |
|
| 1094 |
// Determine 3D color based on stage height
|
| 1095 |
-
let colorHex =
|
| 1096 |
if (targetHeight === "55") {
|
| 1097 |
-
colorHex =
|
| 1098 |
} else if (targetHeight === "95") {
|
| 1099 |
-
colorHex =
|
| 1100 |
}
|
| 1101 |
|
| 1102 |
// Update Three.js 3D silo height and color
|
|
@@ -1144,7 +1144,7 @@ let siloMesh, wasteMesh, garbageGroup;
|
|
| 1144 |
let isTabActive = true;
|
| 1145 |
let target3DHeight = 0.1; // 10% initially
|
| 1146 |
let current3DHeight = 0.1;
|
| 1147 |
-
let targetColorHex =
|
| 1148 |
|
| 1149 |
window.addEventListener("blur", () => { isTabActive = false; });
|
| 1150 |
window.addEventListener("focus", () => { isTabActive = true; });
|
|
@@ -1180,7 +1180,7 @@ function init3DScene() {
|
|
| 1180 |
// 1. Silo Outer Wireframe Cylinder
|
| 1181 |
const siloGeo = new THREE.CylinderGeometry(0.7, 0.7, 2, 16, 1, true);
|
| 1182 |
const siloMat = new THREE.MeshBasicMaterial({
|
| 1183 |
-
color:
|
| 1184 |
wireframe: true,
|
| 1185 |
transparent: true,
|
| 1186 |
opacity: 0.18
|
|
@@ -1193,7 +1193,7 @@ function init3DScene() {
|
|
| 1193 |
wasteGeo.translate(0, 1, 0); // Translate origin pivot to bottom
|
| 1194 |
|
| 1195 |
const wasteMat = new THREE.MeshPhongMaterial({
|
| 1196 |
-
color:
|
| 1197 |
transparent: true,
|
| 1198 |
opacity: 0.7,
|
| 1199 |
shininess: 40,
|
|
|
|
| 1084 |
c.style.boxShadow = "none";
|
| 1085 |
});
|
| 1086 |
entry.target.style.borderColor = "var(--cyan)";
|
| 1087 |
+
entry.target.style.background = "rgba(84, 130, 53, 0.03)";
|
| 1088 |
+
entry.target.style.boxShadow = "0 4px 15px rgba(84, 130, 53, 0.05)";
|
| 1089 |
|
| 1090 |
// Get parameters
|
| 1091 |
const targetHeight = entry.target.getAttribute("data-height");
|
| 1092 |
const targetTons = entry.target.getAttribute("data-tons");
|
| 1093 |
|
| 1094 |
// Determine 3D color based on stage height
|
| 1095 |
+
let colorHex = 0x548235; // Soft green (stage 1)
|
| 1096 |
if (targetHeight === "55") {
|
| 1097 |
+
colorHex = 0xC59124; // Soft Gold Amber (stage 2)
|
| 1098 |
} else if (targetHeight === "95") {
|
| 1099 |
+
colorHex = 0xC53929; // Soft Crimson Red (stage 3)
|
| 1100 |
}
|
| 1101 |
|
| 1102 |
// Update Three.js 3D silo height and color
|
|
|
|
| 1144 |
let isTabActive = true;
|
| 1145 |
let target3DHeight = 0.1; // 10% initially
|
| 1146 |
let current3DHeight = 0.1;
|
| 1147 |
+
let targetColorHex = 0x548235;
|
| 1148 |
|
| 1149 |
window.addEventListener("blur", () => { isTabActive = false; });
|
| 1150 |
window.addEventListener("focus", () => { isTabActive = true; });
|
|
|
|
| 1180 |
// 1. Silo Outer Wireframe Cylinder
|
| 1181 |
const siloGeo = new THREE.CylinderGeometry(0.7, 0.7, 2, 16, 1, true);
|
| 1182 |
const siloMat = new THREE.MeshBasicMaterial({
|
| 1183 |
+
color: 0x548235,
|
| 1184 |
wireframe: true,
|
| 1185 |
transparent: true,
|
| 1186 |
opacity: 0.18
|
|
|
|
| 1193 |
wasteGeo.translate(0, 1, 0); // Translate origin pivot to bottom
|
| 1194 |
|
| 1195 |
const wasteMat = new THREE.MeshPhongMaterial({
|
| 1196 |
+
color: 0x548235,
|
| 1197 |
transparent: true,
|
| 1198 |
opacity: 0.7,
|
| 1199 |
shininess: 40,
|
frontend/style.css
CHANGED
|
@@ -1,22 +1,22 @@
|
|
| 1 |
/* CSS Variables for Bright Eco-Sustainability Theming */
|
| 2 |
:root {
|
| 3 |
-
--bg-void: #
|
| 4 |
-
--bg-panel: #FFFFFF; /* Pure White Card */
|
| 5 |
-
--border-color: #
|
| 6 |
-
--border-hover: #
|
| 7 |
|
| 8 |
-
--text-main: #
|
| 9 |
-
--text-muted: #
|
| 10 |
|
| 11 |
-
/* Professional Eco-Urban Colors */
|
| 12 |
-
--cyan: #
|
| 13 |
-
--cyan-glow: rgba(
|
| 14 |
-
--green: #
|
| 15 |
-
--green-glow: rgba(
|
| 16 |
-
--yellow: #
|
| 17 |
-
--yellow-glow: rgba(
|
| 18 |
-
--red: #
|
| 19 |
-
--red-glow: rgba(
|
| 20 |
|
| 21 |
/* Fonts */
|
| 22 |
--font-display: 'Outfit', 'Space Grotesk', system-ui, sans-serif;
|
|
|
|
| 1 |
/* CSS Variables for Bright Eco-Sustainability Theming */
|
| 2 |
:root {
|
| 3 |
+
--bg-void: #EAF4E8; /* Lightest soft mint green (warm, no glare) */
|
| 4 |
+
--bg-panel: #FFFFFF; /* Pure White Card for high contrast surface */
|
| 5 |
+
--border-color: #D0E7CD; /* Soft leaf border */
|
| 6 |
+
--border-hover: #A9D08E; /* Meadow green on hover */
|
| 7 |
|
| 8 |
+
--text-main: #2C402B; /* Dark forest green (professional, soft on the eyes) */
|
| 9 |
+
--text-muted: #688566; /* Muted olive-sage green */
|
| 10 |
|
| 11 |
+
/* Professional Eco-Urban Colors based on custom palette */
|
| 12 |
+
--cyan: #548235; /* Dark Leaf Green (Primary Accent) */
|
| 13 |
+
--cyan-glow: rgba(84, 130, 53, 0.15);
|
| 14 |
+
--green: #70AD47; /* Meadow Green */
|
| 15 |
+
--green-glow: rgba(112, 173, 71, 0.1);
|
| 16 |
+
--yellow: #C59124; /* Soft Gold Amber */
|
| 17 |
+
--yellow-glow: rgba(197, 145, 36, 0.1);
|
| 18 |
+
--red: #C53929; /* Soft Crimson Red */
|
| 19 |
+
--red-glow: rgba(197, 57, 41, 0.15);
|
| 20 |
|
| 21 |
/* Fonts */
|
| 22 |
--font-display: 'Outfit', 'Space Grotesk', system-ui, sans-serif;
|