Skip to content

Commit

Permalink
link formatting, added website
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielRedacted committed Sep 17, 2024
1 parent 604a093 commit a0c8d81
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 41 deletions.
51 changes: 12 additions & 39 deletions card.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@
overflow-y: scroll;
}

@media (orientation: landscape) {
body {
max-width: 3.5in;
margin: auto;
}
}

#card {
border-radius:8px; margin:0; background-color:#222; width:100%; aspect-ratio: 3.5/2
}
Expand Down Expand Up @@ -135,6 +142,7 @@
background-color: #222;
color:white;
border-radius: 8px;
text-decoration: none;
}
.row > a h1 {
margin:0;
Expand Down Expand Up @@ -170,55 +178,20 @@ <h2 id="header">Let's connect</h2>
<div class="row">
<button style="box-shadow: 0 2px 0 0 gray; color:white; font-weight:bold; background-color: #444; border:none; border-radius:8px; margin:8px; height:44px; flex:1;">Save Contact</button>
</div>
<div class="row">
<!-- <div class="row">
<a>
<div class="icon"></div>
<h1>Phone</h1>
<p>(000)000-0000</p>
</a>
</div>
<div class="row"></div>
</div> -->

<script>
// Function to fetch contact data from contacts.json and render it on the webpage
async function fetchAndRenderContacts() {
try {
const response = await fetch('cardAssets/contacts.json'); // Fetch the JSON file
const contactData = await response.json(); // Parse the JSON data
// const contactData = {
// "contacts": [
// {
// "contactType": "Email",
// "display": true,
// "value": "[email protected]",
// "link": "mailto:[email protected]"
// },
// {
// "contactType": "Phone",
// "display": true,
// "value": "+1-000-000-0000",
// "link": "tel:+10000000000"
// },
// {
// "contactType": "LinkedIn",
// "display": true,
// "value": "LinkedIn Profile",
// "link": "https://www.linkedin.com/in/username"
// },
// {
// "contactType": "X",
// "display": true,
// "value": "@DanielRedacted",
// "link": "https://x.com/DanielRedacted"
// },
// {
// "contactType": "Instagram",
// "display": true,
// "value": "@DanielRedacted",
// "link": "https://www.instagram.com/DanielRedacted"
// }
// ]
// }

const contactData = await response.json(); // Parse the JSON data
const contactList = document.querySelector('body'); // Get the HTML element to display contact info

// Iterate over the contacts and display
Expand Down
10 changes: 8 additions & 2 deletions cardAssets/contacts.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
{
"contacts": [
{
"contactType": "Website",
"display": true,
"value": "DanielRedacted.net",
"link": "https://DanielRedacted.net"
},
{
"contactType": "Email",
"display": true,
"value": "Him@DanielRedacted.com",
"link": "mailto:Him@DanielRedacted.com"
"value": "Him@DanielRedacted.net",
"link": "mailto:Him@DanielRedacted.net"
},
{
"contactType": "Phone",
Expand Down

0 comments on commit a0c8d81

Please sign in to comment.