<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<main class="example example-1">
<div class="field half">
<input type="text" placeholder="Some field" />
</div>
<div class="field half">
<input type="text" placeholder="Some field" />
</div>
<div id="container"></div>
<button>Submit Payment</button>
</main>
<script src="https://js-sandbox.dlocal.com"></script>
<script>
const dlocalInstance = dlocal('some-key');
const fields = dlocalInstance.fields({
country: 'AR',
locale: 'es',
fonts: [{
cssSrc: 'https://rsms.me/inter/inter-ui.css'
}]
});
const cardField = fields.create('card', {
style: {
base: {
fontSize: "16px",
fontFamily: "'Inter UI medium', sans-serif",
lineHeight: '18px',
fontSmoothing: 'antialiased',
fontWeight: '500',
color: "#32325d",
'::placeholder': {
color: "#aab7c4"
},
iconColor: "#adbfd3"
}
}
});
cardField.mount(document.getElementById('container'));
</script>
</body>
</html>
body {
background: #f6f9fc;
}
* {
box-sizing: border-box;
}
.field {
margin-bottom: 15px;
color: #333333;
}
.field.half {
display: inline-block;
width: calc(50% - 12px);
vertical-align: top;
}
.field.half {
margin-right: 9.5px;
}
.field.half+.half {
margin-left: 9.5px;
margin-right: 0px;
}
.field label {
display: block;
font-size: 14px;
margin-bottom: 6px;
}
.example {
margin-top: 50px;
margin-left: auto;
margin-right: auto;
max-width: 550px;
padding-bottom: 20px;
}
.example::after {
content: "";
clear: both;
display: table;
}
.example-1 input {
font-family: 'Inter UI medium', sans-serif;
display: block;
font-size: 16px;
width: 100%;
border: none;
height: 40px;
padding: 0px 14px;
box-shadow: 0 1px 3px 0 #e6ebf1;
border-radius: 4px;
background: white;
outline: none;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.example-1 input::-moz-placeholder {
color: #aab7c4;
}
.example-1 input::-webkit-input-placeholder {
color: #aab7c4;
}
.example-1 button {
border: none;
border-radius: 4px;
outline: none;
text-decoration: none;
float: right;
color: #fff;
background: #32325d;
white-space: nowrap;
height: 40px;
line-height: 40px;
padding: 0 14px;
box-shadow: 0 4px 6px rgba(50, 50, 93, .11), 0 1px 3px rgba(0, 0, 0, .08);
border-radius: 4px;
font-size: 15px;
font-weight: 600;
letter-spacing: 0.025em;
text-decoration: none;
margin-top: 20px;
-webkit-transition: all 150ms ease;
transition: all 150ms ease;
margin-left: 12px;
}
#container {
height: 40px;
}
.DlocalField {
background-color: white;
height: 40px;
padding: 10px 12px;
border-radius: 4px;
border: 1px solid transparent;
box-shadow: 0 1px 3px 0 #e6ebf1;
-webkit-transition: box-shadow 150ms ease;
transition: box-shadow 150ms ease;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.