Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

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.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

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.

+ add another resource

Packages

Add Packages

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.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div class="bb-8">
  <div class="bb-8__robot">
    <div class="bb-8__head">
      <div class="bb-8__eye"></div>
    </div>
    <div class="bb-8__shadow"></div>
    <div class="bb-8__body">
      <div class="bb-8__circle bb-8__circle_position_top"></div>
      <div class="bb-8__circle bb-8__circle_position_bottom"></div>
      <div class="bb-8__circle bb-8__circle_position_right"></div>
    </div>
    <div class="bb-8__star bb-8__star_color_blue"></div>
    <div class="bb-8__star bb-8__star_color_blue"></div>
    <div class="bb-8__star bb-8__star_color_blue"></div>
    <div class="bb-8__star bb-8__star_color_blue"></div>
    <div class="bb-8__star bb-8__star_color_orange"></div>
    <div class="bb-8__star bb-8__star_color_orange"></div>
    <div class="bb-8__star bb-8__star_color_orange"></div>
    <div class="bb-8__star bb-8__star_color_orange"></div>
    <div class="bb-8__star bb-8__star_color_orange"></div>
    <div class="bb-8__star bb-8__star_color_pink"></div>
    <div class="bb-8__star bb-8__star_color_pink"></div>
    <div class="bb-8__star bb-8__star_color_pink"></div>
    <div class="bb-8__star bb-8__star_color_pink"></div>
    <div class="bb-8__star bb-8__star_color_pink"></div>
    <div class="bb-8__star bb-8__star_color_pink"></div>
    <div class="bb-8__star bb-8__star_color_blue"></div>
  </div>
  <div class="bb-8__ground">
    <div class="bb-8__layout">
      <div class="bb-8__ground-top-line"></div>
      <div class="bb-8__ground-bottom-line"></div>
    </div>
    <div class="bb-8__layout">
      <div class="bb-8__ground-top-line"></div>
      <div class="bb-8__ground-bottom-line"></div>
    </div>
  </div>
</div>
              
            
!

CSS

              
                :root {
	--bb-blue: #244356;
	--bb-light-blue: #EBF2FA;
	--bb-middle-blue: #C4DEED;
	--bb-orange: #FDC23E;
	--bb-blue-star: #38B4C1;
	--bb-pink-star: #FF7761;
	--bb-orange-star: #FDC23E;
}

.bb-8 {
	position: relative;
	width: 800px; height: 500px;
	margin: auto;
	overflow: hidden;
	background: #F5FAFC;
}
	.bb-8 *, .bb-8 *::before, .bb-8 *::after {
		position: absolute;
		content: '';
	}
	.bb-8__robot {
		top: 100px; left: 230px;
		width: 244px; height: 282px;
	}
	.bb-8__head {
		top: 5px; left: -16px;
		width: 170px; height: 105px;
		background: var(--bb-light-blue);
		box-sizing: border-box;
		border-radius: 100px 100px 20px 20px;
		border: 7px solid var(--bb-blue);
		box-shadow: inset -16px 0px 0 var(--bb-middle-blue), inset 18px 0px 0 white;
		transform: rotate(-30deg);
		z-index: 2;
	}
		.bb-8__head:after {
			top: 59px; left: 120px;
			width: 14px; height: 14px;
			background-color: var(--bb-blue);
			border-radius: 100%;
		}
		.bb-8__head:before {
			width: 100%; height: 100%;
			border-radius: 90px 90px 12px 12px;
			box-shadow: inset 0px -15px 0 rgba(0, 0, 0, 0.1);
		}
	.bb-8__eye {
		top: 21px; left: 50px;
		height: 56px; width: 56px;
		background-color: #2A6B80;
		border-radius: 100%;
		box-sizing: border-box;
		border: 7px solid var(--bb-blue);
		overflow: hidden;
		z-index: 1;
	}
		.bb-8__eye:after {
			top: -14px; left: 26px;
			height: 70px; width: 10px;
			transform: rotate(52deg);
			background-color: #449BAA;
		}
		.bb-8__eye:before {
			top: -14px; left: 3px;
			height: 70px; width: 6px;
			transform: rotate(52deg);
			background-color: #449BAA;
		}
	.bb-8__shadow {
		bottom: 0; right: 0;
		width: 218px; height: 218px;
		box-sizing: border-box;
		border-radius: 100%;
		overflow: hidden;
		z-index: 1;
	}
		.bb-8__shadow:before {
			top: -10%; left: -22%;
			width: 200%; height: 200%;
			border-radius: 100%;
			box-shadow: inset 20px 40px 0 0 rgba(0, 0, 0, 0.06);
		}
		.bb-8__shadow:after {
			bottom: 0; right: 0;
			width: 100%; height: 100%;
			border-radius: 100%;
			box-shadow: inset -34px -19px 0 0 rgba(0, 0, 0, 0.1);
		}
	.bb-8__body {
		bottom: 0; right: 0;
		width: 218px; height: 218px;
		box-sizing: border-box;
		border: 7px solid var(--bb-blue);
		border-radius: 100%;
		background: var(--bb-light-blue);
		overflow: hidden;
		animation: body 2s linear infinite;
	}
	.bb-8__circle {
		width: 44px; height: 44px;
		border-radius: 100%;
		box-shadow: 0 0 0 7px var(--bb-blue), 0 0 0 46px var(--bb-orange), 0 0 0 53px var(--bb-blue);
	}
	.bb-8__circle_position_top {
		top: 30px; left: 0px;
	}
		.bb-8__circle_position_top:before {
			top: -10px; left: 90px;
			width: 60px; height: 7px;
			transform: rotate(-12deg);
			background-color: var(--bb-blue);
		}
	.bb-8__circle_position_right {
		top: -40px; right: -40px;
		height: 70px; width: 70px;
	}
		.bb-8__circle_position_right:before {
			width: 54px; height: 7px;
			top: 138px; left: -21px;
			transform: rotate(-77deg);
			background-color: var(--bb-blue);
		}
	.bb-8__circle_position_bottom {
		top: 175px; left: 130px;
	}
		.bb-8__circle_position_bottom:before {
			width: 52px; height: 7px;
			top: -54px; left: -71px;
			transform: rotate(48deg);
			background-color: var(--bb-blue);
		}
	.bb-8__star {
		width: 30px; height: 30px;
	}
		.bb-8__star_color_blue:before {
			background: -webkit-radial-gradient(0 100%, circle, rgba(56, 180, 193, 0) 70%, var(--bb-blue-star) 70%), 
			-webkit-radial-gradient(100% 100%, circle, rgba(56, 180, 193, 0) 70%, var(--bb-blue-star) 70%), 
			-webkit-radial-gradient(100% 0, circle, rgba(56, 180, 193, 0) 70%, var(--bb-blue-star) 70%), 
			-webkit-radial-gradient(0 0, circle, rgba(56, 180, 193, 0) 70%, var(--bb-blue-star) 70%);
			background-position: bottom left, bottom right, top right, top left;
			background-size: 50% 50%;
			background-repeat: no-repeat;
		}
		.bb-8__star_color_orange:before {
			background: -webkit-radial-gradient(0 100%, circle, rgba(253, 194, 62, 0) 70%, var(--bb-orange-star) 70%), 
			-webkit-radial-gradient(100% 100%, circle, rgba(253, 194, 62, 0) 70%, var(--bb-orange-star) 70%), 
			-webkit-radial-gradient(100% 0, circle, rgba(253, 194, 62, 0) 70%, var(--bb-orange-star) 70%), 
			-webkit-radial-gradient(0 0, circle, rgba(253, 194, 62, 0) 70%, var(--bb-orange-star) 70%);
			background-position: bottom left, bottom right, top right, top left;
			background-size: 50% 50%;
			background-repeat: no-repeat;
		}
		.bb-8__star_color_pink:before {
			background: -webkit-radial-gradient(0 100%, circle, rgba(255, 119, 97, 0) 70%, var(--bb-pink-star) 70%), 
			-webkit-radial-gradient(100% 100%, circle, rgba(255, 119, 97, 0) 70%, var(--bb-pink-star) 70%), 
			-webkit-radial-gradient(100% 0, circle, rgba(255, 119, 97, 0) 70%, var(--bb-pink-star) 70%), 
			-webkit-radial-gradient(0 0, circle, rgba(255, 119, 97, 0) 70%, var(--bb-pink-star) 70%);
			background-position: bottom left, bottom right, top right, top left;
			background-size: 50% 50%;
			background-repeat: no-repeat;
		}
		.bb-8__star:before {
			width: 100%; height: 100%;
			animation: star-size 1s linear infinite;
		}
	.bb-8__star:nth-child(4) {
		top: 44px; left: 193px;
		animation-delay: -.1s;
		animation: star4 1s linear infinite;
	}
	.bb-8__star:nth-child(5) {
		top: 126px; left: 272px;
		transform: scale(0.7);
		animation-delay: -.2s;
		animation: star5 .9s linear infinite;
	}
	.bb-8__star:nth-child(6) {
		top: 193px; left: 235px;
		transform: scale(0.7);
		animation-delay: -.3s;
		animation: star5 1.2s linear infinite;
	}
	.bb-8__star:nth-child(7) {
		top: 35px; left: 270px;
		transform: scale(1.2);
		animation-delay: -.4s;
		animation: star7 1s linear infinite;
	}
	.bb-8__star:nth-child(8) {
		top: 85px; left: 232px;
		animation-delay: -.5s;
		animation: star8 1.3s linear infinite;
	}
	.bb-8__star:nth-child(9) {
		top: 158px; left: 299px;
		transform: scale(0.5);
		animation-delay: -.6s;
		animation: star9 .8s linear infinite;
	}
	.bb-8__star:nth-child(10) {
		top: 75px; left: 392px;
		transform: scale(0.5);
		animation-delay: -.7s;
		animation: star9 .9s linear infinite;
	}
	.bb-8__star:nth-child(11) {
		top: 115px; left: 364px;
		transform: scale(0.7);
		animation-delay: -.8s;
		animation: star11 1s linear infinite;
	}
	.bb-8__star:nth-child(12) {
		top: 123px; left: 418px;
		transform: scale(0.5);
		animation-delay: -.9s;
		animation: star12 1.1s linear infinite;
	}
	.bb-8__star:nth-child(13) {
		top: 160px; left: 351px;
		transform: scale(0.5);
		animation-delay: -.8s;
		animation: star12 1s linear infinite;
	}
	.bb-8__star:nth-child(14) {
		top: 73px; left: 340px;
		transform: scale(0.5);
		animation-delay: -.7s;
		animation: star12 .9s linear infinite;
	}
	.bb-8__star:nth-child(15) {
		top: 197px; left: 276px;
		transform: scale(0.5);
		animation-delay: -.6s;
		animation: star9 .8s linear infinite;
	}
	.bb-8__star:nth-child(16) {
		top: 233px; left: 195px;
		transform: scale(0.6);
		animation-delay: -.5s;
		animation: star16 1s linear infinite;
	}
	.bb-8__star:nth-child(17) {
		top: 10px; left: 150px;
		transform: scale(0.8);
		animation-delay: -.4s;
		animation: star17 1.1s linear infinite;
	}
	.bb-8__star:nth-child(18) {
		top: 100px; left: 305px;
		transform: scale(1.2);
		animation-delay: -.3s;
		animation: star7 .9s linear infinite;
	}
	.bb-8__star:nth-child(19) {
		top: 25px; left: 214px;
		transform: scale(0.7);
		animation-delay: -.2s;
		animation: star19 .8s linear infinite;
	}
	.bb-8__ground {
		top: 380px; left: 110px;
		width: 570px; height: 60px;
		overflow: hidden;
	}
	.bb-8__layout:nth-child(1) {
		left: -100%;
		width: 100%; height: 100%;
		animation: ground 2s linear infinite;
		animation-delay: 1s;
	}
	.bb-8__layout:nth-child(2) {
		left: -100%;
		width: 100%; height: 100%;
		animation: ground 2s linear infinite;
	}
	.bb-8__ground-top-line {
		height: 7px; width: 103px;
		border-radius: 7px;
		background-color: var(--bb-blue);
	}
	.bb-8__ground-top-line:after {
		top: 0px; left: 112px;
		height: 7px; width: 90px;
		border-radius: 7px;
		background-color: var(--bb-blue);
	}
	.bb-8__ground-top-line:before {
		height: 7px; width: 360px;
		top: 0px; left: 210px;
		border-radius: 7px;
		background-color: var(--bb-blue);
	}
	.bb-8__ground-bottom-line {
		height: 7px; width: 106px;
		top: 50px; left: 80px;
		border-radius: 7px;
		background-color: var(--bb-blue);
	}
	.bb-8__ground-bottom-line:after {
		height: 7px; width: 40px;
		top: 0; left: 140px;
		border-radius: 7px;
		background-color: var(--bb-blue);
	}
	.bb-8__ground-bottom-line:before {
		height: 7px; width: 120px;
		top: 0; left: 290px;
		border-radius: 7px;
		background-color: var(--bb-blue);
	}

@keyframes body {
	100% { transform: rotate(-360deg); }
}
@keyframes ground {
	0% { transform: translateX(-100%); }
	100% { transform: translateX(200%); }
}
@keyframes star-size {
	0% { transform: scale(0); }
	30% { transform: scale(1); }
	100% { transform: scale(0); }
}
@keyframes star4 {
	0% { transform: scale(1.1) translateX(0); }
	30% { transform: scale(1.1) translateX(96px); }
	100% { transform: scale(1.1) translateX(192px); }
}
@keyframes star5 {
	0% { transform: scale(0.7) translateX(0);}
	30% { transform: scale(0.7) translateX(114px); }
	100% { transform: scale(0.7) translateX(228px); }
}
@keyframes star7 {
	0% { transform: scale(1.2) translateX(0); }
	20% { transform: scale(1.2) translateX(160px); }
	100% { transform: scale(1.2) translateX(320px); }
}
@keyframes star8 {
	0% { transform: translateX(0); }
	20% { transform: translateX(159px); }
	100% { transform: translateX(318px); }
}
@keyframes star9 {
	0% { transform: scale(0.5) translateX(0); }
	20% { transform: scale(0.5) translateX(150px); }
	100% { transform: scale(0.5) translateX(300px); }
}
@keyframes star11 {
	0% { transform: scale(0.7) translateX(0); }
	30% { transform: scale(0.7) translateX(158px); }
	100% { transform: scale(0.7) translateX(316px); }
}
@keyframes star12 {
	0% { transform: scale(0.5) translateX(0); }
	30% { transform: scale(0.5) translateX(161px); }
	100% { transform: scale(0.5) translateX(322px); }
}
@keyframes star16 {
	0% { transform: scale(0.6) translateX(0); }
	20% { transform: scale(0.6) translateX(163px); }
	100% { transform: scale(0.6) translateX(325px); }
}
@keyframes star17 {
	0% { transform: scale(0.8) translateX(0); }
	30% { transform: scale(0.8) translateX(160px); }
	100% { transform: scale(0.8) translateX(320px); }
}
@keyframes star19 {
	0% { transform: scale(0.7) translateX(0); }
	30% { transform: scale(0.7) translateX(168px); }
	100% { transform: scale(0.7) translateX(336px); }
}
              
            
!

JS

              
                // based on Justas Galaburda illustration https://dribbble.com/shots/4064529-BB8-Riding
              
            
!
999px

Console