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.
<!--
Famo.us is a free, open source Javascript development platform that can build apps, games and interfaces using HTML5 and WebGL.
NOTE: This is a demo based on an old version of the framework. For an updated version of the framwork, and more demos, visit http://famo.us.
-->
/* begin styling */
html {
background-color: #111;
color: white;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
font-size: 14px;
}
#main {
-webkit-perspective: 500px;
perspective: 500px;
}
h1, h2, h3 {
font-family: 'Avenir Next W10 Bold';
}
p {
font-family: 'Avenir Next W01 Thin';
}
a {
font-family: 'Avenir Next W10 Medium';
}
.backfaceVisible {
backface-visibility: visible;
-webkit-backface-visibility: visible; /* Chrome and Safari */
-moz-backface-visibility: visible; /* Firefox */
}
.white { color: white; }
.bor_clear { border: 0; }
.bor_clear:focus { outline: 0 }
.left { float: left; }
.right { float: right; }
.inline { display: inline; }
.block { display: block; }
.clear { clear: both; }
.absolute { position: absolute }
.description-panel {
background-color: rgba(77, 77, 77, 0.5);
}
.description-closing-tab {
border: 1px solid white;
}
/* INTERFACE.JS */
.textinput
{
height:40px;
width:100%;
padding-left: 6px;
padding-top: 0px;
color: rgba(255, 255, 255, .750);
font-size: 24px;
font-family: 'Avenir Next W10 Thin';
background-color:rgba(0, 0, 0, 1.0);
border: 1px solid rgba(255, 255, 255, .750);
outline-width: 0px;
}
.textinput:focus
{
color: rgba(255, 255, 255, 1.0);
border: 1px solid rgba(255, 255, 255, 1.0);
outline-width: 0px;
}
.submit
{
padding-top: 9px;
padding-left: 4px;
line-height: 24px;
font-size: 24px;
font-family: 'Avenir Next W10 Thin';
}
/* BACKTILE.JS */
.lightbox-title {
font-family: 'Avenir Next W10 Medium';
padding-bottom: 20px;
float: left;
}
.lightbox-spanish-title {
font-family: 'Avenir Next W10 Medium';
font-style: italic;
color: #ccc;
float: left;
clear: both;
}
.lightbox-tag-title {
font-family: 'Avenir Next W10 Medium';
color: #93CFB5;
font-size: 14px;
line-height: 10px;
padding-bottom: 15px;
}
.lightbox-tag-content {
font-size: 20px;
padding-bottom: 20px;
line-height: 28px;
}
.lightbox-thumb {
background: -moz-radial-gradient(center, ellipse cover, rgba(0,0,0,0.47) 0%, rgba(0,0,0,0.73) 85%, rgba(0,0,0,0.77) 100%); /* FF3.6+ */
background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%,rgba(0,0,0,0.47)), color-stop(85%,rgba(0,0,0,0.73)), color-stop(100%,rgba(0,0,0,0.77))); /* Chrome,Safari4+ */
background: -webkit-radial-gradient(center, ellipse cover, rgba(0,0,0,0.47) 0%,rgba(0,0,0,0.73) 85%,rgba(0,0,0,0.77) 100%); /* Chrome10+,Safari5.1+ */
background: -o-radial-gradient(center, ellipse cover, rgba(0,0,0,0.47) 0%,rgba(0,0,0,0.73) 85%,rgba(0,0,0,0.77) 100%); /* Opera 12+ */
background: -ms-radial-gradient(center, ellipse cover, rgba(0,0,0,0.47) 0%,rgba(0,0,0,0.73) 85%,rgba(0,0,0,0.77) 100%); /* IE10+ */
background: radial-gradient(ellipse at center, rgba(0,0,0,0.47) 0%,rgba(0,0,0,0.73) 85%,rgba(0,0,0,0.77) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#78000000', endColorstr='#c4000000',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */
border: 2px solid #93CFB5;
cursor: pointer;
}
h1.lightbox-thumb-tile {
font-family: 'Avenir Next W10 Medium';
//color: #93CFB5;
//color: #65cfa1;
color: #57FFB6;
text-transform: uppercase;
}
h5.lightbox-thumb-year {
padding-top: 20px;
font-family: 'Avenir Next W10 Thin';
}
.gradient-bg {
background: -webkit-linear-gradient(left,
rgba(105,94,127,0.54) 0%,
rgba(255,92,92,0.57) 15%,
rgba(255,160,17,0.59) 27%,
rgba(252,236,93,0.61) 37%,
rgba(255,229,145,0.63) 46%,
rgba(111,196,173,0.65) 58%,
rgba(106,132,186,0.67) 69%,
rgba(209,119,195,0.69) 79%,
rgba(216,213,125,0.7) 89%,
rgba(216,213,125,0.72) 100%),
-webkit-repeating-linear-gradient(-45deg, rgba(255,255,255,0.5),
transparent 20px,
rgba(255,255,255,0.3) 40px)
}
.core-nextDescription a {
color: #ffffff;
line-height: 18px;
}
.core-next-demo {
font-size: 12px;
color: #ccc;
font-family: 'Avenir Next W10 Medium';
}
.core-next-name {
color: #ffffff;
font-family: 'Avenir Next W10 Medium';
}
.textinput
{
height:40px;
width:100%;
padding-left: 6px;
padding-top: 0px;
color: rgba(255, 255, 255, .750);
font-size: 24px;
font-family: 'Avenir Next W10 Thin';
background-color:rgba(0, 0, 0, 0.0);
border: 1px solid rgba(255, 255, 255, .750);
outline-width: 0px;
background-color: #222;
}
.textinput:focus
{
color: rgba(255, 255, 255, 1.0);
border: 1px solid rgba(255, 255, 255, 1.0);
outline-width: 0px;
}
.submit
{
padding-top: 9px;
padding-left: 4px;
line-height: 24px;
font-size: 24px;
font-family: 'Avenir Next W10 Thin';
}
.core-error {
font-family: 'Avenir Next W10 Medium';
}
// CodePen Evaluation License
//
// Copyright (c) 2013 Famous Industries, Inc.
//
// Non-sublicensable permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files directly from codepen.io (the
// "Software"), solely to internally make and internally use copies of the Software to test,
// explore, and evaluate the Software solely in such person’s non-commercial, non-
// production environments, provided that the above copyright notice and this permission
// notice shall be included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A ARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
// IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//
Famous(function(require,exports,module)
{
require('famous-sync/FastClick');
// ANIMATIONS!
var RegisterEasing = require('famous-animation/RegisterEasing');
// Physics!!
var Transitionable = require('famous/Transitionable');
var PhysicsTrans = require('famous-physics/utils/PhysicsTransition');
Transitionable.registerMethod('physics', PhysicsTrans);
var Surface = require('famous/Surface');
var Engine = require('famous/Engine');
var Utility = require('famous/Utility');
var Time = require('famous-utils/Time');
var KeyCodes = require('famous-utils/KeyCodes');
var SceneController = require('app/SceneController');
var LightboxScene = require('app/scenes/LightboxScene');
var BlankLightbox = require('app/scenes/BlankLightbox');
var mainCtx = Engine.createContext();
mainCtx.setPerspective( 1000 );
mainCtx.add( SceneController );
SceneController.addScenes({
'lightbox' : LightboxScene,
'blank' : BlankLightbox
});
SceneController.setScene('lightbox');
Engine.on('keydown', function ( e ) {
if( e.keyCode == KeyCodes.LEFT_ARROW ) {
SceneController.prev();
} else if ( e.keyCode == KeyCodes.RIGHT_ARROW ) {
SceneController.next();
}
});
});
Also see: Tab Triggers