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 URL's 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 it's URL and the proper URL extention.
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 Skypack, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ES6 import
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.
<body>
<nav class="absolute z-50 text-black">
<div class="fixed">
<button id="section1Btn">Section 1</button>
<button id="section2Btn">Section 2</button>
<button id="section3Btn">Section 3</button>
</nav>
</div>
<div id="container" class="content">
<!-- <div class="relative w-full">
<div class="fixed z-50 flex w-full px-4 mx-auto bg-gray-300 bg-opacity-20 backdrop-blur-sm shadow-md">
<div class="flex flex-row items-center justify-between p-4">
<a href="/" class="z-50 text-2xl font-semibold tracking-widest text-blue-50 uppercase rounded-lg dark-mode:text-white focus:outline-none focus:shadow-outline">SATMAKA</a>
</div>
<nav class="flex justify-end items-center">
<a class="px-6 py-3 text-sm font-semibold bg-transparent rounded duration-700 md:mt-0 md:ml-4 hover:text-gray-900 focus:text-gray-900 hover:bg-blue-50" href="#">Blog</a>
<a class="px-6 py-3 text-sm font-semibold bg-transparent rounded duration-700 md:mt-0 md:ml-4 hover:text-gray-900 focus:text-gray-900 hover:bg-blue-50 mr-12" href="#">Login</a>
</nav>
</div>
</div> -->
<section id="section" class="description panel color-white p-12">
<div class="absolute h-full top-0 w-full bg-blue-700"></div>
<div class="w-8/12 m-0 p-0 text-left ">
<h2 class="text-7xl drop-shadow-md">IT'S TIME FOR A TALENT REVOLUTION.</h2>
<h5 class="text-white w-7/12 drop-shadow-md">Strip away bias and reveal human potential to revolutionize how you hire, grow, and retain talent with Satmaka Raharja.</h5>
<div class="scroll-down">
<div class="arrow drop-shadow"></div>
</div>
</div>
</section>
<section id="section1" class="panel bg-red-500 m-0 p-0 w-full h-auto">
<div class="w-full h-auto">
<div class="grid grid-cols-3 ">
<div class="w-full h-[334px] bg-gray-100 border border-gray-500 bg2">
<h2 class="opacity-0 hover:opacity-90 duration-700 flex items-center drop-shadow-lg scale-105 hover:scale-100 justify-center bg-blue-500 text-center bg-opacity-65 text-white w-full h-[334px]">ADRAWORLD</h2>
</div>
<div class="w-full h-[334px] bg-gray-100 border border-gray-500 bg3">
<h2 class="opacity-0 hover:opacity-90 duration-700 flex items-center drop-shadow-lg scale-105 hover:scale-100 justify-center bg-blue-500 text-center bg-opacity-65 text-white w-full h-[334px]">EMI PERSERO</h2>
</div>
<div class="w-full h-[334px] bg-gray-100 border border-gray-500 bg4">
<h2 class="opacity-0 hover:opacity-90 duration-700 flex items-center drop-shadow-lg scale-105 hover:scale-100 justify-center bg-blue-500 text-center bg-opacity-65 text-white w-full h-[334px]">DIAN PENCERAH INDONESIA</h2>
</div>
<div class="w-full h-[334px] bg-gray-100 border border-gray-500 bg5">
<h2 class="opacity-0 hover:opacity-90 duration-700 flex items-center drop-shadow-lg scale-105 hover:scale-100 justify-center bg-blue-500 text-center bg-opacity-65 text-white w-full h-[334px]">ARAT DESIGN INTERNATIONAL</h2>
</div>
<div class="w-full h-[334px] bg-gray-100 border border-gray-500 bg6">
<h2 class="opacity-0 hover:opacity-90 duration-700 flex items-center drop-shadow-lg scale-105 hover:scale-100 justify-center bg-blue-500 text-center bg-opacity-65 text-white w-full h-[334px]">SADASA ACADEMY</h2>
</div>
<div class="w-full h-[334px] bg-gray-100 border border-gray-500 bg7">
<h2 class="opacity-0 hover:opacity-90 duration-700 flex items-center drop-shadow-lg scale-105 hover:scale-100 justify-center bg-blue-500 text-center bg-opacity-65 text-white w-full h-[334px]">KAMPUNG ARIDATU</h2>
</div>
<div class="w-full h-[334px] bg-gray-100 border border-gray-500 bg8">
<h2 class="opacity-0 hover:opacity-90 duration-700 flex items-center drop-shadow-lg scale-105 hover:scale-100 justify-center bg-blue-500 text-center bg-opacity-65 text-white w-full h-[334px]">ADRAWORLD</h2>
</div>
<div class="w-full h-[334px] bg-gray-100 border border-gray-500 bg9">
<h2 class="opacity-0 hover:opacity-90 duration-700 flex items-center drop-shadow-lg scale-105 hover:scale-100 justify-center bg-blue-500 text-center bg-opacity-65 text-white w-full h-[334px]">ADRAWORLD</h2>
</div>
<div class="w-full h-[334px] bg-gray-100 border border-gray-500 bg10">
<h2 class="opacity-0 hover:opacity-90 duration-700 flex items-center drop-shadow-lg scale-105 hover:scale-100 justify-center bg-blue-500 text-center bg-opacity-65 text-white w-full h-[334px]">ADRAWORLD</h2>
</div>
<div class="w-full h-[334px] bg-gray-100 border border-gray-500 bg11">
<h2 class="opacity-0 hover:opacity-90 duration-700 flex items-center drop-shadow-lg scale-105 hover:scale-100 justify-center bg-blue-500 text-center bg-opacity-65 text-white w-full h-[334px]">ADRAWORLD</h2>
</div>
<div class="w-full h-[334px] bg-gray-100 border border-gray-500 bg12">
<h2 class="opacity-0 hover:opacity-90 duration-700 flex items-center drop-shadow-lg scale-105 hover:scale-100 justify-center bg-blue-500 text-center bg-opacity-65 text-white w-full h-[334px]">ADRAWORLD</h2>
</div>
<div class="w-full h-[334px] bg-gray-100 border border-gray-500 bg13">
<h2 class="opacity-0 hover:opacity-90 duration-700 flex items-center drop-shadow-lg scale-105 hover:scale-100 justify-center bg-blue-500 text-center bg-opacity-65 text-white w-full h-[334px]">ADRAWORLD</h2>
</div>
</div>
</div>
</section>
<section id="section2" class="panel bg-orange-500">
<div>
TWO
</div>
</section>
<section id="section3" class="panel bg-violet-500">
THREE
</section>
</div>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.9.1/gsap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.9.1/ScrollTrigger.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.9.1/ScrollToPlugin.min.js"></script>
<script src='https://codepen.io/GreenSock/pen/7ba936b34824fefdccfe2c6d9f0b740b.js'></script>
<script src="/src/js/script.js"></script>
</body>
@import url("http://fonts.cdnfonts.com/css/proxima-nova-2");
* {
margin: 0;
padding: 0;
color: #fff;
}
body {
scroll-behavior: smooth;
font-family: "Proxima Nova", sans-serif;
width: 100vw;
}
#container {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
overflow: hidden;
}
.panel {
position: absolute;
will-change: transform;
}
.bg1 {
background-image: url("/src/img/hero.webp");
/* background-image: url("https://picsum.photos/id/594/2509/1673"); */
/* background-image: url("http://satmaka.com/wp-content/uploads/2021/12/psychological-workoshops-P8XR442.jpg"); */
/* background-color: #041c2b; */
max-height: 100%;
width: 100%;
background-attachment: fixed;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
.bg2 {
background-image: url("/src/img/adraworld.png");
/* background-image: url("https://picsum.photos/id/594/2509/1673"); */
/* background-image: url("http://satmaka.com/wp-content/uploads/2021/12/psychological-workoshops-P8XR442.jpg"); */
/* background-color: #041c2b; */
max-height: 100%;
width: 100%;
background-attachment: local;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
.bg3 {
background-image: url("/src/img/EMI.png");
/* background-image: url("https://picsum.photos/id/594/2509/1673"); */
/* background-image: url("http://satmaka.com/wp-content/uploads/2021/12/psychological-workoshops-P8XR442.jpg"); */
/* background-color: #041c2b; */
max-height: 100%;
width: 100%;
background-attachment: local;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
.bg4 {
background-image: url("/src/img/dian.png");
/* background-image: url("https://picsum.photos/id/594/2509/1673"); */
/* background-image: url("http://satmaka.com/wp-content/uploads/2021/12/psychological-workoshops-P8XR442.jpg"); */
/* background-color: #041c2b; */
max-height: 100%;
width: 100%;
background-attachment: local;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
.bg5 {
background-image: url("/src/img/arat.png");
/* background-image: url("https://picsum.photos/id/594/2509/1673"); */
/* background-image: url("http://satmaka.com/wp-content/uploads/2021/12/psychological-workoshops-P8XR442.jpg"); */
/* background-color: #041c2b; */
max-height: 100%;
width: 100%;
background-attachment: local;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
.bg6 {
background-image: url("/src/img/sadasa.png");
/* background-image: url("https://picsum.photos/id/594/2509/1673"); */
/* background-image: url("http://satmaka.com/wp-content/uploads/2021/12/psychological-workoshops-P8XR442.jpg"); */
/* background-color: #041c2b; */
max-height: 100%;
width: 100%;
background-attachment: local;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
.bg7 {
background-image: url("/src/img/kampung.png");
/* background-image: url("https://picsum.photos/id/594/2509/1673"); */
/* background-image: url("http://satmaka.com/wp-content/uploads/2021/12/psychological-workoshops-P8XR442.jpg"); */
/* background-color: #041c2b; */
max-height: 100%;
width: 100%;
background-attachment: local;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
.bg8 {
background-image: url("/src/img/adraworld.png");
/* background-image: url("https://picsum.photos/id/594/2509/1673"); */
/* background-image: url("http://satmaka.com/wp-content/uploads/2021/12/psychological-workoshops-P8XR442.jpg"); */
/* background-color: #041c2b; */
max-height: 100%;
width: 100%;
background-attachment: local;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
.bg9 {
background-image: url("/src/img/adraworld.png");
/* background-image: url("https://picsum.photos/id/594/2509/1673"); */
/* background-image: url("http://satmaka.com/wp-content/uploads/2021/12/psychological-workoshops-P8XR442.jpg"); */
/* background-color: #041c2b; */
max-height: 100%;
width: 100%;
background-attachment: local;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
.bg10 {
background-image: url("/src/img/adraworld.png");
/* background-image: url("https://picsum.photos/id/594/2509/1673"); */
/* background-image: url("http://satmaka.com/wp-content/uploads/2021/12/psychological-workoshops-P8XR442.jpg"); */
/* background-color: #041c2b; */
max-height: 100%;
width: 100%;
background-attachment: local;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
.bg11 {
background-image: url("/src/img/adraworld.png");
/* background-image: url("https://picsum.photos/id/594/2509/1673"); */
/* background-image: url("http://satmaka.com/wp-content/uploads/2021/12/psychological-workoshops-P8XR442.jpg"); */
/* background-color: #041c2b; */
max-height: 100%;
width: 100%;
background-attachment: local;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
.bg12 {
background-image: url("/src/img/adraworld.png");
/* background-image: url("https://picsum.photos/id/594/2509/1673"); */
/* background-image: url("http://satmaka.com/wp-content/uploads/2021/12/psychological-workoshops-P8XR442.jpg"); */
/* background-color: #041c2b; */
max-height: 100%;
width: 100%;
background-attachment: local;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
.bg13 {
background-image: url("/src/img/adraworld.png");
/* background-image: url("https://picsum.photos/id/594/2509/1673"); */
/* background-image: url("http://satmaka.com/wp-content/uploads/2021/12/psychological-workoshops-P8XR442.jpg"); */
/* background-color: #041c2b; */
max-height: 100%;
width: 100%;
background-attachment: local;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
p {
color: #fff;
}
.arrow {
color: #fff;
}
gsap.registerPlugin(ScrollTrigger, ScrollToPlugin);
gsap.to(".panel:not(:last-child)", {
yPercent: -100,
ease: "none",
stagger: 0.5,
scrollTrigger: {
trigger: "#container",
start: "top top",
end: "+=300%",
scrub: true,
markers: false,
pin: true
}
});
gsap.set(".panel", { zIndex: (i, target, targets) => targets.length - i });
document.querySelectorAll("nav button").forEach((btn, index) => {
btn.addEventListener("click", () => {
gsap.to(window, {
duration: 1,
scrollTo: { y: "#section" + (index + 1), offsetY: -660 }
});
});
});
//smooth-scroll
// Tell ScrollTrigger to use these proxy getter/setter methods for the "body" element:
ScrollTrigger.scrollerProxy(document.body, {
scrollTop(value) {
if (arguments.length) {
bodyScrollBar.scrollTop = value; // setter
}
return bodyScrollBar.scrollTop; // getter
},
getBoundingClientRect() {
return {
top: 0,
left: 0,
width: window.innerWidth,
height: window.innerHeight
};
}
});
// when the smooth scroller updates, tell ScrollTrigger to update() too:
bodyScrollBar.addListener(ScrollTrigger.update);
Also see: Tab Triggers