Skip to content

Commit

Permalink
name, headline, bio from .json
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielRedacted committed Sep 19, 2024
1 parent da9adf3 commit 939553f
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 53 deletions.
108 changes: 58 additions & 50 deletions card.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="theme-color" content="#000000">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<!-- <meta name="apple-mobile-web-app-status-bar-style" content="black"> -->
<meta name="apple-mobile-web-app-capable" content="yes">


<title>BizCard</title>

<link rel="apple-touch-icon" sizes="180x180" href="/favicons/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicons/favicon-16x16.png">
Expand All @@ -18,43 +17,43 @@
<style>
* {
box-sizing: border-box;
}
html {
height: 100vh;
width: 100vw;
margin:0;
padding:0;
}
html {
height: 100vh;
width: 100vw;
margin:0;
padding:0;

background-color: black;
color:black;

-ms-overflow-style: none; /* Internet Explorer, Edge */
scrollbar-width: none; /* Firefox */
overflow-x: hidden;
overscroll-behavior: contain;
}
::-webkit-scrollbar {
display: none; /* Chrome, Safari, Opera */
}
body {
/* background-color: black; */
color:white;
width: 100%;
height:100vh;
margin:0;
padding:4px;
background-color: black;
color:black;
-ms-overflow-style: none; /* Internet Explorer, Edge */
scrollbar-width: none; /* Firefox */
overflow-x: hidden;
overscroll-behavior: contain;
}
::-webkit-scrollbar {
display: none; /* Chrome, Safari, Opera */
}
body {
/* background-color: black; */
color:white;
width: 100%;
height:100vh;
margin:0;
padding:4px;

font-family: Helvetica, Arial, sans-serif;
font-size: 12pt;
font-family: Helvetica, Arial, sans-serif;
font-size: 12pt;

/* display:flex;
flex-direction: column;
align-content: center;
justify-content: center; */
/* display:flex;
flex-direction: column;
align-content: center;
justify-content: center; */

overflow-x: hidden;
overflow-y: scroll;
}
overflow-x: hidden;
overflow-y: scroll;
}

@media (orientation: landscape) {
body {
Expand Down Expand Up @@ -97,7 +96,7 @@
font-size: 14pt;
font-weight: bold;
}
#card #header {
#card #headline {
margin-bottom:4px;
font-size: 12pt;
font-weight: normal;
Expand Down Expand Up @@ -199,10 +198,8 @@
<img id="picture" src="cardAssets/profile.jpg"/>
</div>
<h1 id="name">Daniel ████</h1>
<h2 id="header">Let's connect</h2>
<pre id="bio">Engineer
Autonomy Specialist
</pre>
<h2 id="headline">Let's connect</h2>
<pre id="bio"></pre>
<div id="interests">
<div class="interest">Engineer</div>
<div class="interest">Entrepreneur</div>
Expand Down Expand Up @@ -230,6 +227,10 @@ <h1>Phone</h1>
</div> -->

<script>
const fullName = document.getElementById("name");
const headline = document.getElementById("headline");
const bio = document.getElementById("bio");

// Function to fetch the SVG file content
async function fetchSVG(svgPath) {
try {
Expand All @@ -248,6 +249,13 @@ <h1>Phone</h1>
const contactData = await response.json(); // Parse the JSON data
const contactList = document.querySelector('body'); // Get the HTML element to display contact info

for (const profile of contactData.profile) {
fullName.innerHTML = profile.name;
document.title = profile.name;
headline.innerHTML = profile.headline;
bio.innerHTML = bio.headline;
}

// Iterate over the contacts and display using a for...of loop to allow async/await in the loop
for (const contact of contactData.contacts) {
if (contact.display && contact.value) {
Expand Down Expand Up @@ -303,17 +311,17 @@ <h1>Phone</h1>

// Function to request fullscreen
function requestFullscreen() {
const elem = document.documentElement; // This selects the <html> element (the entire document)
const elem = document.documentElement; // This selects the <html> element (the entire document)

if (elem.requestFullscreen) {
elem.requestFullscreen();
} else if (elem.mozRequestFullScreen) { // Firefox
elem.mozRequestFullScreen();
} else if (elem.webkitRequestFullscreen) { // Chrome, Safari, and Opera
elem.webkitRequestFullscreen();
} else if (elem.msRequestFullscreen) { // IE/Edge
elem.msRequestFullscreen();
}
if (elem.requestFullscreen) {
elem.requestFullscreen();
} else if (elem.mozRequestFullScreen) { // Firefox
elem.mozRequestFullScreen();
} else if (elem.webkitRequestFullscreen) { // Chrome, Safari, and Opera
elem.webkitRequestFullscreen();
} else if (elem.msRequestFullscreen) { // IE/Edge
elem.msRequestFullscreen();
}
}

requestFullscreen();
Expand Down
6 changes: 3 additions & 3 deletions cardAssets/contacts.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"details": [{
"name": "",
"header": "",
"bio": "",
"name": "Firstname Lastname",
"headline": "Headline",
"bio": "Your bio.",
"interests": ""
}],

Expand Down

0 comments on commit 939553f

Please sign in to comment.