-
Notifications
You must be signed in to change notification settings - Fork 43
/
data.js
64 lines (58 loc) · 1.68 KB
/
data.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
class Event
{
constructor(name, icon, translationKey)
{
this.name = name;
this.icon = icon;
this.translationKey = translationKey;
}
}
class Level
{
constructor(name, color, translationKey)
{
this.name = name;
this.color = color;
this.translationKey = translationKey;
}
}
export default class Data
{
static get events()
{
// This list is ordered how dangerous events are
// If for example there is warning for wind AND rain
// Rain has higher priority (you can expect wind while raining)
return [
new Event('Forest fire', 'pine-tree-fire', 'events.forest_fire'),
new Event('Avalanches', 'image-filter-hdr', 'events.avalanches'),
new Event('Flooding', 'home-flood', 'events.flooding'),
new Event('Rain-Flood', 'home-flood', 'events.rain_flood'),
new Event('Coastal Event', 'waves', 'events.coastal_event'),
new Event('Thunderstorms', 'weather-lightning', 'events.thunderstorms'),
new Event('Rain', 'weather-pouring', 'events.rain'),
new Event('Snow/Ice', 'weather-snowy-heavy', 'events.snow_ice'),
new Event('High temperature', 'thermometer', 'events.hight_temperature'),
new Event('Low temperature', 'snowflake', 'events.low_temperature'),
new Event('Wind', 'windsock', 'events.wind'),
new Event('Fog', 'weather-fog', 'events.fog'),
new Event('Unknown Event', 'alert-circle-outline', null),
];
}
static get levels()
{
return [
new Level('Yellow', '#ff9800', 'messages.yellow'),
new Level('Orange', '#EE5A24', 'messages.orange'),
new Level('Red', '#db4437', 'messages.red')
];
}
static getEventByName(name)
{
return this.events.find((e) => e.name === name);
}
static getLevelByID(id)
{
return this.levels[id - 1];
}
}