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 id="fullpage">
<div class="section bg-blue-500 h-screen">
<div id="hero-logo" class="flex justify-center items-center w-full h-full">
<div class="flex justified-center">
<div>
<svg id="main-logo-arrows" class="w-full h-full" viewBox="0 0 124 117" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M67.6577 58.1928L93.0602 47.2434L87.3965 44.7118L61.8865 55.7078L56.1152 58.1928L61.8865 60.6777L87.6727 71.7824L93.3365 69.2509L67.6577 58.1928Z" fill="#E5F0FC" />
<path d="M119.246 85.3875V109.833L67.029 86.0087L61.4727 88.4937L123.774 116.9V82.3589L99.0316 71.7046L93.3679 74.2362L119.246 85.3875Z" fill="#E5F0FC" />
<path d="M123.773 0.650002L61.8857 28.3108L67.4728 30.8113L119.245 7.67004V30.9977L93.0902 42.2577L98.754 44.7893L123.773 34.0107V0.650002Z" fill="#E5F0FC" />
<path d="M30.3601 69.2816L12.6627 61.2987V55.3192L30.7131 47.2431L36.3769 44.7115L61.8869 33.3117L56.2999 30.8112L30.6824 42.2576L25.0187 44.7892L8.13477 52.3373V64.2806L24.6963 71.72L30.2987 74.2826L55.9315 85.962L61.4878 83.4926L35.9625 71.8443L30.3601 69.2816Z" fill="#E5F0FC" />
<path d="M30.3604 69.2818L35.9627 71.8445L61.8872 60.6776L56.116 58.1927L30.3604 69.2818Z" fill="#E5F0FC" />
<path d="M36.3776 44.7114L30.7139 47.243L56.1164 58.1924L61.8877 55.7074L36.3776 44.7114Z" fill="#E5F0FC" />
<path d="M98.7554 44.7893L93.0916 42.2577L67.4741 30.8113L61.8871 28.3108L0 0.650002V34.0107L25.0188 44.7893L30.6826 42.2577L4.5126 30.9977V7.67004L56.3001 30.8113L61.8871 33.3118L87.3971 44.7116L93.0609 47.2432L111.111 55.3193V61.2988L93.3372 69.2507L87.6734 71.7823L61.488 83.4927L55.9317 85.9621L4.5126 108.948V85.3875L30.2989 74.2828L24.6965 71.7201L0 82.3589V115.968L61.4727 88.4937L67.029 86.0087L93.3679 74.2362L99.0316 71.7046L115.624 64.2808V52.3374L98.7554 44.7893Z" fill="#E5F0FC" />
</svg>
</div>
<div id="reveal-logo" class="ml-4 overflow-hidden invisible hidden">
<svg id="logo-letters" class="w-full h-full" viewBox="0 0 333 124" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M248.219 9.59689C248.219 4.13953 243.68 0 237.422 0C231.025 0 226.502 3.86046 226.502 9.59689C226.502 15.3333 230.622 19.4728 237.422 19.4728C243.696 19.4728 248.219 15.3333 248.219 9.59689ZM247.011 28H227.694V97.3642H247.011V28ZM19.675 28.0001H0.358398V124H19.675V94.9303C21.7972 97.3334 27.9314 98.4031 34.5923 98.4031C55.6593 98.4031 69.2444 82.1241 69.2444 61.597C69.2444 41.0699 56.186 26.5273 35.1344 26.5273C29.8057 26.5273 23.2688 28.2637 19.675 31.597V28.0001ZM19.675 74.5427V52.4187C22.1999 47.7365 26.5992 44.5427 32.9968 44.5427C43.112 44.5427 49.2462 50.8218 49.2462 63.0854C49.2462 73.6125 42.7248 80.4187 31.9279 80.4187C26.4753 80.4187 21.8127 77.7365 19.675 74.5427ZM150.877 62.5582C150.877 41.6125 135.294 26.5428 113.173 26.5428C91.0531 26.5428 75.7331 41.7521 75.7331 62.5582C75.7331 83.3644 91.0531 98.4342 113.173 98.4342C135.294 98.4342 150.877 83.5039 150.877 62.5582ZM130.895 62.5427C130.895 73.752 123.707 80.4187 113.173 80.4187C102.779 80.4187 95.7157 72.6823 95.7157 62.5427C95.7157 51.0854 103.445 44.5428 113.173 44.5428C122.901 44.5428 130.895 51.3334 130.895 62.5427ZM158.221 48.0156C158.221 34.6823 169.281 26.5428 188.071 26.5428C201.269 26.5428 212.453 32.6823 216.852 39.0854L203.654 51.752C199.131 47.0854 192.857 44.5428 184.198 44.5428C180.604 44.5428 178.203 45.3489 178.203 47.8761C178.203 49.8616 182.509 50.9864 188.27 52.4914C199.918 55.5344 217.518 60.1322 217.518 76.5427C217.518 91.752 203.933 98.4186 188.195 98.4186C171.279 98.4186 159.94 90.6822 155.014 81.6125L170.334 71.2094C174.068 76.0156 181.797 80.4187 190.317 80.4187C194.98 80.4187 197.52 79.2249 197.52 76.6822C197.52 74.3041 192.72 72.9689 186.475 71.2316C174.846 67.9967 158.205 63.3675 158.205 48.0156H158.221ZM254.402 27.9998H267.6V11.8758H286.916V28.0153H308.107V46.0153H286.916V68.5579C286.916 76.961 288.775 80.1548 293.98 80.1548C298.503 80.1548 302.112 78.5579 305.846 75.6277L313.839 89.3641C309.037 94.4338 301.586 98.1703 292.121 98.1703C277.591 98.1703 267.6 90.2943 267.6 74.2943V46.0153H254.402V28.0153V27.9998ZM333 32.8372C333 28.4341 329.376 24.8372 324.945 24.8372C320.407 24.8372 316.782 28.3721 316.782 32.8372C316.782 37.3023 320.515 40.8682 324.945 40.8682C329.376 40.8682 333 37.2403 333 32.8372ZM331.575 32.8682C331.575 36.372 328.57 39.4728 324.914 39.4728C321.212 39.4728 318.222 36.4341 318.222 32.8682C318.222 29.3023 321.352 26.2635 324.914 26.2635C328.477 26.2635 331.575 29.1628 331.575 32.8682ZM321.444 37.4883V37.5038L321.429 37.4883H321.444ZM321.444 28V37.4883H323.458V34.3565H324.759L326.789 37.4883H329.159L326.634 33.7209C327.765 33.3178 328.57 32.3255 328.57 30.9922C328.57 29.3953 327.672 28 324.713 28H321.444ZM323.365 29.7519H324.509C325.609 29.7519 326.262 30.093 326.262 31.1937C326.262 32.0619 325.441 32.5581 324.667 32.5581H323.365V29.7519Z" fill="#E5F0FC" />
</svg>
</div>
</div>
</div>
</div>
<div class="section bg-green-500 h-screen">
Section 2
</div>
<div class="section bg-red-500 h-screen">
Section 3
</div>
<div class="section bg-yellow-500 h-screen">
Section 4
</div>
<div class="section bg-purple-500 h-screen">
Section 5
</div>
<div class="section bg-purple-500 h-screen">
Section 6
</div>
</div>
#main-logo-arrows{
width: 120px;
height: 120px;
}
let fullPageInstance = new fullpage("#fullpage", {
licenseKey: "K02SH-4ND5I-XXK6J-N6J5J-UUNYO",
css3: false,
easingcss3: "cubic-bezier(0.57, 0.54, 0.13, 0.99)",
scrollingSpeed: 800
});
let logo = document.querySelector('#hero-logo')
gsap
.timeline({
delay: 0.5
})
.to(logo, {
opacity: 1
})
.from(logo,{
y: () => {
return innerHeight / 1.5;
},
duration: 0.4,
},"<")
.set("#reveal-logo", {
autoAlpha: 1,
display: "block"
})
.from("#logo-letters", {
xPercent: 100,
duration: 0.4,
})
.from(
"#reveal-logo",
{
width: 0,
duration: 0.4,
},
"<"
);
Also see: Tab Triggers