Skip to content

Commit fbca0a0

Browse files
authored
[layout] update styles for weather and calendar (MagicMirrorOrg#3894)
1 parent e886821 commit fbca0a0

File tree

6 files changed

+23
-24
lines changed

6 files changed

+23
-24
lines changed

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ Thanks to: @dathbe.
4848
- [core] Update dependencies including electron to v38 as well as github actions (#3831, #3849, #3857, #3858, #3872, #3876, #3882, #3891)
4949
- [weather] Update feels_like temperature calculation formula (#3869)
5050
- [weather] Update null value handling for weather type (#3892)
51+
- [layout] Update styles for weather and calendar (#3894)
5152

5253
### Fixed
5354

@@ -331,7 +332,7 @@ For more info, please read the following post: [A New Chapter for MagicMirror: T
331332
- Update translations for estonian (#3371)
332333
- Update electron to v29 and update other dependencies
333334
- [calendar] fullDay events over several days now show the left days from the first day on and 'today' on the last day
334-
- Update layout of current weather indoor values
335+
- [weather] Update layout of current weather indoor values
335336

336337
### Fixed
337338

@@ -779,7 +780,7 @@ Special thanks to the following contributors: @apiontek, @eouia, @jupadin, @khas
779780
- Actually test all js and css files when lint script is run.
780781
- Updated jsdocs and print warnings during testing too.
781782
- Updated weathergov provider to try fetching not just current, but also forecast, when API URLs available.
782-
- Refactored clock layout.
783+
- [clock] Refactored clock layout.
783784
- Refactored methods from weather-providers into weatherobject (isDaytime, updateSunTime).
784785
- Use of `logger.js` in jest tests.
785786
- Run prettier over all relevant files.

css/main.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,3 +252,15 @@ sup {
252252
.region .container.hidden {
253253
display: none;
254254
}
255+
256+
.region.left .flex {
257+
justify-content: flex-start;
258+
}
259+
260+
.region.center .flex {
261+
justify-content: center;
262+
}
263+
264+
.region.right .flex {
265+
justify-content: flex-end;
266+
}

modules/default/calendar/calendar.css

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,14 @@
22
display: flex;
33
flex-direction: row;
44
justify-content: flex-end;
5-
padding-left: 0;
6-
padding-right: 10px;
7-
font-size: var(--font-size-small);
8-
}
9-
10-
.calendar .symbol span {
11-
padding-top: 4px;
5+
gap: 5px;
126
}
137

148
.calendar .title {
15-
padding-left: 0;
16-
padding-right: 0;
17-
vertical-align: top;
9+
padding: 0 10px;
1810
}
1911

2012
.calendar .time {
21-
padding-left: 30px;
13+
padding-left: 20px;
2214
text-align: right;
23-
vertical-align: top;
2415
}

modules/default/calendar/calendar.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ Module.register("calendar", {
168168

169169
this.selfUpdate();
170170
},
171-
notificationReceived (notification, payload, sender) {
172171

172+
notificationReceived (notification, payload, sender) {
173173
if (notification === "FETCH_CALENDAR") {
174174
if (this.hasCalendarURL(payload.url)) {
175175
this.sendSocketNotification(notification, { url: payload.url, id: this.identifier });
@@ -217,7 +217,6 @@ Module.register("calendar", {
217217

218218
// Override dom generator.
219219
getDom () {
220-
const ONE_SECOND = 1000; // 1,000 milliseconds
221220
const events = this.createEventList(true);
222221
const wrapper = document.createElement("table");
223222
wrapper.className = this.config.tableClass;
@@ -308,15 +307,12 @@ Module.register("calendar", {
308307
}
309308

310309
const symbolClass = this.symbolClassForUrl(event.url);
311-
symbolWrapper.className = `symbol align-right ${symbolClass}`;
310+
symbolWrapper.className = `symbol ${symbolClass}`;
312311

313312
const symbols = this.symbolsForEvent(event);
314-
symbols.forEach((s, index) => {
313+
symbols.forEach((s) => {
315314
const symbol = document.createElement("span");
316315
symbol.className = s;
317-
if (index > 0) {
318-
symbol.style.paddingLeft = "5px";
319-
}
320316
symbolWrapper.appendChild(symbol);
321317
});
322318
eventWrapper.appendChild(symbolWrapper);
@@ -601,7 +597,6 @@ Module.register("calendar", {
601597
*/
602598
createEventList (limitNumberOfEntries) {
603599
let now = moment();
604-
let today = now.clone().startOf("day");
605600
let future = now.clone().startOf("day").add(this.config.maximumNumberOfDays, "days");
606601

607602
let events = [];

modules/default/weather/current.njk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
{% endif %}
4444
</div>
4545
{% endif %}
46-
<div class="large type-temp">
46+
<div class="flex large type-temp">
4747
{% if config.showIndoorTemperature and indoor.temperature or config.showIndoorHumidity and indoor.humidity %}
4848
<span class="medium fas fa-home"></span>
4949
<span style="display: inline-block">

modules/default/weather/weather.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,6 @@
4444

4545
.weather .type-temp {
4646
display: flex;
47-
align-items: center;
47+
align-items: baseline;
4848
gap: 10px;
4949
}

0 commit comments

Comments
 (0)