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.
<div class='book'>
<div id='page-1' class='page no-anim'>
<div class='side-1' id='p1'>
<div class='content'>
<h1>The Pilgrim's Path</h1>
<p>
The pilgrim must visit each of the Shrines of the Seven Graces. At each site the pilgrim must stand before the three-sided stone triolith and read the inscription. To ease the pilgrim's task, the Temple has made this list of shrines along with directions and advice to pilgrims. The blessings of each shrine last at least a half day.
</p>
</div><!-- .content -->
</div><!-- .side-1 -->
<div class='side-2' id='p2'>
<div class='content'>
<h2>The Fields of Kummu: Shrine of Humility</h2>
<p>
Here Lord Vivec met a poor farmer whose guar had died. The farmer could not harvest his muck without his guar, and he could not provide for his family or his village. So the Lord Vivec removed his fine clothes and toiled in the fields like a beast of burden until the crop was harvested. It is at the Fields of Kummu we go to pray for the same humility Lord Vivec showed on that day.
</p>
<p>
The Fields of Kummu are west of Suran on the north shore of Lake Amaya as you head towards Pelagiad. The shrine is between two rocks, and most easily noticed while traveling east along the road. Alof's farm nearby has a small dock on the north bank of Lake Amaya. This is the only dock nearby which Alof kindly allows servants of the Temple to use. It is customary to leave a portion of muck at the shrine to represent Vivec's humility.
</p>
</div><!-- .content -->
</div><!-- .side-2 -->
</div><!-- .page -->
<div id='page-2' class='page no-anim'>
<div class='side-1' id='p3'>
<div class='content'>
<h2>To Stop the Moon: The Shrine of Daring</h2>
<p>
When Sheogorath rebelled against the Tribunal, he tricked the moon Baar Dau into forsaking its appointed path through Oblivion. The Mad Star inspired the moon to hurl itself upon Vivec's new city, which Sheogorath claimed was built in mockery of the heavens. When Vivec learned of Sheogorath's scheme, he froze the rogue moon in the sky with a single gesture and the grace of his countenance. Overwhelmed by the courage and daring of Vivec, the moon Baar Dau swore itself to eternal service of the Tribunal and all its works. Thus the moon now stands guard over the palace, and serves as a citadel for the Temple's Ordinators.
</p>
<p>
The Shrine of Daring is found in the city of Vivec, in the Temple District, along the western wall of the High Fane, the great Temple of Vvardenfell. When you address the shrine, it is customary to leave behind a Potion of Rising Force. Suitable potions may be purchased from the Temple. Homemade potions are not acceptable.
</p>
</div><!-- .content -->
</div><!-- .side-1 -->
<div class='side-2' id='p4'>
<div class='content'>
<h2>The Palace: Shrine of Generosity</h2>
<p>
Long after Lord Nerevar and the Tribunal triumphed over Dagoth Ur, the people wished to build a monument to the heroes of that war. Vivec thanked them, but said that it would be better to dedicate a monument not only to the glorious heroes, but to all people, great and small, who suffered and died in the war. It became the custom to make offerings here, either in thanks of our good fortune, or for those less fortunate.
</p>
<p>
The Shrine of Generosity is on the top steps of Vivec's Palace, the southernmost Canton of Vivec City. The customary donation for those in good fortune is 100 gold.
</p>
</div><!-- .content -->
</div><!-- .side-2 -->
</div><!-- #page-2 -->
<div id='page-3' class='page no-anim'>
<div class='side-1' id='p5'>
<div class='content'>
<h2>The Puzzle Canal: The Shrine of Courtesy</h2>
<p>
In a battle with Mehrunes Dagon, Vivec gave his own silver longsword to the Daedra Lord rather than dishonor himself by fighting an unarmed foe. This so impressed the Dremora, the most honorable and chivalrous of Mehrunes Dagon's Daedric servants, that they now share a bond of respect and courtesy with the followers of the Tribunal, though we must never forget that they are our enemies.
</p>
<p>
The Shrine of Courtesy is found in the heart of the Puzzle Canal, a labyrinth beneath Lord Vivec's Palace in the city of Vivec. The journey though the Puzzle Canal can be confusing and it is suggested that common pilgrims carry a scroll of ALMSIVI Intervention in case they get lost. The Dremora Krazzt is found in the center of the Puzzle Canal, and will accept a plain silver longsword if spoken to with courtesy. After Krazzt accepts the sword, pilgrims must read the inscription on the triolith.
</p>
</div><!-- .content -->
</div><!-- .side-1 -->
<div class='side-2' id='p6'>
<div class='content'>
<h2>The Mask of Vivec: Shrine of Justice</h2>
<p>
Near the altar is Vivec's Ash Mask. In the Days of Fire when Dagoth Ur first crept back into Red Mountain and awakened it, Vivec led refugees here as they fled the ash and blight. Weary, they rested here a while. When Vivec awoke, he found himself and all his followers encased in casts of grey ash. Frozen like a sleeping statue and unable to free himself or help his people, Vivec was filled with despair. Vivec's tears weakened his ash cast. He tore the ash from his perished followers, breathed life into their lungs, and cured them of the blight. This is Vivec's heroism -- his tender heart provides strength when his might fails.
</p>
<p>
The Shrine of Justice is guarded within the Gnisis Temple, in the village of Gnisis, northwest by road from the town of Ald'ruhn. When you address the shrine, it is customary to leave a potion of Cure Common Disease as a token of your respect for justice. Suitable potions may be purchased from Temple. Homemade potions are not acceptable.
</p>
</div><!-- .content -->
</div><!-- .side-2 -->
</div><!-- #page-3 -->
<div id='page-4' class='page no-anim'>
<div class='side-1' id='p7'>
<div class='content'>
<h2>Koal Cave: The Shrine of Valor</h2>
<p>
Within the Koal Cave, Vivec fought a battle with Ruddy Man, the father of the Dreugh. When he defeated Ruddy Man, Vivec spared his life, on the condition that Ruddy Man and his children would give up their tough hides to serve as armor for the Dunmer.
</p>
<p>
The Shrine of Valor is inside the Koal Cave, a cavern on the seacoast west of the ancient stronghold Berandas and south of Gnisis. The cave mouth faces south, towards the sea, and is marked by a large natural arch of stone. The region is wilderness, and finding the cave mouth can be difficult. Dreugh within the cave itself are fearsome enemies; only experienced and capable adventurers should attempt to re-enact the epic battle with the dreugh in the cave. Dreugh wax may be bought at the Temple in Gnisis. When you address the shrine, it is customary to leave a portion of dreugh wax as a token of Vivec's victorious struggle with Ruddy Man.
</p>
</div><!-- .content -->
</div><!-- .side-1 -->
<div class='side-2' id='p8'>
<div class='content'>
<h2>The Ghostfence: The Shrine of Pride</h2>
<p>
The Ghostfence is a lasting symbol of the indomitable will and power of ALMSIVI, and a monument to Dunmer pride in overcoming its enemies.
</p>
<p>
The Shrine of Pride is found within the Ghostfence, just northeast of the Ghostgate itself. The safest route to Ghostgate is along the Foyada Mamaea, a volcanic ravine running from the top of Red Mountain southwest to its end just below Balmora. An old Dwemer bridge crosses the foyada near Fort Moonmoth. A pilgrim may follow the Foyada Mamaea all the way to Ghostgate. Any journey inside the Ghostfence is dangerous, but even the most timid pilgrim should be safe, so long as he does not stray too far from the Ghostgate and flees from any minions of Dagoth Ur. When you address the shrine, it is customary to leave a soul gem in remembrance of our ancestors who were bound to the Tribunal's service.
</p>
</div><!-- .content -->
</div><!-- .side-2 -->
</div><!-- #page-4 -->
</div>
*, *:before, *:after {
margin: 0;
padding: 0;
box-sizing: border-box;
position: relative;
}
html, body {
height: 100%;
}
::-webkit-scrollbar {width:12px}
::-webkit-scrollbar-thumb {background: #222;}
::-webkit-scrollbar-track {background: transparent}
::selection {
background: #222;
color: white;
}
::-moz-selection {
background: #222;
color: white;
}
body * {
transform-style: preserve-3d; /* am i doing this wrong? */
}
body {
background:
radial-gradient(
hsla(199,40%,90%,.7),
hsla(0,0%,100%,0)
)
no-repeat,
linear-gradient(
60deg,
purple,
dodgerblue,
violet
);
color: #222;
font-family: 'Gabriela', serif;
perspective: 70em;/*in your face*/
overflow-y: hidden;
}
h1, p {
margin: 5% 0;
}
.book {
height: 80%;
max-height: 500px;
min-height: 300px;
width: 800px;
background-image:
linear-gradient(
90deg,
hsla(30,40%,50%,.6),
hsla(30,40%,20%,.9),
hsla(30,40%,50%,.4) 90%
),
url('http://inspirationhut3.inspirationhut.netdna-cdn.com/wp-content/uploads/2012/11/Old-Paper-Texture-3.jpg');
position: absolute;
top: 0; left: 0; bottom: 0; right: 0;
margin: auto;
border: 3px solid hsla(30,10%,20%,1);
border-radius: 5px;
box-shadow: 0 0 150px hsla(170,0%,0%,.4);
}
.page {
height: 100%;
width: 50%;
line-height: 1.5;
border-right: 10px solid transparent;
position: absolute;
top: 0; right: 0;
transform-origin: 0 50%;
transition: .8s;
/*animation: unflip .3s linear;*/
}
[class*='side'] {
height: 100%;
width: 100%;
position: absolute;
background-color: hsl(30,40%,70%);
background-image: url('http://inspirationhut3.inspirationhut.netdna-cdn.com/wp-content/uploads/2012/11/Old-Paper-Texture-3.jpg');
background-size: 100% 100%;
backface-visibility: hidden;
overflow: auto;
padding: 5% 8%;
}
.side-1 {
z-index: 2;
box-shadow: inset 50px 0 50px rgba(0,0,0,.5);
transition: .5s;
}
.side-2 {
transform:
rotateY(180deg);
box-shadow: inset -50px 0 50px rgba(0,0,0,.5);
}
.flipped > .side-1 {
box-shadow: inset 300px 0 50px rgba(0,0,0,.8);
transition: .6s;
}
.flipped > [class*='side'] {
pointer-events: auto;
}
.page:after {
width: 100px;
height: 50px;
background-color: #555;
position: absolute;
top: 0; bottom: 0; right: -100px;
margin: auto;
color: white;
text-shadow: 0 -1px 0 #222;
line-height: 50px;
text-align: center;
font-family: monospace;
content: 'next-page';
animation: hide .8s linear;
}
.page.flipped:after {
content: 'prev-page';
transform:
rotateY(180deg);
pointer-events: auto;
}
/* to hide on flip animation */
@keyframes hide {
0% {opacity: 0;}
85% {opacity: 0;}
100% {opacity: 1;}
}
.flipped {
transform:
rotateY(-180deg);
pointer-events: none;
/*animation: flip .3s linear;
animation-fill-mode: forwards;*/
}
.no-anim,
.no-anim:after {
animation: none;/* disable animation when page loads */
}
@keyframes flip {
to {
transform:
rotateY(-180deg);
}
}
@keyframes unflip {
from {
transform:
rotateY(-180deg);
}
to {
transform:
rotateY(0deg);
}
}
// http://stackoverflow.com/a/23371115/604040
$('.page').click(function() {
$(this).removeClass('no-anim').toggleClass('flipped');
$('.page > div').click(function(e) {
e.stopPropagation();
});
reorder()
});
function reorder(){
$(".book").each(function(){
var pages=$(this).find(".page")
var pages_flipped=$(this).find(".flipped")
pages.each(function(i){
$(this).css("z-index",pages.length-i)
})
pages_flipped.each(function(i){
$(this).css("z-index",i+1)
})
});
}
reorder()
Also see: Tab Triggers