Jump to content

How do I add this codepen animation to my homepage

Recommended Posts

  • Replies 1
  • Views 506
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Add a Code Block >> Paste this code

<div class="bg">
<div class="disc">
	<p>SP-ENG</p>
	<p>A NEW MODEL</p>
	<p>FOR SHARING</p>
	<p>2022</p>
</div>
</div>
<style>
  .bg {
	background-color: #00000015;
}
body.homepage .code-block div {
	perspective: 500px;	
	display: flex;
	justify-content: center;
	flex-direction: column;
	align-items: center;
	height: 100vh;
}

.disc {
	width: 200px;
	height: 300px;
	border-radius: 100%;
	background: transparent;
	border: 3px solid blue;
	color: blue;
	font-size: 20px;
	transform: rotateY(0deg);
	animation: rotateAnimation 5s linear infinite;
}
.bg p{
	margin-top: 5px;
	margin-bottom: 5px;
}

@keyframes rotateAnimation {
	0% {transform: rotateY(0deg) rotateZ(0deg);}
	50% {transform: rotateY(180deg) rotateZ(5deg);}
	100% {transform: rotateY(360deg) rotateZ(0deg);}
}
</style>

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.