Skip to content

Commit ce01bf3

Browse files
Added transparent widgets to be more alligned with Homey house style
1 parent bcd8366 commit ce01bf3

File tree

5 files changed

+50
-30
lines changed

5 files changed

+50
-30
lines changed

.homeychangelog.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@
161161
"en": "Added RWM garbage, added GFT and area collection (under Textile) for Recycleapp",
162162
"nl": "RWM afval en reiniging wordt nu ook ondersteund, toevoegingen voor Recycleapp"
163163
},
164-
"4.0.7": {
164+
"4.0.8": {
165165
"en": "Added support for widgets! Now display the next collection days right on your dashboard.",
166166
"nl": "Ondersteuning voor widgets toegevoegd! Toon de eerstvolgende ophaaldata direct op je dashboard."
167167
}

.homeycompose/app.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
"nl": "Afval Herinnering 2.0",
77
"sv": "Avfallspåminnelse 2.0"
88
},
9-
"version": "4.0.7",
9+
"version": "4.0.8",
1010
"platforms": [
1111
"local"
1212
],
13-
"compatibility": ">=12.1.0",
13+
"compatibility": ">=12.1.2",
1414
"author": {
1515
"name": "Robert Raaijmakers",
1616
"email": "[email protected]"

app.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
"nl": "Afval Herinnering 2.0",
88
"sv": "Avfallspåminnelse 2.0"
99
},
10-
"version": "4.0.7",
10+
"version": "4.0.8",
1111
"platforms": [
1212
"local"
1313
],
14-
"compatibility": ">=12.1.0",
14+
"compatibility": ">=12.1.2",
1515
"author": {
1616
"name": "Robert Raaijmakers",
1717
"email": "[email protected]"
@@ -206,6 +206,7 @@
206206
"en": "Trash Overview",
207207
"nl": "Afval Overzicht"
208208
},
209+
"transparent": true,
209210
"settings": [
210211
{
211212
"id": "layout-type",

widgets/trash-reminder-list/public/index.html

+43-25
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,28 @@
88
}
99

1010
.trash-item-container {
11-
margin: 10px 0px 0px 0px;
12-
flex: 1 1 30%; /* Each item takes 30% of the width (adjust as needed) */
13-
max-width: 30%;
14-
box-sizing: border-box;
11+
flex: 1 1 33%; /* Each item takes 30% of the width (adjust as needed) */
12+
max-width: 22%;
1513
display: flex;
1614
flex-direction: column; /* Ensures elements inside stack vertically */
1715
align-items: center; /* Center items horizontally within the container */
1816
text-align: center; /* Ensures text aligns in the center */
17+
18+
margin: 0px 0px var(--homey-su-3) 0px; /* Add some spacing between items */
19+
box-sizing: border-box;
20+
padding: var(--homey-su) var(--homey-su-2);
21+
background-color: var(--homey-background-color);
22+
border-radius: var(--homey-border-radius-default);
23+
}
24+
25+
.trashContainer.triple .trash-item-container {
26+
flex: 1 1 33%;
27+
max-width: 31%;
28+
}
29+
30+
.trashContainer.quad .trash-item-container {
31+
flex: 1 1 25%;
32+
max-width: 23%;
1933
}
2034

2135
.dot-large {
@@ -36,28 +50,21 @@
3650
}
3751

3852
.trash-date {
39-
margin: 0px 0px;
40-
padding: 5px 0px 0px 0px;
53+
margin: 2px 0px 0px 0px;
54+
padding: 6px 0px 0px 0px;
4155
text-align: center;
4256
}
4357

44-
.trashContainer.triple .trash-item-container {
45-
flex: 1 1 24%;
46-
max-width: 324%;
47-
}
48-
49-
.trashContainer.quad .trash-item-container {
50-
flex: 1 1 24%;
51-
max-width: 324%;
52-
}
53-
5458
.trash-item-container-compact {
5559
display: flex;
5660
align-items: center; /* Vertically center the dot and text */
5761
justify-content: flex-start; /* Align items to the left */
58-
width: 40%; /* Each container takes about half the width */
59-
margin: 5px 10px 0px 10px; /* Add some spacing between items */
62+
width: 48%; /* Each container takes about half the width */
63+
margin: 0px 0px var(--homey-su-3) 0px; /* Add some spacing between items */
6064
box-sizing: border-box;
65+
padding: var(--homey-su) var(--homey-su-2);
66+
background-color: var(--homey-background-color);
67+
border-radius: var(--homey-border-radius-default);
6168
}
6269

6370
/* Dot styling - aligned to the left */
@@ -88,8 +95,9 @@
8895
/* Title and subtitle styling */
8996
.trash-date-title {
9097
margin: 0;
91-
font-weight: bold;
92-
font-size: 12px;
98+
font-weight: var(--homey-font-weight-medium);
99+
font-size: var(--homey-font-size-small);
100+
line-height: var(--homey-font-size-small);
93101
}
94102

95103
.trash-date-subtitle {
@@ -132,8 +140,14 @@
132140
.dot-type-GLAS {
133141
background-color: #00cdae;
134142
}
143+
144+
.my-custom-body {
145+
background-color: transparent;
146+
overflow-x: auto;
147+
}
135148

136149
.my-custom-body-overflow-hidden {
150+
background-color: transparent;
137151
overflow: hidden;
138152
}
139153
</style>
@@ -188,7 +202,7 @@
188202
tbody.innerHTML = '';
189203
let counter = 0;
190204
let usedTypes = {};
191-
let rowHeight = 80;
205+
let rowHeight = 88;
192206
let itemsPerRow = 4;
193207

194208
for (let index in response) {
@@ -212,7 +226,7 @@
212226
} else {
213227

214228
const trashTypeText = Homey.__(`widgets.trashType.${trashItem.type}`);
215-
rowHeight = 40;
229+
rowHeight = 57;
216230
itemsPerRow = 2;
217231

218232
tbody.innerHTML += `
@@ -226,10 +240,14 @@
226240
}
227241
}
228242

229-
if(widgetSetting['layout-type'] === 'large') {
243+
if(widgetSetting['layout-type'] === 'large' && counter % 3 === 0) itemsPerRow = 3;
244+
245+
if(widgetSetting['layout-type'] === 'large' && itemsPerRow === 4) {
246+
tbody.classList.remove('triple');
230247
tbody.classList.add('quad');
231-
} else {
248+
} else if(widgetSetting['layout-type'] === 'large') {
232249
tbody.classList.remove('quad');
250+
tbody.classList.add('triple');
233251
}
234252

235253
const dBody = document.querySelector('#main-body');
@@ -241,7 +259,7 @@
241259
dBody.classList.add('my-custom-body-overflow-hidden'); // Make the widget not overflow
242260
}
243261

244-
Homey.ready({ height: (widgetSetting['list-height'] * rowHeight) + 10 });
262+
Homey.ready({ height: ((widgetSetting['list-height'] * rowHeight) + (widgetSetting['list-height']-1 * 10)) });
245263
}).catch((error) => {
246264
console.error(error);
247265
});

widgets/trash-reminder-list/widget.compose.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"en": "Trash Overview",
44
"nl": "Afval Overzicht"
55
},
6+
"transparent": true,
67
"settings": [
78
{
89
"id": "layout-type",

0 commit comments

Comments
 (0)