I am currently working on my personal portfolio website and I am trying to center and align a circular shape that I have animated using CSS. I want to make sure that it remains responsive as well.
So far, I have attempted to use flexbox. Here is the code that I have used:
:root {
--background: #005;
--primary: #88D5BF;
--secondary: #5D6BF8;
--third: #e27fcb;
}
body {
margin: 0;
padding: 0;
width: 100vw;
height: 100vh;
overflow: hidden;
background: #f00b55;
display: flex;
align-items: center;
}
.main-logo {
width: 90px;
}
h1 {
color: white;
font-size: 20vmin;
line-height: 1;
font-family: ivypresto-display, serif;
font-weight: 400;
font-style: normal;
padding-left: 40px;
text-align: center;
}
header {
display: flex;
justify-content: center;
align-items: center;
margin-left: 50px;
margin-top: 50px;
}
.blob {
position: absolute;
top: 0;
left: 0;
background: linear-gradient(45deg, var(--primary) 0%, var(--secondary) 100%);
animation: morph 8s ease-in-out infinite;
border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
height: 500px;
transition: all 1s ease-in-out;
width: 500px;
transform-origin: 50% 50%;
z-index: -1;
@keyframes morph {
0% {
border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
background: linear-gradient(45deg, var(--primary) 0%, var(--secondary) 100%);
}
50% {
border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
background: linear-gradient(45deg, var(--third) 0%, var(--secondary) 100%);
}
100% {
border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
background: linear-gradient(45deg, var(--primary) 0%, var(--secondary) 100%);
}
}
}
<!-- Header-->
<header>
<div class="blob">
</div>
<h1>Abbie is a<br>graduate UX/UI designer</h1>
</header>