Skip to content

Commit ea73076

Browse files
author
deiu
committed
Added recommended badge
1 parent 6268f10 commit ea73076

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

Diff for: css/style.css

+11
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,17 @@ a { text-decoration: none; }
7878
text-align: justify;
7979
}
8080

81+
.recommended {
82+
font-weight: 200;
83+
font-size: small;
84+
color: #fff;
85+
background: #43C47A;
86+
border-radius: 3px;
87+
padding: 0 4px;
88+
margin-top: 15px;
89+
position: absolute;
90+
}
91+
8192
.buttons {
8293
padding: 14px 0 14px 0;
8394
text-align: center;

Diff for: js/app.js

+21
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
var idpList = 'https://solid.github.io/solid-idp-list/services.json';
2+
var recommended = ['https://databox.me/'];
23

34
/* ---- DON'T EDIT BELOW ---- */
45
var accURL = {};
@@ -46,6 +47,26 @@ var list = function(data) {
4647
var header_link = document.createElement('a');
4748
header_link.href = safeHTML(idp.url);
4849
header.appendChild(header_link);
50+
51+
// recommended?
52+
if (idp.url && idp.url.length > 0) {
53+
for (var i in recommended) {
54+
if (recommended[i] == idp.url) {
55+
var rec = document.createElement('div');
56+
rec.classList.add('recommended');
57+
rec.innerHTML = "Recommended";
58+
if (idp.btn_bg && idp.btn_bg.length > 0) {
59+
rec.style.background = safeHTML(idp.btn_bg);
60+
}
61+
if (idp.btn_color && idp.btn_color.length > 0) {
62+
rec.style.color = safeHTML(idp.btn_color);
63+
}
64+
header_link.appendChild(rec);
65+
break;
66+
}
67+
}
68+
}
69+
4970
// icon
5071
if (idp.icon && idp.icon.length > 0) {
5172
var img = document.createElement('img');

0 commit comments

Comments
 (0)