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.
<header class="header">
<div class="header-logo">
<svg id="logo" width="41" height="22" viewBox="0 0 41 22" fill="none">
<path d="M33.7857 18.6786C33.739 18.6552 33.6903 18.6252 33.6399 18.5889C31.7025 17.4062 27.6816 15.275 25.9746 15.5536C24.9235 17.4362 23.9189 19.5535 23.2857 21C18.4456 18.9651 7.21239 12.1163 1 1L39.268 6.25659C39.5365 6.25356 39.7837 6.28434 40 6.35714L39.268 6.25659C37.6925 6.27436 35.3842 7.45629 34.2857 8.14286C35.2571 10.2857 34.3571 16.0595 33.7857 18.6786Z" fill="white" />
<path d="M1 1L40 6.35714C38.5143 5.85714 35.5714 7.33929 34.2857 8.14286M1 1L29.3571 11.3571M1 1L34.2857 8.14286M1 1C7.21239 12.1163 18.4456 18.9651 23.2857 21C23.9189 19.5535 24.9235 17.4362 25.9746 15.5536M29.3571 11.3571C30.3571 13.5595 32.6429 18.1071 33.7857 18.6786M29.3571 11.3571C28.5217 11.4345 27.2158 13.3304 25.9746 15.5536M33.7857 18.6786C34.3571 16.0595 35.2571 10.2857 34.2857 8.14286M33.7857 18.6786C31.9116 17.5179 27.7257 15.2679 25.9746 15.5536" stroke="#FF8989" />
</svg>
<span class="header-letter">
Letter
</span>
</div>
<ul class="menu">
<li class="menu-item">Plugins</li>
<li class="menu-item">Pricing</li>
<li class="menu-item">Log in</li>
<li class="menu-item">Free Trial</li>
</ul>
</header>
<div class="container">
<!-- SVG-->
<aside>
<!-- Hand SVG -->
<div class="hand_container">
<svg class="hand" viewBox="0 0 170 275" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M168.174 1c1.192 13.536 2.002 42.033-4.29 47.732-7.866 7.124-5.721 59.131-17.878 78.366-12.156 19.236-23.598 31.347-31.464 34.909-6.292 2.849-12.156 12.586-14.301 17.098-1.669 2.137-6.865 7.124-14.302 9.974-7.437 2.849-14.54 6.886-17.162 8.549m0 0c-3.1 3.324-10.44 10.116-15.017 10.686a15.85 15.85 0 0 1-2.48.894m17.497-11.58c-4.752-2.254-14.905-3.094-17.497 11.58m59.687-55.75c-5.006-.713-13.587 5.699-15.732 7.836-2.145 2.138-15.732 11.399-18.592 13.536-2.86 2.138-19.308 13.536-25.029 17.811-4.478 3.346-5.45 4.946-6.005 8.901m5.67 7.666c-3.044.81-6.541.65-6.1-3.744.155-1.547.276-2.825.43-3.922m0 0C41.175 207.124 30.734 218.43 24.441 219m0 0c-7.866.713-14.302-3.562-11.441-12.111a18.543 18.543 0 0 1 1.216-2.849M24.441 219c7.437-15.958-3.718-16.623-10.225-14.96m55.99-71.242c-.714 5.699-30.033 34.908-36.469 39.895-6.436 4.987-8.58 14.961-10.011 19.948-.95 3.315-4.114 4.741-6.968 7.836m-2.542 3.563a16.979 16.979 0 0 1 2.542-3.563m0 0c-.459-9.727-.164-29.105 3.844-39.183m25.292-47.732c1.43 5.7-15.017 34.196-22.883 43.458-.923 1.086-1.72 2.543-2.41 4.274m0 0c-2.772-3.799-7.03-14.533-1.88-27.072 2.497-6.082 4.887-11.307 6.835-15.673m4.606-14.248c.437 2.615-1.535 7.365-4.606 14.248m0 0c-1.774-5.937-4.257-19.235 0-24.934 5.32-7.125 18.953-18.523 25.724-24.223 4.67-3.932 16.67-9.22 25.54-12.823m9.119-3.562c-1.774.662-5.13 1.942-9.118 3.562m0 0l-.894-54.144M19.667 219.244l-11.488 19.2m0 0c1.436 3.556 6.462 10.382 15.077 9.245M8.18 238.444L1 274l22.256-26.311m0 0l22.975-39.112" stroke="#FF8989" stroke-width="2" />
</svg>
<!-- Line group -->
<svg class="line" viewBox="0 0 78 1272"fill="none" xmlns="http://www.w3.org/2000/svg">
<path class="draw" d="M40.5 1.5V1270" stroke="url(#paint0_linear)" stroke-width="3" stroke-linecap="round" />
<circle class="circle2" cx="39" cy="229" r="39" fill="#FFCECB" />
<path class="draw" d="M56.19 242.599a3.592 3.592 0 0 1-3.591 3.592H27.454a3.592 3.592 0 0 1-3.592-3.592v-12.573m0-12.572a3.592 3.592 0 0 1 3.592-3.592h25.145a3.592 3.592 0 0 1 3.592 3.592v19.307h-8.083l-5.388-5.388-4.04 5.388-11.226-9.429-3.592 2.694m0 0v-6.145" stroke="#FF8787" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
<path class="draw" d="M52.496 224.638a4.388 4.388 0 1 1-8.775 0 4.388 4.388 0 0 1 8.776 0z" stroke="#FF8787" stroke-width="2" />
<ellipse class="circle" cx="39" cy="754.133" rx="39" ry="40.133" fill="#FFCECB" />
<path class="draw" d="M56.02 767.51c0 1.919-1.67 3.474-3.73 3.474H26.176c-2.06 0-3.73-1.555-3.73-3.474v-18.105m0-6.216c0-1.919 1.67-3.475 3.73-3.475H52.29c2.06 0 3.73 1.556 3.73 3.475v18.675m-22.114-16.442v19.854l13.855-9.927-13.855-9.927z" stroke="#FF8787" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
<defs>
<linearGradient id="paint0_linear" x1="39.013" y1="312.789" x2="39.013" y2="1126.71" gradientUnits="userSpaceOnUse">
<stop offset=".486" stop-color="#FF8989" stop-opacity=".38" />
<stop offset="1" stop-color="#FF7676" />
</linearGradient>
</defs>
</svg>
</div>
</aside>
<!-- Main content-->
<div class="input_container">
<div class="input_header">
<h1 class="main_header u-margin">Updates</h1>
<h2 class="main_secondary-header">Stay in the know</h2>
</div>
<form class="flex-form">
<input class="input-border" type="search" placeholder="Be the first to know">
<input type="submit" value="Submit">
</form>
</div>
<div class="article_container">
<article class="main_updates update_1">
<div>
<h2 class="main_header align_left">
Letter 2.1
</h2>
<p>
<b> Sync photos from other platforms -</b> This version will allow you to manually sync your photos from Dropbox, iCloud, Google Drive, and more using the new option in the import menu.
</p>
</div>
<a href="">Click here to download</a>
</article>
<article class="fixes">
<h3>Fixes</h3>
<span class="date">21 Feb 2019</span>
<ul>
<li>- Bold, italic, and strikethrough shortcuts work on ffselections.
- You can now use /checkbox to create To-Do blocks.</li>
<li>- Fixed a bug where push notifications randomly ffstop working in the iOS app. 😅</li>
<li>- Added Window > Maximize to the desktop system ffmenu so you can find windows that are rendered.</li>
</ul>
</article>
<article class="main_updates update_2">
<h2 class="main_header align_left">
Letter 2.0
</h2>
<p>
<b> Sync photos from other platforms -</b> This version will allow you to manually sync your photos from Dropbox, iCloud, Google Drive, and more using the new option in the import menu.
</p>
<a href="">Click here to download</a>
</article>
<article class="fixes">
<h3>Fixes</h3>
<span class="date">21 Feb 2019</span>
<ul>
<li>- Bold, italic, and strikethrough shortcuts work on ffselections.
- You can now use /checkbox to create To-Do blocks.</li>
<li>- Fixed a bug where push notifications randomly ffstop working in the iOS app. 😅</li>
<li>- Added Window > Maximize to the desktop system ffmenu so you can find windows that are rendered.</li>
</ul>
</article>
</div>
</div>
body {
background: #fff8f4;
max-width: 1300px;
margin: 0 auto;
font-family: "Alegreya", serif;
font-style: normal;
}
/*--------Header--------*/
//Header
.header {
font-weight: bold;
font-size: 20px;
//setting up first grid.
display: grid;
grid-template-columns: 20% 1fr;
@media (max-width: 860px) {
grid-template-columns: 1fr;
padding: 45px;
}
}
.header-logo {
align-self: center;
margin-left: 2rem;
}
#logo {
transition: all 0.5s ease-out;
}
#logo:hover {
transform: perspective(400px) translate3d(-10px, 0px, -10px) scale(0.93);
}
.header-letter {
font-size: 30px;
color: #6a4a39;
}
.menu {
font-size: 20px;
color: #000000;
opacity: 0.7;
list-style: none;
// setting up flexbox for menu
display: flex;
justify-content: flex-end;
&-item {
margin: 47px 45px;
position: relative;
}
@media (max-width: 860px) {
display: none;
}
}
// setting up line animation for menu items.
.menu-item::after {
content: "";
display: block;
width: 100%;
height: 3px;
background-color: #6a4a39;
position: absolute;
visibility: hidden;
transform-origin: left;
transform: scale(0);
transition: 0.25s ease-out;
}
.menu-item:hover::after {
visibility: visible;
transform: scale(1);
}
.menu-item:last-of-type {
color: #ff7676;
border-bottom: 4px solid #f8d1be;
}
/*--------Page container--------*/
.container {
display: grid;
grid-template-areas:
"draw update"
"draw update2";
grid-template-columns: 20% 1fr;
}
/*--------Aside with hand animation-------*/
aside {
grid-area: draw;
}
.hand_container {
display: grid;
justify-content: center;
grid-template-rows: 300px 1fr;
grid-template-columns: 400px;
.hand {
justify-self: end;
margin-top: 2rem;
margin-right: 2rem;
max-width: 170px;
width: 100%;
}
.line {
justify-self: center;
max-width: 78px;
width: 100%;
height: 1272px;
}
}
.draw {
visibility: hidden;
}
.circle,
.circle2 {
opacity: 0;
}
/*--------Main Content--------*/
.main {
color: #6a4a39;
font-weight: bold;
line-height: normal;
}
.main_header {
color: #6a4a39;
font-size: 60px;
margin-top: 0;
}
.u-margin {
margin: 60px 0 0 0;
text-align: center;
}
.main_secondary-header {
text-align: center;
font-size: 20px;
margin: 0;
}
/*--------input--------*/
.input_container {
grid-area: update;
display: flex;
flex-direction: column;
justify-content: space-between;
align-content: center;
height: 300px;
input[type="search"] {
flex-basis: 100%;
height: 55px;
padding: 0 5px;
border: 1px solid #b39889;
box-sizing: border-box;
font-size: 20px;
color: #6a4a39;
font-family: "Alegreya", serif;
}
input[type="submit"] {
width: 151px;
height: 55px;
background: #333333;
font-size: 20px;
color: #ffffff;
font-family: "Alegreya", serif;
}
}
.flex-form {
display: flex;
margin: 0 auto;
}
.flex-form > * {
border: 0;
background: #fff;
line-height: 50px;
font-size: 1rem;
border-radius: 0;
outline: 0;
max-height: 54px;
}
/*--------Articles--------*/
.article_container {
grid-area: update2;
margin: 8rem 2rem 2rem 2rem;
display: grid;
grid-template-columns: repeat(2, minmax(300px, 430px));
grid-template-rows: repeat(2, minmax(500px, auto));
grid-column-gap: 6rem;
}
.main_updates {
display: flex;
max-height: 400px;
height: 100%;
flex-direction: column;
justify-content: space-between;
align-content: space-between;
a {
margin-top: auto;
font-weight: bold;
font-size: 20px;
text-decoration-line: underline;
color: #ff8989;
}
}
.fixes {
display: grid;
grid-template-areas:
"title date"
"text text";
grid-template-columns: repeat(2, minmax(100px, auto));
grid-template-rows: repeat(2, minmax(25px, auto));
grid-gap: 0px;
}
.fixes h3 {
grid-area: title;
align-self: center;
margin: 0;
font-weight: bold;
font-size: 20px;
line-height: normal;
color: #000000;
}
.date {
grid-area: date;
justify-self: end;
align-self: center;
font-family: "Roboto", sans-serif;
font-size: 12px;
font-weight: 500;
text-align: center;
color: #ffffff;
background: #b39889;
border-radius: 10px;
padding: 5px 10px;
}
.fixes ul {
grid-area: text;
list-style: none;
font-size: 20px;
color: #000000;
li {
margin: 0.5rem;
line-height: 1.5;
}
}
.main_updates p {
font-size: 20px;
line-height: 1.5;
color: #000000;
}
@media all and (max-width: 800px) {
.container {
margin: 2rem;
display: grid;
grid-template-areas:
"update"
"update2";
grid-template-columns: 1fr;
grid-row-gap: 4rem;
grid-column-gap: 2rem;
}
.hand_container {
display: none;
}
.flex-form {
width: 100%;
}
.flex-form > * {
font-size: 0.9rem;
}
input[type="search"] {
flex-basis: 100%;
}
.main_header {
font-size: 30px;
}
.article_container {
margin: 2rem;
display: grid;
grid-template-columns: repeat(1, minmax(300px, 430px));
grid-template-rows: auto;
grid-row-gap: 4rem;
grid-column-gap: 2rem;
}
}
@media all and (max-width: 560px) {
.flex-form {
display: flex;
flex-direction: column;
}
.flex-form input[type="submit"] {
margin-left: 0;
}
input[type="search"] {
flex-basis: 0;
}
}
gsap.set(".draw", {
visibility: "visible"
});
gsap.registerPlugin(ScrollTrigger, DrawSVGPlugin);
const draw = () => {
let tl = gsap.timeline({
defaults: {duration: 3, ease:'none'},
scrollTrigger: {
trigger: "#svg",
scrub: true,
start: "top top",
}
})
tl.to('.hand',{
y: 1270,
ease: "none"
})
.from(".draw", 3,
{drawSVG: 0}, "<")
.to(".circle",
{
duration: 0.5,
autoAlpha:1,
ease:"bounce"
}
,"<")
.to(".circle2",
{
duration: 0.5,
autoAlpha:1,
scale: 1,
ease:"bounce"
}, "<0.8"
)
}
//master timeline
const master = gsap.timeline()
master.add(draw());
Also see: Tab Triggers