Update MECARD

This commit is contained in:
Nicholas Jitkoff 2023-05-29 08:14:38 +02:00
parent 828ee60743
commit 7b1b0bc863
2 changed files with 31 additions and 14 deletions

View file

@ -13,15 +13,6 @@
0px 1.5px 1.7px -0.8px hsl(var(--shadow-color) / 0.36),
0px 3.8px 4.3px -1.7px hsl(var(--shadow-color) / 0.36),
-0.1px 9.4px 10.6px -2.5px hsl(var(--shadow-color) / 0.36);
--shadow-elevation-high:
0px 0.5px 0.6px hsl(var(--shadow-color) / 0.34),
0px 2.7px 3px -0.4px hsl(var(--shadow-color) / 0.34),
0px 5.1px 5.7px -0.7px hsl(var(--shadow-color) / 0.34),
-0.1px 8.4px 9.5px -1.1px hsl(var(--shadow-color) / 0.34),
-0.1px 13.4px 15.1px -1.4px hsl(var(--shadow-color) / 0.34),
-0.2px 20.9px 23.5px -1.8px hsl(var(--shadow-color) / 0.34),
-0.2px 31.8px 35.8px -2.1px hsl(var(--shadow-color) / 0.34),
-0.4px 46.8px 52.7px -2.5px hsl(var(--shadow-color) / 0.34);
}
body {
@ -33,12 +24,27 @@ body {
min-height:100vh;
}
#arc-theme {
background:
linear-gradient(0deg, var(--arc-background-gradient-overlay-color1) 0%, transparent 100%),
linear-gradient(90deg, var(--arc-background-gradient-color0) 0%, var(--arc-background-gradient-color1) 100%);
position:fixed;
z-index:-1;
top:0;
left:0;
right:0;
bottom:0;
opacity: 1.0;
pointer-events: none;
}
.contact {
background-color: white;
width:320px;
height:518px;
box-shadow: var(--shadow-elevation-medium);
margin-bottom:20vh;
margin-top:4vh;
padding-top:24px;
border-radius:3px;
display:flex;
@ -50,13 +56,15 @@ body {
.header {
flex: 1 1 auto;
padding-top:1em;
}
.icon {
order:1;
order:-1;
padding: 12px 0;
margin-right:32px;
}
.row {
@ -64,7 +72,7 @@ body {
text-decoration:none;
color:black;
flex-direction: row;
border-top:1px solid #eee;
/* border-top:1px solid #eee; */
min-height:48px;
align-items: center;
}
@ -77,15 +85,19 @@ body {
}
a, h1, div.memo {
padding: 0 12px;
padding: 0 24px;
margin:0;
}
div.memo {
opacity:0.5
}
h1 {
font-weight:normal;
font-size:24px;
}
.contact a:hover {
background-color: #eee;
background-color: #fafafa;
}

View file

@ -35,13 +35,18 @@ function render() {
)
)
} else if (params.body.match(/MECARD:/)){
let lines = decodeURIComponent(params.body.substring(7)).trim().replace(/\\n/g, "\n").replace(/\\:/g, "\:").split(";");
document.body.appendChild(el("#arc-theme"));
console.log("params.body", decodeURI(params.body))
let lines = decodeURIComponent(decodeURIComponent(params.body.substring(7))).trim().replace(/\\n/g, "\n").replace(/\\:/g, "\:").split(";");
let mecard = {}
lines.forEach(line => {
let parts = line.split(":");
mecard[parts.shift().toLowerCase()] = [parts.join(":")];
})
if (mecard.color) document.body.style.backgroundColor = mecard.color;
document.body.appendChild(
el("div.contact", {},
el("div.header", {},