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="container flex">
<div class="flex main">
<div class="coffee__cont">
<div class="coffee__hand"></div>
<div class="coffee dark__border flex">
<div class="coffee__top dark__border">
<div class="coffee__top__water dark__border flex">
<span class="heart">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="#fcc8a020" width="130px">
<path fill-rule="evenodd" d="M3.172 5.172a4 4 0 015.656 0L10 6.343l1.172-1.171a4 4 0 115.656 5.656L10 17.657l-6.828-6.829a4 4 0 010-5.656z" clip-rule="evenodd" />
</svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="#fcc8a030" width="100px">
<path fill-rule="evenodd" d="M3.172 5.172a4 4 0 015.656 0L10 6.343l1.172-1.171a4 4 0 115.656 5.656L10 17.657l-6.828-6.829a4 4 0 010-5.656z" clip-rule="evenodd" />
</svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="#eeeeee70" width="70px">
<path fill-rule="evenodd" d="M3.172 5.172a4 4 0 015.656 0L10 6.343l1.172-1.171a4 4 0 115.656 5.656L10 17.657l-6.828-6.829a4 4 0 010-5.656z" clip-rule="evenodd" />
</svg>
<svg width="40px" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="#D5792490">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1" d="M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" />
</svg>
</span>
</div>
</div>
<div class="coffee__white_banner"></div>
</div>
</div>
<div class="beans flex">
<div class="bean dark__border bean__1">
<div class="bean__shadow"></div>
<div class="bean__top">
<div class="bean__top__semicircle"></div>
</div>
</div>
<div class="bean dark__border">
<div class="bean__shadow"></div>
<div class="bean__top">
<div class="bean__top__semicircle"></div>
</div>
</div>
</div>
<div class="plate dark__border flex">
<div class="plate__inner dark__border"></div>
</div>
</div>
<a class="twitter_follow flex" href="https://twitter.com/saviomartin7" target="_blank">
<svg width="20" height="20" fill="currentColor" class="text-white opacity-40">
<path d="M6.29 18.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0020 3.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.073 4.073 0 01.8 7.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 010 16.407a11.616 11.616 0 006.29 1.84"></path>
</svg>
<p>Follow me</p>
</a>
</div>
/* Importing Font */
@import url("https://fonts.googleapis.com/css2?family=Poppins&display=swap");
* {
margin: 0;
padding: 0;
}
/* Main */
.container {
height: 100vh;
width: 100vw;
background: #fecc80;
overflow: hidden;
flex-direction: column;
}
.main {
flex-direction: column;
position: relative;
}
/* Reusable Components */
.flex {
display: flex;
align-items: center;
justify-content: center;
}
.dark__border {
border: 3px solid #6a1809;
}
/* Coffee Styling Starts */
.coffee__cont {
position: relative;
}
/* Coffee Hand */
.coffee__hand {
width: 52px;
height: 45%;
z-index: 10;
position: absolute;
top: 22%;
right: -42px;
z-index: 3;
border-radius: 0% 100% 100% 0% / 100% 50% 50% 0%;
transform: rotate(10deg);
border: 20px solid #fbab30;
}
.coffee__hand::before {
border: 3px solid #6a1809;
content: "";
display: block;
position: absolute;
top: 3px;
left: 3px;
right: 0px;
bottom: 3px;
border-radius: 0% 100% 100% 0% / 100% 50% 50% 0%;
}
.coffee__hand::after {
content: "";
border: 3px solid #6a1809;
display: block;
position: absolute;
top: -15%;
left: -1%;
width: 135%;
height: 126%;
border-radius: 0% 100% 100% 0% / 100% 50% 50% 0%;
}
/* Coffee */
.coffee {
width: 250px;
height: 220px;
background: #fbab30;
border-radius: 50% 50% 50% 50% / 35% 35% 65% 65%;
overflow: hidden;
justify-content: flex-start;
flex-direction: column;
position: relative;
z-index: 10;
}
.coffee::after {
content: "";
position: absolute;
top: 0;
right: 0;
width: 17%;
height: 100%;
transform: rotate(13deg);
z-index: 10;
background: #6a180955;
}
.coffee::before {
content: "";
position: absolute;
top: 0;
left: 0;
width: 15%;
height: 100%;
transform: rotate(-15deg);
z-index: 10;
background: #ffffff25;
}
/* Coffee Top Part */
.coffee__top {
margin: 10px;
height: 100px;
width: 205px;
border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%;
background: #d17423;
border: 2px solid #6a180945;
z-index: 12;
}
/* Coffee inside cup */
.coffee__top__water {
margin-top: 10px;
height: 85px;
width: 200px;
border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%;
background-color: #8c5836;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25' viewBox='0 0 1000 1000'%3E%3Cdefs%3E%3CradialGradient id='a' cx='500' cy='500' r='58.2%25' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='0' stop-color='%238C5836'/%3E%3Cstop offset='1' stop-color='%23B2631E'/%3E%3C/radialGradient%3E%3CradialGradient id='b' cx='500' cy='500' r='100%25' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='0' stop-color='%23B76C46' stop-opacity='1'/%3E%3Cstop offset='1' stop-color='%23B76C46' stop-opacity='0'/%3E%3C/radialGradient%3E%3C/defs%3E%3Crect fill='url(%23a)' width='1000' height='1000'/%3E%3Cg fill='none' stroke='%23632A07' stroke-width='4.2' stroke-miterlimit='10' stroke-opacity='.5'%3E%3Ccircle cx='500' cy='500' r='725'/%3E%3Ccircle cx='500' cy='500' r='700'/%3E%3Ccircle cx='500' cy='500' r='675'/%3E%3Ccircle cx='500' cy='500' r='650'/%3E%3Ccircle cx='500' cy='500' r='625'/%3E%3Ccircle cx='500' cy='500' r='600'/%3E%3Ccircle cx='500' cy='500' r='575'/%3E%3Ccircle cx='500' cy='500' r='550'/%3E%3Ccircle cx='500' cy='500' r='525'/%3E%3Ccircle cx='500' cy='500' r='500'/%3E%3Ccircle cx='500' cy='500' r='475'/%3E%3Ccircle cx='500' cy='500' r='450'/%3E%3Ccircle cx='500' cy='500' r='425'/%3E%3Ccircle cx='500' cy='500' r='400'/%3E%3Ccircle cx='500' cy='500' r='375'/%3E%3Ccircle cx='500' cy='500' r='350'/%3E%3Ccircle cx='500' cy='500' r='325'/%3E%3Ccircle cx='500' cy='500' r='300'/%3E%3Ccircle cx='500' cy='500' r='275'/%3E%3Ccircle cx='500' cy='500' r='250'/%3E%3Ccircle cx='500' cy='500' r='225'/%3E%3Ccircle cx='500' cy='500' r='200'/%3E%3Ccircle cx='500' cy='500' r='175'/%3E%3Ccircle cx='500' cy='500' r='150'/%3E%3Ccircle cx='500' cy='500' r='125'/%3E%3Ccircle cx='500' cy='500' r='100'/%3E%3Ccircle cx='500' cy='500' r='75'/%3E%3Ccircle cx='500' cy='500' r='50'/%3E%3Ccircle cx='500' cy='500' r='25'/%3E%3C/g%3E%3Crect fill-opacity='.5' fill='url(%23b)' width='1000' height='1000'/%3E %3C/svg%3E");
background-size: cover;
}
/* White curved line */
.coffee__white_banner {
position: absolute;
top: 0;
left: 0;
height: 165px;
width: 100%;
border-radius: 50% 50% 50% 50% / 40% 40% 40% 40%;
background: #fff;
z-index: 1;
}
.coffee__white_banner::before {
content: "";
position: absolute;
top: 0;
left: 0;
height: 145px;
width: 100%;
border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%;
background: #fbab30;
}
/* Plate Styling */
.plate {
margin-top: -90px;
width: 350px;
height: 139px;
background: #fbebd0;
border-radius: 50%;
box-shadow: 2px 5px 8px 3px #6a180925;
position: relative;
z-index: 0;
overflow: hidden;
}
.plate__inner {
width: 250px;
height: 90px;
background: #fbebd0;
border-radius: 50%;
border: 2px solid #6a1809;
z-index: 3;
}
/* Plate Shadow */
.plate::before {
content: "";
position: absolute;
left: 50%;
top: 0%;
transform: translate(-50%, -50%);
width: 80%;
height: 140%;
border-radius: 50%;
z-index: 10;
background: #6a180955;
}
/* Beans */
.beans {
z-index: 10;
position: absolute;
left: 35px;
bottom: 45px;
}
.bean {
height: 52px;
border-radius: 50% 50% 50% 50% / 50% 50% 65% 65%;
width: 62px;
background: #9a4d39;
overflow: hidden;
position: relative;
}
.bean__top {
height: 30px;
border-radius: 50% 50% 50% 50% / 50% 50% 65% 65%;
width: 62px;
background: #ae7045;
border-bottom: 4px solid #6a1809;
overflow: hidden;
}
/* Beans shadow */
.bean__shadow {
content: "";
position: absolute;
top: 0;
right: 0;
width: 30%;
height: 150%;
transform: rotate(13deg);
z-index: 10;
background: #6a180985;
}
.bean__top__semicircle {
width: 100%;
height: 50%;
border-bottom: 3px solid #6a1809;
}
.bean__1 {
transform: rotate(-50deg);
margin-right: -20px;
margin-top: -20px;
}
/* Heart */
.heart {
position: relative;
transform: scale(0.75);
}
.heart svg {
position: absolute;
left: 50%;
top: 0%;
transform: translate(-50%, -50%);
}
/* Twitter */
.twitter_follow {
position: absolute;
bottom: 10px;
right: 10px;
background: #fff;
padding: 7px 10px;
border-radius: 10px;
border: 2px solid #6a1809;
text-decoration: none;
color: #000;
}
.twitter_follow p {
margin-left: 5px;
font-family: "Poppins", sans-serif;
}
/*
Built with ❤️ by Savio Martin
Follow on Twitter:
https://twitter.com/saviomartin7/
Copyright (c) 2020 Savio Martin
Permission is hereby granted, free of charge, to any person obtaining a copy of this project including, modify, merge, publish, distribute, etc
Have a good day, Enjoy your ☕️
*/
Also see: Tab Triggers