style = id => `
@keyframes ${id}-flash {
0% { opacity: 0 }
}
@keyframes ${id}-wiggle {
${(100 / 6) * 0}% { left: 0 }
${(100 / 6) * 1}% { left: 1em }
${(100 / 6) * 2}% { left: 0 }
${(100 / 6) * 3}% { left: -1em }
${(100 / 6) * 4}% { left: 0 }
${(100 / 6) * 5}% { left: 1em }
${(100 / 6) * 6}% { left: 0 }
}
#${id} {
--color: hsl(150,0%,60%);
--bg: hsla(150,0%,60%,50%);
width: 100%;
box-sizing: border-box;
height: 350px;
max-width: 100%;
padding: 50px;
border: 3px solid var(--color);
border-radius: 1vmin;
background: repeating-linear-gradient(-45deg, transparent 0 50px, var(--bg) 0 100px);
outline: none;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}
#${id}:focus, #${id} button { --color: hsl(224, 53%, 49%); --bg: hsla(224, 53%, 49%, 50%); }
#${id}.invalid { --color: hsl(0, 53%, 49%); --bg: hsla(0, 53%, 49%, 50%); }
#${id}:focus::before { content: "Paste away!"; }
#${id}::before, #${id} button {
content: "click or drop";
display: inline-block;
vertical-align: middle;
text-align: center;
font-size: 1.5em;
font-family: sans-serif;
color: white;
background: var(--color);
font-weight:bold;
text-transform: uppercase;
padding: .2em .5em;
border-radius: 20px;
position: relative;
border: none;
}
#${id}.invalid::before, #${id}.invalid button {
animation: 0.3s ease-out ${id}-wiggle;
content: attr(data-error-message);
}
#${id} button {
margin-top: 1em;
cursor: pointer;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}
.${id}-or {
font-family: sans-serif;
text-transform: uppercase;
font-size: 1.5em;
margin-top: 1em;
color: #666;
}
`