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.
<!-- classless div -->
<div class="">
<!-- Bs container -->
<div class="container">
<h2 class="pb-3 pt-2 border-bottom mb-5">Historical Timeline <span style="font-size:1.33rem; color:#afbada;"><em>(left to right & wrappy)</em></span></h2>
<!--first section/row-->
<div class="row align-items-center how-it-works d-flex milestone">
<div class="col-2 text-center bottom d-inline-flex justify-content-center align-items-center">
<div class="circle font-weight-bold">1</div>
</div>
<div class="col-6">
<h5>Year XX - <span style="color:#666;">Fully Responsive</span>
</h5>
<p>I needed a bit of a micro illustration that delights and can also shrink and swell on different screens. This is the first milestone! It was a very important one for the rest that followed. <a target="_blank" href="https://getbootstrap.com/docs/4.0/components/carousel">Bootstrap carousels</a> integrated adjacent to paragraphs to show imagery from each historical milestone. <em>When using dynamic languages, certain elements like the Bs indicator ol(s) and/or 'next' & 'previous' will have to be shown or not with else statements depending on how many images are stored in the DB or web service calls.</em> I had to add 51% to the height to avoid a break in this segment and avoid a white gap in this first :after rule. See line 25 of CSS. Inspiration from <a href="https://bootsnipp.com/mylastof" target="_blank">mylastof</a></p>
</div>
<!-- carousel col -->
<div class="col-3 text-center d-inline-flex justify-content-center align-items-center">
<!-- carousel elements -->
<div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="1"></li>
</ol>
<div class="carousel-inner">
<div class="carousel-item active">
<img class="d-block w-100" src="https://dickkirkland.com/wp-content/uploads/2018/09/slide-1.jpg" alt="First slide">
<div class="carousel-caption d-none d-md-block">
<p>This is the caption that will be in place.</p>
</div>
</div>
<div class="carousel-item">
<img class="d-block w-100" src="https://dickkirkland.com/wp-content/uploads/2018/09/slide-2.jpg" alt="Second slide">
<div class="carousel-caption d-none d-md-block">
<p>This is the caption that will be in place.</p>
</div>
</div>
</div>
<a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
<!-- /carousel elements -->
</div>
<!-- /carousel col -->
</div>
<!-- /first section/row-->
<!--path between 1-2-->
<div class="row timeline">
<div class="col-2">
<div class="corner top-right"></div>
</div>
<div class="col-8">
<hr/>
</div>
<div class="col-2">
<div class="corner left-bottom"></div>
</div>
</div>
<!--second section-->
<div class="row align-items-center justify-content-end how-it-works d-flex milestone">
<!-- carousel col -->
<div class="col-3 text-center d-inline-flex justify-content-center align-items-center">
<!-- carousel elements -->
<div id="carouselExampleIndicator" class="carousel slide" data-ride="carousel">
<!-- when using dynamic languages certain elements like the <ol> below will have to be shown or not with else statements depending on how many images are stored in the DB or web service call -->
<!--<ol class="carousel-indicators">
<li data-target="#carouselExampleIndicator" data-slide-to="0" class="active"></li>
</ol>-->
<div class="carousel-inner">
<div class="carousel-item active">
<img class="d-block w-100" src="https://dickkirkland.com/wp-content/uploads/2018/09/slide-1.png" alt="First slide">
<div class="carousel-caption d-none d-md-block">
<p>Subtitle effect to show caption legibly on an array of images</p>
</div>
</div>
</div>
<!-- when using dynamic languages certain elements like the <ol> below will have to be shown or not with else statements depending on how many images are stored in the DB or web service call -->
<!--<a class="carousel-control-prev" href="#carouselExampleIndicator" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carouselExampleIndicator" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>-->
</div>
<!-- /carousel elements -->
</div>
<!-- /carousel col -->
<div class="col-6 text-right">
<h5>Year XX - <span style="color:#666;">This is "timeline" is using Bootstrap.</span></h5>
<p>You know, so it can be responsivo! Some manipulations may have to be made for specific breakpoints. also accommodating for larger blocks of content. Some manipulations may have to be made for specific breakpoints. also accommodating for larger blocks of content. Some manipulations may have to be made for specific breakpoints. also accommodating for larger blocks of content. Ending of long content...</p>
</div>
<div class="col-2 text-center full d-inline-flex justify-content-center align-items-center">
<div class="circle font-weight-bold">2</div>
</div>
</div>
<!--path between 2-3-->
<div class="row timeline">
<div class="col-2">
<div class="corner right-bottom"></div>
</div>
<div class="col-8">
<hr/>
</div>
<div class="col-2">
<div class="corner top-left"></div>
</div>
</div>
<!--/path between 2-3-->
<!--third section-->
<div class="row align-items-center how-it-works d-flex milestone">
<div class="col-2 text-center fullLeft d-inline-flex justify-content-center align-items-center">
<div class="circle font-weight-bold">3</div>
</div>
<div class="col-6">
<h5>Year XX - <span style="color:#666;">For Later: Database content injection</span></h5>
<p>When the content for each milestone is firmed up, it along with associated images can be pulled from a database or a JSON web service. There may be several milestones beneath this one, which the skeleton will need to hold. There may be an opportunity to associate several images or modals within image sections. This will be done with small Bs carousel components.</p>
</div>
</div>
<!--path between 3-4-->
<div class="row timeline">
<div class="col-2">
<div class="corner top-right"></div>
</div>
<div class="col-8">
<hr/>
</div>
<div class="col-2">
<div class="corner left-bottom"></div>
</div>
</div>
<!--/path between 3-4-->
<!-- section 4 -->
<div class="row align-items-center justify-content-end how-it-works d-flex milestone">
<div class="col-6 text-right">
<h5>Year XX - <span style="color:#666;">Fourth Milestone.</span></h5>
<p>Continuing the milestones of larger blocks of content. Some manipulations may have to be made for specific breakpoints. also accommodating for larger blocks of content. Next will come custom galleries and/or modals to display respective images of Capitol photos. Ending of long content...</p>
</div>
<div class="col-2 text-center full d-inline-flex justify-content-center align-items-center">
<div class="circle font-weight-bold">4</div>
</div>
</div>
<!-- /section 4 -->
<!--path between 4-5 -->
<div class="row timeline">
<div class="col-2">
<div class="corner right-bottom"></div>
</div>
<div class="col-8">
<hr/>
</div>
<div class="col-2">
<div class="corner top-left"></div>
</div>
</div>
<!--/path between 4-5 -->
<!-- section 5 -->
<div class="row align-items-center how-it-works d-flex milestone">
<div class="col-2 text-center fullLeft d-inline-flex justify-content-center align-items-center">
<div class="circle font-weight-bold">5</div>
</div>
<div class="col-6">
<h5>Year XX - <span style="color:#666;">Fifth Milestone.</span></h5>
<p>Continuing the milestones of larger blocks of content. Some manipulations may have to be made for specific breakpoints. also accommodating for larger blocks of content. Next will come custom galleries and/or modals to display respective images of Capitol photos. Ending of long content...</p>
</div>
</div>
<!-- /section 5 -->
<!--path between 5-6 -->
<div class="row timeline">
<div class="col-2">
<div class="corner top-right"></div>
</div>
<div class="col-8">
<hr/>
</div>
<div class="col-2">
<div class="corner left-bottom"></div>
</div>
</div>
<!--/path between 5-6 -->
<!--section 6 -->
<div class="row align-items-center justify-content-end how-it-works d-flex milestone">
<div class="col-6 text-right">
<h5>Year XX - <span style="color:#666;">Sixth Milestone.</span></h5>
<p>Continuing the milestones of larger blocks of content. Some manipulations may have to be made for specific breakpoints. also accommodating for larger blocks of content. Next will come custom galleries and/or modals to display respective images of Capitol photos. Ending of long content...</p>
</div>
<div class="col-2 text-center full d-inline-flex justify-content-center align-items-center">
<div class="circle font-weight-bold">6</div>
</div>
</div>
<!--/section 6 -->
<!--path between 6-7 -->
<div class="row timeline">
<div class="col-2">
<div class="corner right-bottom"></div>
</div>
<div class="col-8">
<hr/>
</div>
<div class="col-2">
<div class="corner top-left"></div>
</div>
</div>
<!--/path between 6-7 -->
<!-- section 7 -->
<div class="row align-items-center how-it-works d-flex milestone">
<div class="col-2 text-center top d-inline-flex justify-content-center align-items-center">
<div class="circle font-weight-bold">7</div>
</div>
<div class="col-6">
<h5>Year XX - <span style="color:#666;">Seventh Milestone.</span></h5>
<p>Continuing the milestones of larger blocks of content. Some manipulations may have to be made for specific breakpoints. also accommodating for larger blocks of content. Next will come custom galleries and/or modals to display respective images of Capitol photos. Ending of long content...</p>
</div>
</div>
<!-- /section 7 -->
</div>
<!-- /Bs container -->
</div>
<!-- /classless div -->
.circle {
padding: 13px 20px;
border-radius: 50%;
/* border width below makes connecting segments and
borders unified, appearing to be part of one another */
border:3px solid #afbada;
background-color: #213f99;
color: #fff;
/* remember that whatever "border:(x)width" property is
added to the .circle, the max height below also has to
have this same amount added to it for it to appear
perfectly round :*/
max-height: 53px;
z-index: 2;
}
.how-it-works.row .col-2 {
align-self: stretch;
}
.how-it-works.row .col-2::after {
content: "";
position: absolute;
border-left: 3px solid #afbada;
z-index: 1;
}
.how-it-works.row .col-2.bottom::after {
/* had to add 51% to the height to avoid a break
in the segment and avoid a white gap in this
first :after rule
*/
height: 51%;
left: 50%;
top: 50%;
}
.how-it-works.row .col-2.full::after {
height: 100%;
left: calc(50% - 3px);
}
/* in order to make the left segments with the class
of "full" on left cols appear continuous, another
:after instance had to be created as the border of the
segments have a border-left of 3px. This is fine for
those that appear on the right cols, but they don't
align on the left without the :after below.
*/
.how-it-works.row .col-2.fullLeft::after {
height: 100%;
left: calc(50% - 0px);
}
.how-it-works.row .col-2.top::after {
height: 50%;
left: 50%;
top: 0;
}
.timeline div {
padding: 0;
height: 40px;
}
.timeline hr {
border-top: 3px solid #213f99;
margin: 0;
top: 17px;
position: relative;
}
.timeline .col-2 {
display: flex;
overflow: hidden;
}
.timeline .corner {
border: 3px solid #213f99;
width: 100%;
position: relative;
border-radius: 15px;
}
.timeline .top-right {
left: 50%;
top: -50%;
}
.timeline .left-bottom {
left: -50%;
top: calc(50% - 3px);
}
.timeline .top-left {
left: -50%;
top: -50%;
}
.timeline .right-bottom {
left: 50%;
top: calc(50% - 3px);
}
/* type treatments */
h5 {
font-family:'EB Garamond', serif;
font-weight:700;
font-size:1.59rem;
color:#213f99;
}
h2 {
font-family:'EB Garamond', serif;
font-weight:700;
color:#c88a12;
}
p {
color:#213f99;
}
.circle.font-weight-bold {
font-family:'EB Garamond', serif;
}
/* makes caousel captions visible on an array of backgrounds */
.carousel-caption p {
color:#fff;
text-shadow:0 0 10px rgba(0,0,0,1.0),
0 0 20px #000,
0 0 20px #000;
font-family:'EB Garamond', serif;
background-color:rgba(0,0,0,.64);
border-radius:3px;
letter-spacing:.13rem;
padding:.33rem;
}
/* /type treatments */
/* slight rounds on carousel images */
.carousel-inner {
border-radius: .33rem;
}
/* scrollMagic helper classes */
.milestone {
background-color:#fff;
border-radius:7px;
opacity:1;
transition:1s;
}
.milestone.fade-in {
background-color:rgba(200, 138, 18,.43);
opacity:1;
}
/* /scrollMagic helper classes */
/* Bs carousel interval below keeps motion to a minumum on the page when scroll magic is also integrated. Alternatively, remove data-ride="carousel" to stop automatic sliding.
NOTE:when users interact with the carousel, by default Bs starts slide animations when next or indicators are clicked or tapped, regardless if the data-ride="carousel" is not present */
$('.carousel').carousel({
interval: 10000
})
// init/setup var for ScrollMagic controller
var controller = new ScrollMagic.Controller();
// loop through each .project element
$('.milestone').each(function(){
console.log(this);
// build a scene
var scene = new ScrollMagic.Scene({
triggerElement: this.children[0],
duration:'60%' // responsive duration vs. viewport sizes
})
.setClassToggle(this, 'fade-in')
.addIndicators({
name:'fade scene'
}) // this requires plugin to display indicators for debugging
.addTo(controller);
});
// FOR LATER: build tween options
// uses the GSAP greensock animation plugin for tweens
// along with use of the scrollmagic plugin
Also see: Tab Triggers