Skip to content

Commit

Permalink
added arrow svg
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielRedacted committed Sep 18, 2024
1 parent a349bad commit 1c1c3a5
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
21 changes: 19 additions & 2 deletions card.html
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,19 @@
padding:auto;
overflow:hidden;
}
.row .icon svg {
.row .arrow {
position:absolute;
display:flex;
height:100%;
aspect-ratio:1/1;
top:0; right:0;
background-color:transparent;
padding:auto;
overflow:hidden;
}
.row .icon svg,
.row .arrow svg
{
width: 50%;
height: auto;
fill:white;
Expand Down Expand Up @@ -233,16 +245,21 @@ <h1>Phone</h1>
button.href = contact.link;

const icon = document.createElement('div');
icon.classList.add("icon");
if (contact.icon) {
// Fetch the SVG icon and insert it inline
const svgContent = await fetchSVG(contact.icon);
icon.innerHTML = svgContent; // Insert the SVG content
icon.classList.add("icon");
icon.src = contact.icon;
icon.alt = `${contact.contactType} icon`;
}
button.appendChild(icon);

const arrow = document.createElement('img');
arrow.classList.add("arrow");
arrow.src = "cardAssets/icons/right-arrow.svg";
button.appendChild(arrow);

const name = document.createElement('h1')
name.textContent = contact.contactType;
button.appendChild(name);
Expand Down
15 changes: 15 additions & 0 deletions cardAssets/icons/right-arrow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1c1c3a5

Please sign in to comment.