Skip to content

Commit

Permalink
added icon radius to json
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielRedacted committed Sep 18, 2024
1 parent 63575b2 commit 14140d1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
7 changes: 6 additions & 1 deletion card.html
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
height:100%;
aspect-ratio:1/1;
top:0; left:-22px;
border-radius:50%;
/* border-radius:50%; */
background-color:#444;
padding:auto;
overflow:hidden;
Expand Down Expand Up @@ -253,6 +253,11 @@ <h1>Phone</h1>
icon.src = contact.icon;
icon.alt = `${contact.contactType} icon`;
}
if (contact.shape == "circle") {
icon.style.borderRadius = "50%;"
} else {
icon.style.borderRadius = "8px;"
}
button.appendChild(icon);

const arrow = document.createElement('div');
Expand Down
18 changes: 12 additions & 6 deletions cardAssets/contacts.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,48 @@
"display": true,
"value": "DanielRedacted.net",
"link": "https://DanielRedacted.net",
"icon": "cardAssets/icons/website.svg"
"icon": "cardAssets/icons/website.svg",
"shape": "circle"
},
{
"contactType": "Email",
"display": true,
"value": "[email protected]",
"link": "mailto:[email protected]",
"icon": "cardAssets/icons/mail.svg"
"icon": "cardAssets/icons/mail.svg",
"shape": "circle"
},
{
"contactType": "Phone",
"display": true,
"value": "+1-000-000-0000",
"link": "tel:+10000000000",
"icon": "cardAssets/icons/phone.svg"
"icon": "cardAssets/icons/phone.svg",
"shape": "circle"
},
{
"contactType": "LinkedIn",
"display": true,
"value": "",
"link": "https://www.linkedin.com/in/username",
"icon": ""
"icon": "",
"shape": "square"
},
{
"contactType": "X",
"display": true,
"value": "@DanielRedacted",
"link": "https://x.com/DanielRedacted",
"icon": ""
"icon": "",
"shape": "square"
},
{
"contactType": "Instagram",
"display": true,
"value": "@DanielRedacted",
"link": "https://www.instagram.com/DanielRedacted",
"icon": ""
"icon": "",
"shape": "square"
}
]
}
Expand Down

0 comments on commit 14140d1

Please sign in to comment.