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="content2">
<div id="content2-profile"></div>
<div id="content2-Text">
<div id="text-container">
<h1>About Me</h1>
<h2>Developer <span>& Designer</span></h2>
<p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Eaque voluptatibus hic quibusdam ducimus cupiditate? Ab similique unde, vitae in consequuntur dolor earum a at fuga exercitationem voluptatem minus. Ex, quibusdam. Vel provident ipsam odio similique temporibus nesciunt excepturi perferendis eius molestiae in? Maiores nostrum soluta ipsa, natus tenetur, sequi, voluptates ratione ea minima quidem libero dolores. Maxime magnam in architecto cum dicta, eligendi earum, et ratione est eveniet mollitia reprehenderit beatae. Nostrum tempora ut, eum omnis, libero quasi ducimus dolor veniam excepturi repellendus dolorem voluptates vero consequuntur aperiam laboriosam laborum fuga voluptatibus illum, veritatis architecto! Quisquam saepe voluptatem quibusdam corrupti. Iusto quia cumque sed. Quo voluptatum omnis veniam cupiditate, quam numquam cumque, quisquam, enim maxime sunt nemo! Necessitatibus aliquid adipisci vero ad, recusandae delectus? Perferendis doloribus ut exercitationem ad dolor, dolores fuga nihil laudantium tempora incidunt placeat necessitatibus ab numquam culpa rem, aliquid distinctio neque quis minima, eius asperiores quibusdam?</p>
</div>
</div>
</div>
<!-- ******* PAGE 3 ******* -->
<div class="content3">
<div class="content3-container">
<h1 id="content3_title"><span>Featured</span> work</h1>
<div class="box-1-whole">
<div id="box-1">
<div id="box-1-container">
<h1>Front-end Development</h1>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Praesentium porro aliquid veniam? Ea recusandae consequuntur nesciunt consequatur aut minima neque odit eius nihil, accusantium modi a, ullam laborum eligendi sed sapiente atque blanditiis repellendus similique nemo quod ratione, obcaecati optio deleniti? In autem, perspiciatis molestiae vitae facere nihil unde qui.</p>
</div>
</div>
</div>
<div class="box-2-whole">
<div id="box-2">
<div id="box-2-container">
<h1>Back-end Development</h1>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Praesentium porro aliquid veniam? Ea recusandae consequuntur nesciunt consequatur aut minima neque odit eius nihil, accusantium modi a, ullam laborum eligendi sed sapiente atque blanditiis repellendus similique nemo quod ratione, obcaecati optio deleniti? In autem, perspiciatis molestiae vitae facere nihil unde qui.</p>
</div>
</div>
</div>
<div class="box-3-whole">
<div id="box-3">
<div id="box-3-container">
<h1>Testing Framework</h1>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Praesentium porro aliquid veniam? Ea recusandae consequuntur nesciunt consequatur aut minima neque odit eius nihil, accusantium modi a, ullam laborum eligendi sed sapiente atque blanditiis repellendus similique nemo quod ratione, obcaecati optio deleniti? In autem, perspiciatis molestiae vitae facere nihil unde qui.</p>
</div>
</div>
</div>
</div>
</div>
<!-- ******* PAGE 4 ******* -->
<div class="content4">
<div class="guitar-info">
<div class="guitar-content">
<div id="guitar-content-h1-h2">
<h1>Guitarist</h1>
<h2>Life Interest <span>Besides Coding</span></h2>
</div>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Animi nobis velit reprehenderit libero, asperiores minus eligendi nesciunt praesentium accusantium? Optio eum totam accusamus esse laudantium eius, aut ipsam iure inventore ratione molestias quae deleniti expedita veniam doloremque provident iusto veritatis qui? Minima fuga impedit consequuntur nostrum voluptatem quasi ex quod, quos odit. Quia magnam deserunt dolor iure consequatur, optio sint, nihil repellendus facilis maxime cupiditate dolorem amet incidunt enim officia voluptatum totam et perferendis necessitatibus hic in assumenda pariatur. Nam, laborum doloribus accusantium quam nobis minima molestias ex iure similique repellendus est aspernatur, dolor minus officiis, impedit culpa delectus beatae.</p>
</div>
</div>
<div class="guitar-image"></div>
</div>
.content2 {
height: 90vh;
overflow: hidden;
position: relative;
display: flex;
flex-direction: row;
gap: 2rem;
}
/******** images next to About Me *********/
#content2-profile {
width: 50%;
position: absolute;
height: 30%;
background-image: url('./pic/man2.jpg');
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
/******** About Me Text *********/
#content2-Text {
position: relative;
width: 50%;
height: 90vh;
left: 50%;
background-color: transparent;
display: flex;
justify-content: center;
align-items: center;
}
#text-container {
position: absolute;
width: 80%;
height: 80%;
background-color: transparent;
display: flex;
flex-direction: column;
gap: 1rem;
justify-content: center;
font-family: 'Oswald', sans-serif;
}
#text-container h1 {
font-size: 4em;
}
#text-container h2 {
font-size: 2em;
}
#text-container p {
font-family: 'Oswald', sans-serif;
font-size: 1.1em;
}
#text-container span {
color: darkgray;
}
/***** PART 4: content3 *****/
.content3 {
height: 200vh;
position: relative;
display: flex;
flex-direction: column;
gap: 2rem;
justify-content: center;
align-items: center;
background-color: white;
font-family: 'Oswald', sans-serif;
}
.content3-container {
width: 88%;
position: relative;
height: 185vh;
display: flex;
flex-direction: column;
gap: 5rem;
}
#content3_title {
font-size: 4rem;
}
#content3_title span {
color: darkgrey;
}
#box-1,
#box-2,
#box-3 {
position: relative;
width:85%;
height:45vh;
background-image: url('./pic/gray-background.jpg');
background-position: 50% 65%;
background-size: cover;
background-repeat: no-repeat;
box-shadow:0px 5px 15px rgba(0,0,0,0.22);
transform: translateX(30px);
display: flex;
align-items: center;
}
#box-2 {
background-image: url('./pic/gray-background-2.jpg');
background-position: 80% 90%;
background-repeat: no-repeat;
background-size: cover;
}
#box-3 {
background-image: url('./pic/gray-background-3.jpg');
background-position: 20% 55%;
background-repeat: no-repeat;
background-size: cover;
}
#box-1-container,
#box-2-container,
#box-3-container {
position: absolute;
height: 85%;
width: 40%;
background-color: transparent;
left: 25px;
display: flex;
flex-direction: column;
justify-content: center;
gap: 1.8rem;
padding: 2rem;
color: rgba(0,0,0,0.6);
display: none;
}
#box-1::before,
#box-2::before,
#box-3::before {
content: '';
height: 45vh;
width: 15px;
position: absolute;
background-color: rgba(0,0,0,0.6);
box-shadow:0px 5px 15px rgba(0,0,0,0.22);
transform: translateX(-30px);
border-radius: 0.2rem;
}
.box-1-whole,
.box-2-whole,
.box-3-whole {
display: flex;
flex-direction: row;
gap: 2rem;
}
/******** Guitarist Text *********/
.content4 {
width: 100%;
height: 90vh;
display: flex;
flex-direction: row;
position: relative;
background-color: transparent;
padding: 0;
margin: 0;
overflow: hidden;
}
.guitar-info {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
gap: 2rem;
width: 50%;
height: 90vh;
left: 0;
position: absolute;
background-color: transparent;
}
.guitar-content {
width: 85%;
height: 85%;
position: absolute;
display: flex;
flex-direction: column;
justify-content: center;
gap: 1.5rem;
background-color: transparent;
font-family: 'Oswald', sans-serif;
padding: 2rem;
}
.guitar-content h1 {
font-size: 4rem;
color: black;
}
#guitar-content-h1-h2 span{
color: darkgray;
}
.guitar-content h2 {
font-size: 2rem;
color: black;
}
/******** Guitarist Image *********/
.guitar-image {
width: 50%;
height: 90vh;
right: 0;
position: absolute;
background-image: url('./pic/guitar2.jpg');
background-repeat: no-repeat;
background-position: center;
background-size: cover;
}
gsap.registerPlugin(ScrollTrigger);
const tl3 = gsap.timeline({scrollTrigger:{
trigger: '.content3',
start: 'top 85%',
end: 'bottom 50%',
toggleActions: 'restart pause pause reset',
markers: true
}})
tl3.from('.box-1-whole',{opacity:0, duration:2, x:100})
tl3.from('.box-2-whole',{opacity:0, duration:2, x:100})
tl3.from('.box-3-whole',{opacity:0, duration:2, x:100})
Also see: Tab Triggers