HTML preprocessors can make writing HTML more powerful or convenient. For instance, Markdown is designed to be easier to write and read for text documents and you could write a loop in Pug.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. So you don't have access to higher-up elements like the <html>
tag. If you want to add classes there that can affect the whole document, this is the place to do it.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. If you need things in the <head>
of the document, put that code here.
The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https.
CSS preprocessors help make authoring CSS easier. All of them offer things like variables and mixins to provide convenient abstractions.
It's a common practice to apply CSS to a page that styles elements such that they are consistent across all browsers. We offer two of the most popular choices: normalize.css and a reset. Or, choose Neither and nothing will be applied.
To get the best cross-browser support, it is a common practice to apply vendor prefixes to CSS properties and values that require them to work. For instance -webkit-
or -moz-
.
We offer two popular choices: Autoprefixer (which processes your CSS server-side) and -prefix-free (which applies prefixes via a script, client-side).
Any URLs added here will be added as <link>
s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.
You can apply CSS to your Pen from any stylesheet on the web. Just put a URL to it here and we'll apply it, in the order you have them, before the CSS in the Pen itself.
You can also link to another Pen here (use the .css
URL Extension) and we'll pull the CSS from that Pen and include it. If it's using a matching preprocessor, use the appropriate URL Extension and we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
JavaScript preprocessors can help make authoring JavaScript easier and more convenient.
Babel includes JSX processing.
Any URL's added here will be added as <script>
s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
Search for and use JavaScript packages from npm here. By selecting a package, an import
statement will be added to the top of the JavaScript editor for this package.
Using packages here is powered by esm.sh, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ESM usage.
All packages are different, so refer to their docs for how they work.
If you're using React / ReactDOM, make sure to turn on Babel for the JSX processing.
If active, Pens will autosave every 30 seconds after being saved once.
If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.
If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.
Visit your global Editor Settings.
<head>
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js' type='text/javascript'></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css" />
<link href="https://fonts.googleapis.com/css2?family=Padauk:wght@700&display=swap" rel="stylesheet"/>
</head>
<body>
<div class='popup-wrapper' id='buyWhatsApp'>
<div class='popup-container'>
<div class='container-contact100'>
<div class='wrap-contact100'>
<h2 class='title-beli'>
<span class='data-form-title'>
<i class='fab fa-whatsapp'></i> Pesan via <b>WhatsApp</b></span>
</h2>
<!--=== HTML Form WhatsApp | @rian_seo ===-->
<div class='data-form validate-form' id='whatsapp'>
<ul class='orderBank'>
<!--=== HTML Pilihan Produk ===-->
<section class='tabs'>
<!--=== HTML Pilihan (1) ===-->
<input checked='checked' class='tab-selector-1' id='tab-1' name='radio-set' type='radio'/>
<label class='tab-label-1' for='tab-1'>Produk 1</label>
<!--=== HTML Pilihan (2) ===-->
<input class='tab-selector-2' id='tab-2' name='radio-set' type='radio'/>
<label class='tab-label-2' for='tab-2'>Produk 2</label>
<!--=== HTML Pilihan (3) ===-->
<input class='tab-selector-3' id='tab-3' name='radio-set' type='radio'/>
<label class='tab-label-3' for='tab-3'>Produk 3</label>
<!--=== HTML Data Produk ===-->
<div class='content'>
<!--=== HTML Produk (1) ===-->
<div class='content-1'>
<span><b>Nama Produk :</b></span><span>Baju</span>
<span><b>Warna Produk :</b></span><span>Biru</span>
<span><b>Ukuran Produk :</b></span><span> M</span>
</div>
<!--=== HTML Produk (2) ===-->
<div class='content-2'>
<span><b>Nama Produk :</b></span><span>Celana</span>
<span><b>Warna Produk :</b></span>
<span>Merah</span>
<span><b>Ukuran Produk :</b></span>
<span>XL</span>
</div>
<!--=== HTML Produk (3) ===-->
<div class='content-3'>
<span><b>Nama Produk :</b></span><span>Sepatu</span>
<span><b>Warna Produk :</b></span><span>Putih</span>
<span><b>Ukuran Produk :</b></span><span>40</span>
</div>
</div>
</section>
</ul>
<!--=== HTML Pilihan Pembayaran ===-->
<input class='tujuan' id='noAdmin' type='hidden'/>
<label class='formWhatsApp'>
<i class='fa fa-angle-down'></i>
<select class='licensi wajib' placeholder='Pembayaran'>
<option hidden='hidden' selected='selected' value='default'>Pilih Pembayaran</option>
<!--=== HTML Data Pembayaran ===-->
<optgroup label='Pilih Pembayaran'>
<option value='Nama Bank 1 | 1234567'>Nama Bank 1 | 123456789</option>
<option value='Nama Bank 2 | 123456789'>Nama Bank 2 | 123456789</option>
</optgroup>
</select>
</label>
<!--=== HTML Table Form Pesanan ===-->
<div class='gridWhatsApp'>
<label class='item'>
<!--=== From Nama ===-->
<i class='fa fa-user-circle'></i>
<input class='nama wajib' placeholder='Nama..' type='text'/>
</label>
<label class='item'>
<!--=== From Email ===-->
<i class='fa fa-envelope'></i>
<input class='email wajib' placeholder='Email..' type='text'/>
</label>
</div>
<br/>
<!--=== HTML Table Form (2) ===-->
<div class='gridWhatsApp'>
<label class='item'>
<!--=== From Nomor WhatsApp ===-->
<i class='fab fa-whatsapp'></i>
<input class='nomor wajib' placeholder='WhatsApp..' type='tel'/>
</label>
<label class='item'>
<!--=== From Nama Kota ===-->
<i class='fa fa-university'></i>
<input class='kota wajib' placeholder='Kota..' type='url'/>
</label>
</div>
<!--=== HTML Opsi Form Produk ===-->
<label class='formWhatsApp'>
<i class='fa fa-angle-down'></i>
<select class='pembayaran wajib' placeholder='Pembayaran'>
<option hidden='hidden' selected='selected' value='default'>Pilihan Produk</option>
<optgroup label='Pilihan Produk'>
<option value='Produk 1'>Produk 1</option>
<option value='Produk 2'>Produk 2</option>
<option value='Produk 3'>Produk 3</option>
</optgroup>
</select>
</label>
<label class='formWhatsApp'>
<i class='fa fa-angle-down'></i>
<select class='informasi wajib' placeholder='Informasi'>
<option hidden='hidden' selected='selected' value='default'>Dapat Info dari?</option>
<optgroup label='Dapat Info dari?'>
<option value='Google'>Google</option>
<option value='Facebook'>Facebook</option>
<option value='Email'>WhatsApp</option>
<option value='Instagram'>Instagram</option>
<option value='Email'>Email</option>
</optgroup>
</select>
</label>
<div class='sendWhatsApp'>
<div class='sendWAcolor'>
<div class='sendWAbuttom'/>
<a class='sendWAclik submit' onclick='redirect('/p/terimakasih.html')'>Kirim</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
body {font:600 16px Padauk,sans-serif}
#buyWhatsApp {position:relative;top:0;margin:0;}
#buyWhatsApp{background-color:rgba(0,0,0,0.5);position:fixed!important;display:flex!important;top:0;left:0;right:0;bottom:0;margin:0;width:100%;height:100%;overflow-y:auto;padding:10px 0;z-index:99999999999;-webkit-transition:.2s;-moz-transition:.2s;transition:.2s}
.formWhatsApp {position: relative;
display: block;
width: 100%;
margin: 10px 0;
padding: 0;}
.gridWhatsApp {grid-template-columns: 1fr 1fr;display: grid;grid-gap: 10px;}
.gridWhatsApp .item {
position: relative;
display: block;
width: 100%;
margin:0;
padding: 0;
}
.gridWhatsApp .item input, .formWhatsApp select {position: relative;
z-index: 1;font-family: Roboto,sans-serif;font-size:13px;
border: none;outline:none;
box-shadow: inset 0 -1px 0 0 rgba(0,0,0,.08);
padding: 10px 15px;
width: 100%;
padding-left: 40px;
background: 0 0;box-sizing: border-box;}
.gridWhatsApp .item i, .formWhatsApp i {
position: absolute;
z-index: 0;
display: inline-block;
vertical-align: top;
width: 40px;
text-align: center;
font-size: 120%;
height: auto;
background: 0 0;
box-shadow: none;
top: 8px;
left: 0;
color: rgba(0,0,0,.2);
}
.formWhatsApp select {-webkit-appearance: none;
-moz-appearance: none;
-webkit-appearance: none;
appearance:none;
text-align:left;}
.orderBank {color:#626262;background: #f1f1f1;
list-style: none;
margin: 0 0 25px;
padding: 13px 20px;}
.orderBank i {font-size:90%}
input[type="radio" i] {
background-color: initial;
cursor: default;
-webkit-appearance: radio;
box-sizing: border-box;
margin: 3px 3px 0 5px;
padding: initial;
border: initial;
}
.tabs .tab-selector-1:checked~.content .content-1, .tabs .tab-selector-2:checked~.content .content-2, .tabs .tab-selector-3:checked~.content .content-3 {
opacity: 1;
display:grid;grid-gap:8px;
height: auto;grid-template-columns:1fr 1fr;
width: 100%;
height: auto;
padding: 10px;
}
.content-1, .content-2, .content-3 {
position: relative;
width: 0;display: flex;
height: 0;
box-sizing: border-box;
top: 0;
left: 0;
z-index: 1;
opacity: 0;
}
@media (min-width: 768px){
.popup-container, .container-contact100{width:calc(100% - 20px);}}
@media (max-width: 767px){
.popup-container, .container-contact100 {width:calc(100% - 20px);}}
.popup-container{display:block;margin:auto auto}
a.closeWhatsApp{display:block;color:#aaa;padding:0 20px;cursor:pointer;font-size:30px;font-weight:300;transition:.2s}
/* CSS POP-ICE */
.popup-form{margin:10px auto}
.popup-form h2{margin-bottom:5px;font-size:37px;text-transform:uppercase}
.popup-form .input-group{margin:10px auto}
.popup-form .input-group input{padding:17px;text-align:center;margin-bottom:10px;border-radius:3px;font-size:16px;display:block;width:100%}
.popup-form .input-group input:focus{outline-color:#fb8833}
.popup-form .input-group input[type="email"]{border:0;position:relative}
.popup-form .input-group input[type="submit"]{background-color:#fb8833;color:#fff;border:0;cursor:pointer}
.popup-form .input-group input[type="submit"]:focus{box-shadow:inset 0 3px 7px 3px #ea7722}
/* FORM */
a:focus {outline: none !important;}
a:hover {text-decoration: none;}
p {font-size: 14px;line-height: 1.7;color: #666666;margin:0px;}
input, textarea {outline: none;border: none;}
input:focus::-webkit-input-placeholder {color: transparent;}
input:focus:-moz-placeholder {color: transparent;}
input:focus::-moz-placeholder {color: transparent;}
input:focus:-ms-input-placeholder {color: transparent;}
input::-webkit-input-placeholder {color: #adadad;}
input:-moz-placeholder {color: #adadad;}
input::-moz-placeholder {color: #adadad;}
input:-ms-input-placeholder {color: #adadad;}
textarea::-webkit-input-placeholder {color: #adadad;}
textarea:-moz-placeholder {color: #adadad;}
textarea::-moz-placeholder {color: #adadad;}
textarea:-ms-input-placeholder {color: #adadad;}
button {outline: none !important;border: none;background: transparent;}
button:hover {cursor: pointer;}
iframe {border: none !important;}
/* Contact */
.container-contact100{width:550px;margin:auto;display:block;padding:0;background:#fff;border-radius:4px}
.wrap-contact100{width:550px;overflow:hidden;padding:0;display:block;border-radius:4px}
.data-form{box-sizing: border-box;width:100%;background:#fff;margin:0;padding:0 20px;overflow-y:auto;display:block;max-height:calc(100vh - 80px)}
.title-beli{display:grid;width:100%;grid-template-columns:1fr auto;grid-column-gap:10px;margin:0;height:60px;line-height:60px;font-size:14px;background:#fff;font-weight:400}
.data-form-title{padding:0 20px;display:block;vertical-align:middle;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#444;font-size:110%}
.data-form-title .fa-whatsapp {color:#0CC243}
.rianseo-area{display:grid;grid-template-columns:1fr auto;grid-gap:10px;padding:20px;width:calc(100% + 40px);margin-left:-20px;margin-top:-20px;margin-bottom:20px}
/* Input */
.wrap-input100{width:100%;position:relative;padding:0;display:grid;grid-gap:10px;grid-template-columns:1fr 1fr;margin-bottom:10px}
.label-input100{font-family:Helvetica,sans-serif;font-size:13px;color:#666;font-weight:700;line-height:1.5;padding:0}
.input100{display:block;width:100%;background:transparent;border:0;font-size:13px;box-shadow:inset 0 -1px 0 0 rgba(0,0,0,.08);color:#333;line-height:1.2;padding:10px 0}
.focus-input100{position:absolute;display:block;width:100%;height:100%;top:0;left:0;pointer-events:none}
.focus-input100::before{content:"";display:block;position:absolute;bottom:-2px;left:0;width:0;height:2px;-webkit-transition:all .4s;-o-transition:all .4s;-moz-transition:all .4s;transition:all .4s;background:#7f7f7f}
input.input100 {}
textarea.input100 {padding-top: 9px;padding-bottom: 13px;}
.input100:focus+.focus-input100::before {width: 100%;}
.has-val.input100+.focus-input100::before {width: 100%;}
/* Button */
.sendWhatsApp {display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;flex-wrap:wrap;justify-content:center;padding:0}
.sendWAcolor {width:100%;display:block;position:relative;z-index:1;overflow:hidden;margin:10px 0 15px 0}
.sendWAbuttom {position:relative;margin-bottom:10px;z-index:-1;-webkit-transition:all .4s;-o-transition:all .4s;-moz-transition:all .4s;transition:all .4s}
.sendWAclik{cursor:pointer;display:block!important;border:0;text-align:center!important;padding:10px 20px!important;font-size:105%;font-weight:700!important;background:#4CAF50;color:#fff!important;box-shadow:inset 0 -3px 0 0 rgba(0,0,0,.08)}
.sendWAcolor:hover .sendWAbuttom {left: 0;}
/* Responsive */
@media (max-width: 576px) {.wrap-contact100 {width:100%;display:block;}
.container-contact100 {width:100%;}
.sendWhatApp {padding:0;}}
//<![CDATA[
$('#noAdmin').val('0858-8662-4531');// Nomor Tujuan
$('.whatsapp-btn').click(function () {
$('#whatsapp').toggleClass('toggle');});
// Fungsi Tombol Whatsapp Kirim!
$('#whatsapp .submit').click(WhatsApp);
$("#whatsapp input, #whatsapp textarea").keypress(function () {
if (event.which == 13) WhatsApp();
});
var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
// Fungsi Data Tulisan yang dikirim
function WhatsApp() {
var ph = '';
if ($('#whatsapp .nama').val() == '') { // Cek Nama
ph = $('#whatsapp .nama').attr('placeholder');
alert('Silahkan tulis ' + ph);
$('#whatsapp .nama').focus();
return false;
} else if ($('#whatsapp .email').val() == '') { // Cek email
ph = $('#whatsapp .email').attr('placeholder');
alert('Silahkan tulis ' + ph);
$('#whatsapp .website').focus();
return false;
} else if ($('#whatsapp .nomor').val() == '') { // Cek nomor
ph = $('#whatsapp .nomor').attr('placeholder');
alert('Silahkan tulis ' + ph);
$('#whatsapp .nomor').focus();
return false;
} else if ($('#whatsapp .kota').val() == '') { // Cek kota
ph = $('#whatsapp .kota').attr('placeholder');
alert('Silahkan tulis ' + ph);
$('#whatsapp .email').focus();
return false;
} else if ($('#whatsapp .licensi').val() == '') { // Cek licensi
ph = $('#whatsapp .licensi').attr('placeholder');
alert('Silahkan pilih ' + ph);
$('#whatsapp .licensi').focus();
return false;
} else if ($('#whatsapp .pembayaran').val() == '') { // Cek bayar
ph = $('#whatsapp .pembayaran').attr('placeholder');
alert('Silahkan pilih ' + ph);
$('#whatsapp .pembayaran').focus();
return false;
} else if ($('#whatsapp .informasi').val() == '') { // Cek dari
ph = $('#whatsapp .informasi').attr('placeholder');
alert('Silahkan pilih ' + ph);
$('#whatsapp .informasi').focus();
return false;
} else {
// Check Device (Mobile/Desktop)
var url_wa = 'https://web.whatsapp.com/send';
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
url_wa = 'whatsapp://send/';
}
// Get Value
var tujuan = $('#whatsapp .tujuan').val(),
via_url = location.href,
licensi =$('#whatsapp .licensi').val(),
nama = $('#whatsapp .nama').val(),
email = $('#whatsapp .email').val(),
nomor = $('#whatsapp .nomor').val(),
kota = $('#whatsapp .kota').val(),
pembayaran = $('#whatsapp .pembayaran').val(),
informasi = $('#whatsapp .informasi').val();
$(this).attr('href', url_wa + '?phone=62 ' + tujuan + '&text=' +
' %2ALicensi%2A: ' + licensi + '%0A' +
'_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _%0A' +
' %0A%2ANama%2A: ' + nama +
' %0A%2AEmail%2A: ' + email +
' %0A%2ANomor WhatsApp%2A: ' + nomor +
' %0A%2AKota%2A: ' + kota + '%0A' +
'_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _%0A%0A' +
' %0A%2AMetode Pembayaran%2A: ' + pembayaran + '%0A' +
' %0A%2ASaya dapat informasi dari%2A: ' + informasi + '%0A' +
' %0A%2ADari%2A ' + via_url);
var w = 960,
h = 540,
left = Number((screen.width / 2) - (w / 2)),
tops = Number((screen.height / 2) - (h / 2)),
popupWindow = window.open(this.href, '', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=1, copyhistory=no, width=' + w + ', height=' + h + ', top=' + tops + ', left=' + left);
popupWindow.focus();
return false;
}
}//]]>
Also see: Tab Triggers