Skip to content

Commit 68ced07

Browse files
committed
use material icons instead of font awesome
1 parent 13a866a commit 68ced07

File tree

14 files changed

+49
-13051
lines changed

14 files changed

+49
-13051
lines changed

app/apis/weather_kit_api.rb

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -130,20 +130,21 @@ def weather_alert_calendar_events
130130

131131
def icon_for(condition_code)
132132
icon_mappings = {
133-
"Thunderstorms" => "cloud-bolt",
134-
"Cloudy" => "clouds",
135-
"MostlyCloudy" => "clouds",
136-
"PartlyCloudy" => "clouds-sun",
137-
"MostlyClear" => "cloud-sun",
138-
"Clear" => "sun",
139-
"Windy" => "wind",
140-
"Drizzle" => "raindrops",
141-
"Rain" => "raindrops",
142-
"HeavyRain" => "raindrops",
143-
"Haze" => "sun-haze",
144-
"Snow" => "snowflake",
145-
"HeavySnow" => "snowflakes",
146-
"Flurries" => "snowflake"
133+
"Thunderstorms" => "thunderstorm",
134+
"Cloudy" => "cloud",
135+
"MostlyCloudy" => "cloud",
136+
"PartlyCloudy" => "partly_cloudy_day",
137+
"MostlyClear" => "partly_cloudy_day",
138+
"Clear" => "sunny",
139+
"Windy" => "air",
140+
"Drizzle" => "rainy",
141+
"Rain" => "rainy",
142+
"HeavyRain" => "rainy",
143+
"Haze" => "foggy",
144+
"Snow" => "ac_unit",
145+
"HeavySnow" => "sac_unit",
146+
"Flurries" => "ac_unit",
147+
"Foggy" => "foggy"
147148
}
148149

149150
if icon_mappings[condition_code]

app/models/calendar_feed.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def baby_age_event(birthdate = Date.parse(Timeframe::Application.config.local["b
5454
id: "_baby_age",
5555
starts_at: Date.today.to_time,
5656
ends_at: (Date.today + 1.day).to_time,
57-
icon: "baby-carriage",
57+
icon: "stroller",
5858
summary: summary
5959
)
6060
end

app/views/displays/_timeline.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<% if event.letter.present? %>
1010
<%= event.letter %>
1111
<% else %>
12-
<i class="fa-fw fa-solid fa-<%= event.icon %>"></i>
12+
<span class="material-symbols-rounded"><%= event.icon %></span>
1313
<% end %>
1414
</td>
1515
<td>
@@ -30,7 +30,7 @@
3030
<% if event.letter.present? %>
3131
<%= event.letter %>
3232
<% else %>
33-
<i class="fa-fw fa-solid fa-<%= event.icon %>"></i>
33+
<span class="material-symbols-rounded"><%= event.icon %></span>
3434
<% end %>
3535
</td>
3636
<td style="white-space: nowrap; font-size: .75rem; padding: 0 .5rem; width: 5.5rem;">

app/views/displays/mira.html.erb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<div class="hide-if-empty" style="background-color: #ddd; color: black; padding: 0.5rem 2rem; text-overflow: ellipsis; white-space: nowrap; overflow: hidden;">
2222
<div>
2323
<div style="display: inline-block; padding-right: 1rem; vertical-align: super">
24-
<i class="fa-solid fa-fw fa-<%= view_object[:minutely_weather_minutes_icon] %>"></i>
24+
<span class="material-symbols-rounded"><%= view_object[:minutely_weather_minutes_icon] %></span>
2525
</div>
2626
<div style="display: inline-block">
2727
<table class="minutely" border="0" cellpadding="0" cellspacing="0">
@@ -46,7 +46,7 @@
4646
<% end %>
4747
<% if view_object[:sonos_status].present? %>
4848
<div class="hide-if-empty" style="background-color: black; color: white; padding: 1rem 2rem; text-overflow: ellipsis; white-space: nowrap; overflow: hidden;">
49-
<i class="fa-solid fa-volume fa-fw"></i>
49+
<span class="material-symbols-rounded" style="font-size: 2.5rem;vertical-align: middle;margin-top: -.6rem;">volume_up</span>
5050
<strong><%= view_object[:sonos_status][:artist] %></strong>
5151
<% if view_object[:sonos_status][:track].present? %>
5252
: <%= view_object[:sonos_status][:track] %>
@@ -60,14 +60,14 @@
6060
<div>
6161
<% view_object[:status_icons_with_labels].each do |status_icon, label| %>
6262
<span style="margin-right: .5rem;">
63-
<i class="fa-solid fa-<%= status_icon %>"></i>
63+
<span class="material-symbols-rounded"><%= status_icon %></span>
6464
<%= label %>
6565
</span>
6666
<% end %>
6767
</div>
6868
<div style="text-align: right;">
6969
<% if view_object[:birdnet_most_unusual_species_trailing_24h].present? %>
70-
<i class="fa-solid fa-crow"></i>
70+
<span class="material-symbols-rounded" style="vertical-align: text-bottom"> raven </span>
7171
<%= view_object[:birdnet_most_unusual_species_trailing_24h] %>
7272
<% else %>
7373
&nbsp;
@@ -78,7 +78,7 @@
7878
<div style="display: flex; justify-content: space-between; line-height: 2rem; font-size: 2rem;">
7979
<div>
8080
<% view_object[:status_icons].each do |status_icon| %>
81-
<i class="fa-solid fa-<%= status_icon %>" style="margin-right: 1rem"></i>
81+
<span class="material-symbols-rounded" style="margin-right: 1rem"><%= status_icon %></span>
8282
<% end %>
8383
</div>
8484
<div><%= DateTime.now.strftime("%A, %B %-d") %></div>

app/views/displays/thirteen.html.erb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@
55
<div style="clear: both; line-height: .7; margin-bottom: 1rem; font-size: 1rem">
66
<div style="float: left;">
77
<% view_object[:status_icons].each do |status_icon| %>
8-
<i class="fa-solid fa-<%= status_icon %>" style="margin-right: 1rem"></i>
8+
<span class="material-symbols-rounded" style="margin-right: 1rem"><%= status_icon %></span>
99
<% end %>
1010
<% view_object[:status_icons_with_labels].each do |status_icon, label| %>
1111
<span style="margin-right: 1rem;">
12-
<i class="fa-solid fa-<%= status_icon %>"></i>
12+
<span class="material-symbols-rounded"><%= status_icon %></span>
1313
<%= label %>
1414
</span>
1515
<% end %>
1616
</div>
1717
<div style="float: right; text-align: right;">
1818
<% if view_object[:birdnet_most_unusual_species_trailing_24h].present? %>
1919
<div style="display: inline-block;">
20-
<i class="fa-solid fa-crow"></i>
20+
<span class="material-symbols-rounded" style="vertical-align: text-bottom"> raven </span>
2121
<%= view_object[:birdnet_most_unusual_species_trailing_24h] %>
2222
</div>
2323
<% end %>

public/css/display.css

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,26 @@
1-
@import "font-awesome/fontawesome.css";
2-
@import "font-awesome/solid.css";
3-
@import "font-awesome/regular.css";
1+
@font-face {
2+
font-family: 'Material Symbols Rounded';
3+
font-style: normal;
4+
font-weight: 400;
5+
src: url('/fonts/material-symbols.woff2') format('woff2');
6+
}
7+
8+
.material-symbols-rounded {
9+
font-family: 'Material Symbols Rounded';
10+
font-weight: normal;
11+
font-style: normal;
12+
font-size: 1.25rem;
13+
line-height: 1;
14+
letter-spacing: normal;
15+
text-transform: none;
16+
display: inline-block;
17+
white-space: nowrap;
18+
word-wrap: normal;
19+
direction: ltr;
20+
padding-top: .2rem;
21+
-webkit-font-feature-settings: 'liga';
22+
-webkit-font-smoothing: antialiased;
23+
}
424

525
/* lato-regular - latin */
626
@font-face {

0 commit comments

Comments
 (0)