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 Skypack, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ES6 import
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.
<div>
<h2>Basic Usage</h2>
<pre>
<code class="js">
var hive = new SupportBeeHive({ company: 'muziboodemo' });
hive.init({ widget: 'contact', forwarding_address_id: 314 });
</code>
</pre>
<p>The <code>SupportBeeHive</code> constructor requires a <code>company</code> parameter. So far that's the only parameter the constructor expects.<p>
<br>
<h2>Configuration</h2>
<p>These are all the available options for the <code>init</code> method:</p>
<table width="1080px">
<thead>
<th>
<tr>
<td width="200px">Name</td>
<td with="300px">Default</td>
<td>Available options, description</td>
</tr>
</th>
</thead>
<tbody>
<tr>
<td width="200px">widget</td>
<td width="200px"><code>null</code></td>
<td><code>"kb"</code> or <code>"contact"</code></td>
</tr>
<tr>
<td>theme</td>
<td><code>"rgb(123, 22, 255)"</code></td>
<td>Any string that represents a valid CSS color. It can be represented in rgb, hex, hsl, etc. It is used for creating the background color of the launcher and the submit button if the widget type is "contact".</td>
</tr>
<tr>
<td>locale</td>
<td><code>"en"</code></td>
<td><code>"de"</code>, <code>"en"</code>, <code>"es"</code>, <code>"fr"</code>, <code>"pt-BR"</code>, <code>"nl"</code>, <code>"pl"</code>, <code>"ru"</code>, <code>"sv-SE"</code> or <code>"vi"</code>.</td>
</tr>
<tr>
<td>launcher.hint</td>
<td><code>null</code></td>
<td>Optional content used for a button positioned at the side of the main launcher.</td>
</tr>
<tr>
<td>launcher.icon</td>
<td><code>null</code></td>
<td>String representing an SVG element. Watch out the size of the SVG element, has to be tuned to fit into the button, otherwise might not be displayed properly. A height and width between 22px and 30px is recommended.</td>
</tr>
<tr>
<td width="200px">launcher.position</td>
<td width="200px"><code>"right-bottom"</code></td>
<td><code>"top-left"</code>, <code>"left-top"</code>, <code>"top-right"</code>, <code>"right-top"</code>, <code>"right-bottom"</code>, <code>"bottom-right"</code>, <code>"left-bottom"</code> or <code>"bottom-left"</code></td>
</tr>
<tr>
<td>launcher.openEl</td>
<td><code>null</code></td>
<td>Custom HTML element to toggle the widget.</td>
</tr>
<tr>
<td>launcher.hidden</td>
<td><code>false</code></td>
<td>Hide the open button and the hint of the widget. Useful to open the widget from a custom HTML element. The close icon will still be displayed.</td>
</tr>
<tr>
<td>forwarding_address_id</td>
<td><code>null</code></td>
<td>Number or string, effective <b>only if the widget option is <code>"contact"</code>.</b></td>
</tr>
<tr>
<td>requireCaptcha</td>
<td><code>false</code></td>
<td>Boolean value to set either the , effective <b>only if the widget option is <code>"contact"</code>.</b></td>
</tr>
<tr>
<td>site</td>
<td><code>null</code></td>
<td>Name of the SB KB site, effective <b>only if the widget option is <code>"kb"</code>.</b></td>
</tr>
<tr>
<td>forwarding_address_id</td>
<td><code>null</code></td>
<td>Number or string, effective <b>only if the widget option is <code>"contact"</code>.</b></td>
</tr>
<tr>
<td>requireCaptcha</td>
<td><code>false</code></td>
<td>Boolean value to enable or disable the captach in the contact form, therefore it is effective <b>only if the widget option is <code>"contact"</code>.</b></td>
</tr>
<tr>
<td>defaults</td>
<td><code>{ requester_name: '', requester_email: '', subject: '', message: '' }</code></td>
<td>Default values for the contact form, therefore it is effective <b>only if the widget option is <code>"contact"</code>.</b></td>
</tr>
</tbody>
</table>
</div>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.13.1/styles/tomorrow-night.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.13.1/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
body,
html {
font-size: 15px;
}
p,
table,
h1,
h2 {
font-family: Arial;
margin-bottom: 1rem;
}
table thead {
font-weight: bold;
}
table tr td {
border-bottom: 1px solid #EEE;
padding: 0.5rem;
}
div {
padding: 2rem;
}
(function(p,src) {
var script = p.createElement('script');
script.src = src;
script.async = true;
script.onload = function() {
new SupportBeeHive({ company: 'muziboodemo' }).init({
widget: 'contact',
locale: 'de',
forwarding_address_id: 38,
defaults: {
requester_name: 'Default customer name',
},
launcher:{
hint: 'Contact us',
icon: '<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 300 300" width="32px" height="32px"><g><g><path d="M149.996,0C67.157,0,0.001,67.161,0.001,149.997S67.157,300,149.996,300s150.003-67.163,150.003-150.003 S232.835,0,149.996,0z M221.302,107.945l-14.247,14.247l-29.001-28.999l-11.002,11.002l29.001,29.001l-71.132,71.126 l-28.999-28.996L84.92,186.328l28.999,28.999l-7.088,7.088l-0.135-0.135c-0.786,1.294-2.064,2.238-3.582,2.575l-27.043,6.03 c-0.405,0.091-0.817,0.135-1.224,0.135c-1.476,0-2.91-0.581-3.973-1.647c-1.364-1.359-1.932-3.322-1.512-5.203l6.027-27.035 c0.34-1.517,1.286-2.798,2.578-3.582l-0.137-0.137L192.3,78.941c1.678-1.675,4.404-1.675,6.082,0.005l22.922,22.917 C222.982,103.541,222.982,106.267,221.302,107.945z" fill="white"/></g></g></svg>',
},
theme: 'blue',
});
};
p.head.appendChild(script);
})(document, 'https://d3932137p5ikt7.cloudfront.net/widget_v4/hive.js');
Also see: Tab Triggers