@fmidev/smartmet-alert-client 4.1.8 → 4.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +29 -25
- package/dist/index.mjs +29 -25
- package/dist/index.mjs.map +1 -1
- package/package.json +11 -11
- package/src/assets/fonts/Noto_Sans/Noto-Sans-regular.woff2 +0 -0
- package/src/components/Days.vue +3 -3
- package/src/components/GrayScaleToggle.vue +2 -4
- package/src/components/MapLarge.vue +33 -3
- package/src/components/MapSmall.vue +23 -1
- package/src/components/Warning.vue +2 -4
- package/src/main.js +1 -0
- package/src/mixins/config.js +35 -24
- package/src/mixins/utils.js +35 -17
- package/src/scss/constants.scss +9 -1
- package/src/scss/warningImages.scss +1 -0
package/src/mixins/utils.js
CHANGED
|
@@ -94,6 +94,12 @@ export default {
|
|
|
94
94
|
return regions
|
|
95
95
|
}, [])
|
|
96
96
|
},
|
|
97
|
+
landBorders() {
|
|
98
|
+
return this.areaBorders('land')
|
|
99
|
+
},
|
|
100
|
+
seaBorders() {
|
|
101
|
+
return this.areaBorders('sea')
|
|
102
|
+
},
|
|
97
103
|
yellowCoverages() {
|
|
98
104
|
return this.coverageGeom(`coverages${this.size}`, 0, 1, 2)
|
|
99
105
|
},
|
|
@@ -130,6 +136,16 @@ export default {
|
|
|
130
136
|
.join('')
|
|
131
137
|
)
|
|
132
138
|
},
|
|
139
|
+
areaBorders(area) {
|
|
140
|
+
return [
|
|
141
|
+
{
|
|
142
|
+
key: `border.${area}`,
|
|
143
|
+
d: this.geometries[this.geometryId]['borders'][area][`path${this.size}`],
|
|
144
|
+
opacity: '1',
|
|
145
|
+
strokeWidth: this.strokeWidth,
|
|
146
|
+
},
|
|
147
|
+
]
|
|
148
|
+
},
|
|
133
149
|
relativeCoverageFromReference(reference) {
|
|
134
150
|
if (reference == null) {
|
|
135
151
|
return 0
|
|
@@ -179,33 +195,35 @@ export default {
|
|
|
179
195
|
},
|
|
180
196
|
msSinceStartOfDay(timestamp) {
|
|
181
197
|
const moment = this.toTimeZone(timestamp)
|
|
182
|
-
|
|
198
|
+
const ms = ((moment.hour * 60 + moment.minute) * 60 + moment.second) * 1000 + moment.millisecond
|
|
199
|
+
// Daylight saving time
|
|
200
|
+
const ref = this.toTimeZone(timestamp - ms)
|
|
201
|
+
if (ref.day !== moment.day) {
|
|
202
|
+
return ms - 60 * 60 * 1000
|
|
203
|
+
}
|
|
204
|
+
return ms + ref.hour * 60 * 60 * 1000
|
|
183
205
|
},
|
|
184
206
|
effectiveDays(start, end, dailyWarning) {
|
|
185
207
|
const offset = this.timeOffset
|
|
186
208
|
const referenceTime =
|
|
187
209
|
this.startFrom === 'updated' ? this.updatedAt : this.currentTime
|
|
210
|
+
const day = 1000 * 60 * 60 * 24
|
|
188
211
|
return [...Array(this.NUMBER_OF_DAYS).keys()].map((index) => {
|
|
189
|
-
const
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
212
|
+
const dayTime = referenceTime + index * day
|
|
213
|
+
const dayStartOffset = this.msSinceStartOfDay(dayTime)
|
|
214
|
+
let startOfDay = dayTime - dayStartOffset
|
|
215
|
+
|
|
216
|
+
const nextDayTime = referenceTime + (index + 1) * day
|
|
217
|
+
const nextDayStartOffset = this.msSinceStartOfDay(nextDayTime)
|
|
218
|
+
let startOfNextDay = nextDayTime - nextDayStartOffset
|
|
193
219
|
|
|
194
|
-
const nextDate = new Date(referenceTime)
|
|
195
|
-
nextDate.setDate(nextDate.getDate() + index + 1)
|
|
196
|
-
const nextDay = this.toTimeZone(nextDate)
|
|
197
|
-
const startOfNextDay = new Date(
|
|
198
|
-
nextDay.year,
|
|
199
|
-
nextDay.month - 1,
|
|
200
|
-
nextDay.day
|
|
201
|
-
)
|
|
202
220
|
if (!dailyWarning) {
|
|
203
|
-
startOfDay
|
|
204
|
-
startOfNextDay
|
|
221
|
+
startOfDay = startOfDay + offset
|
|
222
|
+
startOfNextDay = startOfNextDay + offset
|
|
205
223
|
}
|
|
206
224
|
return (
|
|
207
|
-
new Date(start).getTime() < startOfNextDay
|
|
208
|
-
new Date(end).getTime() > startOfDay
|
|
225
|
+
new Date(start).getTime() < startOfNextDay &&
|
|
226
|
+
new Date(end).getTime() > startOfDay
|
|
209
227
|
)
|
|
210
228
|
})
|
|
211
229
|
},
|
package/src/scss/constants.scss
CHANGED
|
@@ -30,5 +30,13 @@ $tooltip-arrow-width: 5px;
|
|
|
30
30
|
$tooltip-border-width: 1px;
|
|
31
31
|
$tooltip-arrow-border-width: $tooltip-arrow-width + $tooltip-border-width;
|
|
32
32
|
$popup-width: 250px;
|
|
33
|
-
|
|
33
|
+
|
|
34
|
+
@font-face {
|
|
35
|
+
font-family: 'Noto Sans';
|
|
36
|
+
font-weight: normal;
|
|
37
|
+
font-style: normal;
|
|
38
|
+
src: url($font-base-path + 'Noto_Sans/Noto-Sans-regular.woff2') format('woff2');
|
|
39
|
+
font-display: swap;
|
|
40
|
+
}
|
|
41
|
+
$font-family: Roboto, Helvetica, Arial, 'Noto Sans', sans-serif;
|
|
34
42
|
$symbol-font-family: 'Noto Sans', sans-serif;
|