make AIR QUALITY MONITOR
Browse files- components/air-quality-card.js +26 -34
components/air-quality-card.js
CHANGED
|
@@ -6,30 +6,29 @@ class AirQualityCard extends HTMLElement {
|
|
| 6 |
<style>
|
| 7 |
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&display=swap');
|
| 8 |
.air-quality-card {
|
| 9 |
-
background:
|
| 10 |
border-radius: 16px;
|
| 11 |
padding: 1.5rem;
|
| 12 |
-
box-shadow: 0 0 30px rgba(139, 92, 246, 0.
|
| 13 |
-
border: 1px solid
|
| 14 |
backdrop-filter: blur(10px);
|
| 15 |
-
color:
|
| 16 |
font-family: 'Poppins', sans-serif;
|
| 17 |
position: relative;
|
| 18 |
overflow: hidden;
|
| 19 |
}
|
| 20 |
-
.air-quality-card::before {
|
| 21 |
content: '';
|
| 22 |
position: absolute;
|
| 23 |
top: -50%;
|
| 24 |
left: -50%;
|
| 25 |
width: 200%;
|
| 26 |
height: 200%;
|
| 27 |
-
background: radial-gradient(circle, rgba(139, 92, 246, 0.
|
| 28 |
-
animation: rotate 20s linear infinite;
|
| 29 |
z-index: -1;
|
| 30 |
}
|
| 31 |
-
|
| 32 |
-
@keyframes rotate {
|
| 33 |
from { transform: rotate(0deg); }
|
| 34 |
to { transform: rotate(360deg); }
|
| 35 |
}
|
|
@@ -53,37 +52,32 @@ animation: rotate 20s linear infinite;
|
|
| 53 |
grid-template-columns: 1fr;
|
| 54 |
gap: 1.5rem;
|
| 55 |
}
|
| 56 |
-
|
| 57 |
.metric {
|
| 58 |
position: relative;
|
| 59 |
-
background: rgba(
|
| 60 |
border-radius: 12px;
|
| 61 |
padding: 1rem;
|
| 62 |
-
border: 1px solid rgba(139, 92, 246, 0.
|
| 63 |
-
box-shadow: 0 0 15px rgba(139, 92, 246, 0.
|
| 64 |
-
transition: all 0.3s ease;
|
| 65 |
}
|
| 66 |
-
|
| 67 |
-
.metric:hover {
|
| 68 |
transform: translateY(-5px);
|
| 69 |
box-shadow: 0 0 25px rgba(139, 92, 246, 0.3);
|
| 70 |
}
|
| 71 |
-
|
| 72 |
.metric-title {
|
| 73 |
font-size: 0.9rem;
|
| 74 |
-
color:
|
| 75 |
-
margin-bottom: 0.5rem;
|
| 76 |
text-transform: uppercase;
|
| 77 |
letter-spacing: 1px;
|
| 78 |
}
|
| 79 |
-
|
| 80 |
-
.gauge-container {
|
| 81 |
width: 100%;
|
| 82 |
height: 120px;
|
| 83 |
position: relative;
|
| 84 |
margin: 0.5rem 0;
|
| 85 |
}
|
| 86 |
-
|
| 87 |
.gauge-value {
|
| 88 |
position: absolute;
|
| 89 |
bottom: 0;
|
|
@@ -92,17 +86,15 @@ margin-bottom: 0.5rem;
|
|
| 92 |
text-align: center;
|
| 93 |
font-size: 1.8rem;
|
| 94 |
font-weight: 700;
|
| 95 |
-
color:
|
| 96 |
-
text-shadow: 0 0 10px rgba(139, 92, 246, 0.
|
| 97 |
-
}
|
| 98 |
-
|
| 99 |
.metric-subtext {
|
| 100 |
font-size: 0.75rem;
|
| 101 |
-
color:
|
| 102 |
-
margin-top: 0.5rem;
|
| 103 |
}
|
| 104 |
-
|
| 105 |
-
.gauge {
|
| 106 |
width: 100%;
|
| 107 |
height: 100%;
|
| 108 |
position: relative;
|
|
@@ -119,7 +111,7 @@ margin-top: 0.5rem;
|
|
| 119 |
.co2-gauge { background: linear-gradient(to top, var(--success), #8b5cf6); }
|
| 120 |
.smoke-gauge { background: linear-gradient(to top, var(--warning), var(--danger)); }
|
| 121 |
.aqi-gauge { background: linear-gradient(to top, #a78bfa, var(--primary)); }
|
| 122 |
-
.gauge-markers {
|
| 123 |
position: absolute;
|
| 124 |
bottom: 0;
|
| 125 |
width: 100%;
|
|
@@ -132,7 +124,7 @@ margin-top: 0.5rem;
|
|
| 132 |
|
| 133 |
.gauge-marker {
|
| 134 |
width: 2px;
|
| 135 |
-
background: rgba(
|
| 136 |
position: relative;
|
| 137 |
}
|
| 138 |
|
|
@@ -143,9 +135,9 @@ margin-top: 0.5rem;
|
|
| 143 |
left: 50%;
|
| 144 |
transform: translateX(-50%);
|
| 145 |
font-size: 0.6rem;
|
| 146 |
-
color:
|
| 147 |
}
|
| 148 |
-
|
| 149 |
|
| 150 |
<div class="air-quality-card">
|
| 151 |
<h3 class="card-title">
|
|
|
|
| 6 |
<style>
|
| 7 |
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&display=swap');
|
| 8 |
.air-quality-card {
|
| 9 |
+
background: rgba(255, 255, 255, 0.95);
|
| 10 |
border-radius: 16px;
|
| 11 |
padding: 1.5rem;
|
| 12 |
+
box-shadow: 0 0 30px rgba(139, 92, 246, 0.1);
|
| 13 |
+
border: 1px solid rgba(139, 92, 246, 0.2);
|
| 14 |
backdrop-filter: blur(10px);
|
| 15 |
+
color: #5b21b6;
|
| 16 |
font-family: 'Poppins', sans-serif;
|
| 17 |
position: relative;
|
| 18 |
overflow: hidden;
|
| 19 |
}
|
| 20 |
+
.air-quality-card::before {
|
| 21 |
content: '';
|
| 22 |
position: absolute;
|
| 23 |
top: -50%;
|
| 24 |
left: -50%;
|
| 25 |
width: 200%;
|
| 26 |
height: 200%;
|
| 27 |
+
background: radial-gradient(circle, rgba(139, 92, 246, 0.05) 0%, transparent 70%);
|
| 28 |
+
animation: rotate 20s linear infinite;
|
| 29 |
z-index: -1;
|
| 30 |
}
|
| 31 |
+
@keyframes rotate {
|
|
|
|
| 32 |
from { transform: rotate(0deg); }
|
| 33 |
to { transform: rotate(360deg); }
|
| 34 |
}
|
|
|
|
| 52 |
grid-template-columns: 1fr;
|
| 53 |
gap: 1.5rem;
|
| 54 |
}
|
|
|
|
| 55 |
.metric {
|
| 56 |
position: relative;
|
| 57 |
+
background: rgba(255, 255, 255, 0.9);
|
| 58 |
border-radius: 12px;
|
| 59 |
padding: 1rem;
|
| 60 |
+
border: 1px solid rgba(139, 92, 246, 0.15);
|
| 61 |
+
box-shadow: 0 0 15px rgba(139, 92, 246, 0.05);
|
| 62 |
+
transition: all 0.3s ease;
|
| 63 |
}
|
| 64 |
+
.metric:hover {
|
|
|
|
| 65 |
transform: translateY(-5px);
|
| 66 |
box-shadow: 0 0 25px rgba(139, 92, 246, 0.3);
|
| 67 |
}
|
|
|
|
| 68 |
.metric-title {
|
| 69 |
font-size: 0.9rem;
|
| 70 |
+
color: #7c3aed;
|
| 71 |
+
margin-bottom: 0.5rem;
|
| 72 |
text-transform: uppercase;
|
| 73 |
letter-spacing: 1px;
|
| 74 |
}
|
| 75 |
+
.gauge-container {
|
|
|
|
| 76 |
width: 100%;
|
| 77 |
height: 120px;
|
| 78 |
position: relative;
|
| 79 |
margin: 0.5rem 0;
|
| 80 |
}
|
|
|
|
| 81 |
.gauge-value {
|
| 82 |
position: absolute;
|
| 83 |
bottom: 0;
|
|
|
|
| 86 |
text-align: center;
|
| 87 |
font-size: 1.8rem;
|
| 88 |
font-weight: 700;
|
| 89 |
+
color: #5b21b6;
|
| 90 |
+
text-shadow: 0 0 10px rgba(139, 92, 246, 0.1);
|
| 91 |
+
}
|
|
|
|
| 92 |
.metric-subtext {
|
| 93 |
font-size: 0.75rem;
|
| 94 |
+
color: #6b7280;
|
| 95 |
+
margin-top: 0.5rem;
|
| 96 |
}
|
| 97 |
+
.gauge {
|
|
|
|
| 98 |
width: 100%;
|
| 99 |
height: 100%;
|
| 100 |
position: relative;
|
|
|
|
| 111 |
.co2-gauge { background: linear-gradient(to top, var(--success), #8b5cf6); }
|
| 112 |
.smoke-gauge { background: linear-gradient(to top, var(--warning), var(--danger)); }
|
| 113 |
.aqi-gauge { background: linear-gradient(to top, #a78bfa, var(--primary)); }
|
| 114 |
+
.gauge-markers {
|
| 115 |
position: absolute;
|
| 116 |
bottom: 0;
|
| 117 |
width: 100%;
|
|
|
|
| 124 |
|
| 125 |
.gauge-marker {
|
| 126 |
width: 2px;
|
| 127 |
+
background: rgba(139, 92, 246, 0.2);
|
| 128 |
position: relative;
|
| 129 |
}
|
| 130 |
|
|
|
|
| 135 |
left: 50%;
|
| 136 |
transform: translateX(-50%);
|
| 137 |
font-size: 0.6rem;
|
| 138 |
+
color: #6b7280;
|
| 139 |
}
|
| 140 |
+
</style>
|
| 141 |
|
| 142 |
<div class="air-quality-card">
|
| 143 |
<h3 class="card-title">
|