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="home">
<div>
<div class="title-wrap">
<h2 class="home-title">We Design For Impact</h2>
<p>COdesign is a multidisciplinary design company that crafts meaningful solutions. Driven by storytelling and rooted in digital, we integrate data, strategy, visual communication and marketing to prepare brands for today and tomorrow.</p>
</div>
</div>
</div>
<!-- Horizontal Section -->
<div class="brand-strategy-showcase brand-showcase">
<div class="brand-strategy-showcase-container">
<div class="panel-section">
<div class="panel-item">
<div class="showcase-content">
<div class="bss-title">Brand Research & Strategy 1</div>
<div class="bss-content">
Spending quality time with our clients in order to uncover what your
brand really stands for is by far the most important step. After
taking an objective look at your industry and key audiences, we will
articulate your purpose, proposition, and personality. From there, we
will be able to create experiences that will connect your brand with
your customers.
</div>
<ul class="bss-list">
<li>Market & Landscape Research</li>
<li>Market & Landscape Research</li>
<li>Market & Landscape Research</li>
<li>Market & Landscape Research</li>
</ul>
</div>
<div class="showcase-sticky-img">
<img
class="item-img"
src="https://images.pexels.com/photos/4050408/pexels-photo-4050408.jpeg?cs=srgb&dl=pexels-vlada-karpovich-4050408.jpg&fm=jpg"
alt="Brand Image"
/>
</div>
</div>
</div>
</div>
<div class="brand-strategy-showcase-container">
<div class="panel-section">
<div class="panel-item">
<div class="showcase-content">
<div class="bss-title">Brand Research & Strategy 2</div>
<div class="bss-content">
Spending quality time with our clients in order to uncover what your
brand really stands for is by far the most important step. After
taking an objective look at your industry and key audiences, we will
articulate your purpose, proposition, and personality. From there, we
will be able to create experiences that will connect your brand with
your customers.
</div>
<ul class="bss-list">
<li>Market & Landscape Research</li>
<li>Market & Landscape Research</li>
<li>Market & Landscape Research</li>
<li>Market & Landscape Research</li>
</ul>
</div>
<div class="showcase-sticky-img">
<img src="https://images.pexels.com/photos/4050408/pexels-photo-4050408.jpeg?cs=srgb&dl=pexels-vlada-karpovich-4050408.jpg&fm=jpg" alt="Brand Image" />
</div>
</div>
</div>
</div>
<div class="brand-strategy-showcase-container">
<div class="panel-section">
<div class="panel-item">
<div class="showcase-content">
<div class="bss-title">Brand Research & Strategy 3</div>
<div class="bss-content">
Spending quality time with our clients in order to uncover what your
brand really stands for is by far the most important step. After
taking an objective look at your industry and key audiences, we will
articulate your purpose, proposition, and personality. From there, we
will be able to create experiences that will connect your brand with
your customers.
</div>
<ul class="bss-list">
<li>Market & Landscape Research</li>
<li>Market & Landscape Research</li>
<li>Market & Landscape Research</li>
<li>Market & Landscape Research</li>
</ul>
</div>
<div class="showcase-sticky-img">
<img
class="item-img"
src="https://images.pexels.com/photos/4050408/pexels-photo-4050408.jpeg?cs=srgb&dl=pexels-vlada-karpovich-4050408.jpg&fm=jpg"
alt="Brand Image"
/>
</div>
</div>
</div>
</div>
</div>
<!-- Project Showcase -->
<div class="project-showcase">
<div class="project-content">
<div class="bg-img" style=" background-image:url('https://images.pexels.com/photos/1080721/pexels-photo-1080721.jpeg?cs=srgb&dl=pexels-mark-mccammon-1080721.jpg&fm=jpg')"></div>
<div class="project-content">
<h2>Rebranding Rangs</h2>
<p>Companies and students have a really different point of view the challenge was to design a solution.</p>
</div>
</div>
</div>
*,
*::before,
*::after {
box-sizing: border-box;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
html,
button,
input,
select,
textarea {
// color: $color-text;
// font-size: percentage($font-size-default / 16px);
}
html,
body {
line-height: 1.2;
}
html {
// font-size: percentage($font-size-mobile / 16px);
// @include mq(ds) {
// font-size: percentage($font-size-default / 16px);
// }
}
body {
position: relative;
left: 0;
width: 100%;
height: 100vh;
max-height: 100vh;
margin: 0;
background: #2a2b2f;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
cursor: default;
}
.home {
display: flex;
align-items: flex-start;
height: 100%;
flex-direction: column;
.title-wrap {
position: absolute;
bottom: 121px;
left: 10%;
overflow: hidden;
@media (max-width: 767.98px) {
bottom: 100px;
max-width: 70%;
margin: 0 auto;
}
p {
font-size: 1rem;
line-height: 24px;
color: #fff;
width: 65%;
max-width: 47%;
@media only screen and (min-width: 2200px) {
margin-top: 0;
font-size: 1.8em;
line-height: 1.2em;
}
}
}
.home-title {
color: #fff;
text-transform: initial;
overflow: hidden;
margin: 0 0 12px;
font-size: calc(4vw + 15px);
max-width: 70%;
@media only screen and (min-width: 2200px) {
font-size: 7rem;
margin: 0 0 12px;
line-height: 138px;
}
}
}
// Horizontal Section Style
.brand-strategy-showcase {
width: 100%;
padding: 0;
height: 100% !important;
// overflow: hidden;
}
.brand-showcase {
display: flex;
flex-wrap: nowrap;
overflow: hidden;
}
.brand-strategy-showcase-container {
display: flex;
flex: 0 0 100%;
@media only screen and (min-width: 1000px) {
flex-direction: row;
}
.panel-section {
width: 100%;
height: 100%;
}
.panel-item {
display: flex;
width: 100%;
}
.showcase-content {
@media only screen and (min-width: 1000px) {
width: 32%;
margin-left: 19%;
display: flex;
flex-direction: column;
justify-content: center;
}
}
.showcase-sticky-img {
@media only screen and (min-width: 1000px) {
width: 41%;
display: flex;
justify-content: flex-end;
overflow: hidden;
will-change: transform;
margin-left: auto;
.item-img {
margin: 0;
max-width: 100%;
width: 100% !important;
height: 100% !important;
left: 0 !important;
top: 0 !important;
right: 0 !important;
// position: absolute;
object-fit: cover;
will-change: transform;
}
}
}
}
.bss-title {
font-size: 4.8rem;
color: #fff;
text-transform: capitalize;
margin: 0;
line-height: 72px;
margin-bottom: 25px;
position: relative;
z-index: 2;
}
.bss-content {
color: #9b9b9b;
margin-bottom: 20px;
}
.bss-list {
color: #fff;
font-size: 1.1rem;
text-transform: capitalize;
li {
padding-bottom: 15px;
padding-top: 15px;
border-bottom: 1px solid #707070;
&:last-child {
border-bottom: none;
}
}
}
.co-btn {
margin-top: 2rem;
color: #fff;
}
.project-showcase {
width: 100%;
height: 95vh;
color: #fff;
overflow: hidden;
position: relative;
}
.project-content {
position: absolute;
top: 0;
height: 100%;
backface-visibility: hidden;
transform-style: preserve-3d;
transform: translateZ(0);
will-change: transform;
overflow: hidden;
z-index: 1;
width: 100%;
}
.bg-img {
width:100%;
height:100%;
display:flex;
background-size:cover;
background-repeat:no-repeat;
}
gsap.registerPlugin(ScrollTrigger);
let container = document.querySelector('.brand-showcase');
let tl = gsap.timeline({
scrollTrigger: {
pin: true,
scrub: 1,
markers:true,
trigger: container,
end: () => "+=" + (container.scrollWidth - container.clientWidth),
},
defaults: { ease: 'none', duration: 1 },
});
tl.to('.panel-section', {
x: () => -(container.scrollWidth - container.clientWidth)
});
tl.to('.panel-item', {
opacity: 1,
scale: 1,
duration: 0.6,
stagger: {
amount: 0.8,
}
},
0
);
Also see: Tab Triggers