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.
<base href="https://raw-dot-custom-elements.appspot.com/fooloomanzoo/datetime-picker/2.9.4/datetime-picker/">
<link rel="import" href="datetime-picker.html">
<link rel="import" href="overlay-date-picker.html">
<link rel="import" href="overlay-datetime-picker.html">
<link rel="import" href="overlay-time-picker.html">
<link rel="import" href="../iron-icons/iron-icons.html">
<link rel="import" href="../iron-icon/iron-icon.html">
<link rel="import" href="../paper-behaviors/paper-inky-focus-behavior.html">
<link rel="import" href="../paper-styles/default-theme.html">
<link rel="import" href="../paper-icon-button/paper-icon-button.html">
<link rel="import" href="../font-roboto/roboto.html">
<link rel="import" href="../app-layout/app-scroll-effects/app-scroll-effects.html">
<link rel="import" href="../app-layout/app-header/app-header.html">
<link rel="import" href="../app-layout/app-toolbar/app-toolbar.html">
<link rel="import" href="../app-layout/demo/sample-content.html">
<link rel="import" href="../app-layout/app-header-layout/app-header-layout.html">
<link rel="import" href="../app-layout/app-box/app-box.html">
<link rel="import" href="../app-layout/app-drawer-layout/app-drawer-layout.html">
<link rel="import" href="../app-layout/app-drawer/app-drawer.html">
<link rel="import" href="../iron-iconset-svg/demo/svg-sample-icons.html">
<custom-style>
<style is="custom-style">
app-drawer-layout {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
height: 100%;
background-color: transparent;
overflow: hidden;
box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
}
app-drawer {
--app-drawer-content-container: {
background-color: #252422;
color: #fff;
}
;
}
app-header {
background-color: #252422;
color: #fff;
}
app-box {
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
--app-box-background-front-layer: {
background-image: url(https://jazzinphoto.files.wordpress.com/2016/09/kind-of-blue-c2a9-jay-maisel.jpg);
background-repeat: no-repeat;
background-size: auto 100%;
}
;
}
datetime-picker,
overlay-time-picker,
overlay-datetime-picker,
overlay-date-picker {
vertical-align: middle;
font-size: 14px;
--input-background: #d5d5d5;
--input-color: #222;
--input-picker-background: #d5d5d5;
--input-picker-color: #222;
--input-focus-background: white;
--input-focus-color: #222;
--inner-input-focus-background: white;
--inner-input-focus-border-color: transparent;
--inner-input-focus-color: #222;
}
.last-listen overlay-datetime-picker {
--input-background: #82d5f4;
--input-color: #222;
--input-picker-background: #82d5f4;
--input-picker-color: #222;
--input-focus-background: #4285f4;
--input-focus-color: #f1f1f1;
}
.content paper-icon-button {
--paper-icon-button-ink-color: #1320fd;
color: #030200;
}
.content paper-icon-button.youtube {
--paper-icon-button-ink-color: #cc181e;
opacity: 0.8;
transition: color 250ms ease-in, opacity 150ms ease-in;
}
.content paper-icon-button.youtube:hover {
opacity: 1;
color: #cc181e;
}
.content {
margin: 64px 20% 120px;
padding: 32px 32px 60px;
min-width: 400px;
background-color: #fff;
color: #333;
box-shadow: 0 2px 3px 2px rgba(255, 255, 255, 0.14);
border-radius: 32px;
}
.artist-date {
@apply --layout-horizontal;
padding-bottom: 12px;
align-items: baseline;
}
.artist {
@apply --layout-flex;
}
time {
margin-left: 20px;
font-size: 13px;
color: #555;
}
summary {
padding: 1em 0;
font-size: 14px;
line-height: 1.5;
}
.song {
@apply --layout;
@apply --layout-center;
padding: 1em 0;
}
.song>.no {
width: 40px;
}
.song>.name {
@apply --layout-flex;
padding-right: 10px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.song>.duration {
width: 60px;
text-align: right;
margin-right: 8px;
}
.scheduled {
float: right;
border-top: thin dotted rgba(0, 0, 0, 0.5);
}
</style>
</custom-style>
<app-drawer-layout force-narrow>
<app-drawer slot="drawer" id="drawer">
<datetime-picker></datetime-picker><br>
<number-input pad-length="12"></number-input>
</app-drawer>
<app-box effects="parallax-background" effects-config='{"parallax-background": {"scalar": -0.5}}'></app-box>
<app-header-layout has-scrolling-region>
<app-header slot="header" effects="waterfall" reveals>
<app-toolbar>
<paper-icon-button icon="menu" drawer-toggle></paper-icon-button>
<div spacer main-title>Albums</div>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 100 100" style="fill='currentColor';">
<polygon points="0,0 100,0 50,100"/>
</svg>
<paper-icon-button icon="search"></paper-icon-button>
</app-toolbar>
<app-toolbar>
<div spacer>
<overlay-datetime-picker no-overlap always-on-top></overlay-datetime-picker>
</div>
<div spacer>
<overlay-datetime-picker no-overlap always-on-top></overlay-datetime-picker>
</div>
</app-toolbar>
</app-header>
<div class="content">
<h2>KIND OF BLUE</h2>
<div class="artist-date">
<div class="artist">
<span>Miles Davis</span>
</div>
<overlay-date-picker default="1959-08-17" no-tip vertical-align="top" disabled></overlay-date-picker>
</div>
<summary>
Kind of Blue is a studio album by American jazz trumpeter Miles Davis. It is regarded by many critics as jazz's greatest record, Davis's masterpiece, and one of the best albums of all time. Its influence on music, including jazz, rock, and classical genres,
has led writers to also deem it one of the most influential albums ever recorded.
</summary>
<div class="song">
<div class="no">1/1</div>
<div class="name">So What</div>
<div class="duration">9:04</div>
<paper-icon-button icon="explore"></paper-icon-button>
<overlay-time-picker parts-hidden='{"hour": true}' hide-now-button default="00:00:00" min="00:00:00" max="00:09:04" no-tip no-overlap vertical-align="middle" horizontal-align="right" clamp="millisecond"></overlay-time-picker>
<a target="_blank" href="https://www.youtube.com/results?search_query=Miles+Davis+Kind+of+Blue+So+What">
<paper-icon-button class="youtube" icon="svg-sample-icons:youtube"></paper-icon-button>
</a>
</div>
<div class="song">
<div class="no">1/2</div>
<div class="name">Freddie Freeloader</div>
<div class="duration">9:34</div>
<paper-icon-button icon="explore"></paper-icon-button>
<overlay-time-picker parts-hidden='{"hour": true}' hide-now-button default="00:00:00" min="00:00:00" max="00:09:34" no-tip no-overlap vertical-align="top" horizontal-align="center" clamp="millisecond"></overlay-time-picker>
<a target="_blank" href="https://www.youtube.com/results?search_query=Miles+Davis+Kind+of+Blue+Freddie+Freeloader">
<paper-icon-button class="youtube" icon="svg-sample-icons:youtube"></paper-icon-button>
</a>
</div>
<div class="song">
<div class="no">1/3</div>
<div class="name">Blue in Green</div>
<div class="duration">5:27</div>
<paper-icon-button icon="explore"></paper-icon-button>
<overlay-time-picker parts-hidden='{"hour": true}' hide-now-button default="00:00:00" min="00:00:00" max="00:05:27" no-tip no-overlap vertical-align="middle" horizontal-align="left" clamp="millisecond"></overlay-time-picker>
<a target="_blank" href="https://www.youtube.com/results?search_query=Miles+Davis+Kind+of+Blue+Blue+in+Green">
<paper-icon-button class="youtube" icon="svg-sample-icons:youtube"></paper-icon-button>
</a>
</div>
<div class="song">
<div class="no">2/1</div>
<div class="name">All Blues</div>
<div class="duration">11:33</div>
<paper-icon-button icon="explore"></paper-icon-button>
<overlay-time-picker parts-hidden='{"hour": true}' hide-now-button default="00:00:00" min="00:00:00" max="00:11:33" no-tip no-overlap vertical-align="top" horizontal-align="left" clamp="millisecond"></overlay-time-picker>
<a target="_blank" href="https://www.youtube.com/results?search_query=Miles+Davis+Kind+of+Blue+All+Blues">
<paper-icon-button class="youtube" icon="svg-sample-icons:youtube"></paper-icon-button>
</a>
</div>
<div class="song">
<div class="no">2/2</div>
<div class="name">Flamenco Sketches</div>
<div class="duration">9:26</div>
<paper-icon-button icon="explore"></paper-icon-button>
<overlay-time-picker parts-hidden='{"hour": true}' hide-now-button default="00:00:00" min="00:00:00" max="00:09:26" no-tip no-overlap vertical-align="middle" horizontal-align="left" clamp="millisecond"></overlay-time-picker>
<a target="_blank" href="https://www.youtube.com/results?search_query=Miles+Davis+Kind+of+Blue+Flamenco+Sketches">
<paper-icon-button class="youtube" icon="svg-sample-icons:youtube"></paper-icon-button>
</a>
</div>
<div class="scheduled">
<paper-icon-button icon="schedule"></paper-icon-button>
<overlay-datetime-picker no-overlap always-on-top no-tip dynamic-align></overlay-datetime-picker>
</div>
</div>
</app-header-layout>
</app-drawer-layout>
html,
body {
height: 100%;
}
body {
margin: 0;
font-family: "Roboto", "Noto", sans-serif;
background: #030200;
font-size: 0.9em;
}
Also see: Tab Triggers