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.
.notebook
.cover
.front
h1 Field Notes
h3 48-Page Memo Book
h3 Durable Materials / Made in the U.S.A.
.back
.property
textarea
.coordinates
textarea
.records
textarea
.misplacement
textarea
a.site(href="fieldnotesbrand.com") fieldnotesbrand.com
.pages
- for (var x = 48; x > 0; x--)
textarea(placeholder="page#{x}" class="page page#{x}")
@import "https://fonts.googleapis.com/css?family=Shadows+Into+Light";
$bg: #292A2B;
$line-color: #BEB69A;
$page-color: #fff;
$book-color: #A88A56;
$staple-color: #BFB5A4;
$cover-text: #000;
$pages: 48;
@function lines($deg) {
@return repeating-linear-gradient(
#{$deg}deg,
transparent,
transparent 3.5vh,
$line-color 3.5vh,
$line-color calc(3.5vh + 1px)
);
}
body{
background-color: $bg;
font-family: 'Helvetica', sans-serif;
text-align: center;
}
textarea{
border: none;
color: darken($line-color, 30%);
font-family: 'Shadows Into Light', cursive;
outline: none;
overflow: hidden;
resize: none;
}
.notebook{
background:url('http://api.thumbr.it/whitenoise-20x20.png?background=a88952ff&noise=8f7a56&density=18&opacity=51');
background-color: $book-color;
border-radius: 0.75vh 7.5vh 7.5vh 0.75vh;
box-shadow: 1vh 1vh 4vh 0px rgba(#000, 0.5);
display: inline-block;
height: 98vh;
margin-top: 1vh;
position: relative;
width: 63.636363636vh;
&:hover{
.cover{
transform: rotate3d(0,1,0,180deg);
transition: transform 0.5s ease-in-out, z-index 0.5s ease-in-out;
z-index: -1;
.front, .back{
transition: opacity 0.25s ease-in-out;
}
.front{
opacity: 0;
}
.back{
opacity: 1;
}
}
}
}
.cover{
background:url('http://api.thumbr.it/whitenoise-20x20.png?background=a88952ff&noise=8f7a56&density=18&opacity=51');
background-color: $book-color;
position: relative;
transform-origin: 0 50%;
transition: transform 0.5s ease-in-out 1.5s, z-index 0.5s ease-in-out 1.5s;
z-index: 1;
&:before{
background-color: $staple-color;
border-radius: 100%;
box-shadow: 0px 38vh 0px 0px $staple-color,
0px 75vh 0px 0px $staple-color;
content: '';
display: block;
height: 8.75vh;
left: -0.25vh;
position: absolute;
top: 10vh;
width: 0.5vh;
}
&:after{
background: linear-gradient(to right,
rgba(#3D270D, 0.9), rgba(#67430B, 0.65) 2%, rgba(#67430B, 0.25) 40%, rgba($book-color, 0.1)
);
border-radius: inherit;
bottom: 0;
content: '';
display: block;
left: 0;
position: absolute;
right: 0;
top: 0;
}
.front, .back{
transition: opacity 0s ease-in-out 1.75s;
}
.front{
color: $cover-text;
h1{
font-weight: 800;
font-size: 7vh;
letter-spacing: 3vh;
line-height: 9vh;
margin: 15.5vh 0px 6.5vh;
padding: 0px;
text-transform: uppercase;
}
h3{
font-size: 2.5vh;
font-weight: 700;
line-height: 5vh;
margin: 0px;
padding: 0px;
}
}
.back{
box-sizing: border-box;
padding: 6vh 8vh;
height: inherit;
opacity: 0;
transform: rotate3d(0,1,0,180deg);
width: inherit;
textarea{
border: 0.25vh solid $cover-text;
box-sizing: border-box;
background:transparent;
width: 100%;
}
div{
position: relative;
&:before{
background-color: $book-color;
display: inline-block;
font-size: 1.5vh;
font-weight: 800;
left: 50%;
position: absolute;
text-transform: uppercase;
top: 0;
transform: translate(-50%, -50%);
width: 90%;
}
}
.property {
&:before{
content: 'This field notes memo book is property of:';
}
textarea{
height: 12vh;
margin-bottom: 3vh;
}
}
.coordinates{
&:before{
content: 'Pertinent Coordinates:';
width: 52%;
}
textarea{
height: 33vh;
margin-bottom: 3vh;
}
}
.records{
&:before{
content: 'For Internal Records:';
width: 52%;
}
textarea{
height: 14.5vh;
margin-bottom: 3vh;
}
}
.misplacement{
&:before{
content: 'In the event of misplacement:';
width: 65%;
}
textarea{
height: 14.5vh;
margin-bottom: 3vh;
}
}
.site{
color: $cover-text;
bottom: 2vh;
font-size: 1.5vh;
font-weight: 800;
left: 50%;
position: absolute;
text-decoration: none;
transform: translate(-50%, -50%);
}
}
}
.page, .pages, .cover, .front, .back{
border-radius: inherit;
bottom: 0;
height: inherit;
left: 0;
position: absolute;
right: 0;
top: 0;
width: inherit;
}
.pages{
border-radius: inherit;
height: inherit;
position: relative;
width: inherit;
}
.pages{
&:active, &:hover{
.page{
transform: rotate3d(0,0,0,180deg);
transition: transform 0.5s ease-in-out 1s, color 0.5s ease-in-out 1s;
&:focus{
transform: rotate3d(0,0,0,180deg);
~ .page{
color: rgba(0,0,0,0);
transform: rotate3d(0,1,0,180deg);
@for $i from 1 through $pages {
&.page#{$i}{
z-index: #{$i};
}
}
}
}
&:active{
color: rgba(0,0,0,0);
transform: rotate3d(0,1,0,180deg);
transition: transform 0.5s ease-in-out 0.5s, color 0.5s ease-in-out 0.5s;
~ .page{
color: rgba(0,0,0,0.2);
transform: rotate3d(0,1,0,180deg);
@for $i from 1 through $pages {
&.page#{$i}{
z-index: #{$i};
}
}
}
}
}
}
}
::-webkit-input-placeholder {
font-family: 'Courier';
line-height: 100vh;
text-align: center;
}
::-moz-placeholder {
font-family: 'Courier';
line-height: 100vh;
text-align: center;
}
:-ms-input-placeholder {
font-family: 'Courier';
line-height: 100vh;
text-align: center;
}
:-moz-placeholder {
font-family: 'Courier';
line-height: 100vh;
text-align: center;
}
.page{
background-color: $page-color;
background-image: lines(90), lines(180);
box-sizing: border-box;
display: block;
font-size: 10vh;
height: inherit;
letter-spacing: 4px;
margin: 0;
padding: 7.5vh;
transform-origin: 0 50%;
transition: transform 0.5s ease-in-out 0.5s, color 0.5s ease-in-out 0.5s;
width: inherit;
z-index: 0;
}
/************************************
HOVER TO OPEN THE FIELD NOTES
HOLD EACH PAGE TO TURN IT
CLICK IN THE PAGE TO WRITE IN IT
Page stays open while you write
48 individual pages to write in
CLICK ON OPENED PAGES TO FLIP BACK
STOP HOVERING NOTES TO CLOSE
Fully Responsive to height of page.
Ready to record your notes.
Easily customizable color variables.
TODO : Finish design inside of cover,
Work with active states on close
**************************************/
Also see: Tab Triggers