HTMLの書き方
head終了タグ直前に自作のCSSを読み込みます。
<link rel="stylesheet" type="text/css" href="css/5-3.css">
body内のアニメーションを表示させたい場所にHTMLを記載します。
<div class="fluid"></div>
CSSの書き方
※border-radius の値は「Fancy Border Radius Generator」(https://9elements.github.io/fancy-border-radius/)」などのジェネレーターを使うと数値が出しやすい。
.fluid {
width:40vh;/*横幅*/
height: 40vh;/*縦幅*/
background:#fff100;/*背景色*/
animation: fluidrotate 30s ease 0s infinite;/*アニメーションの設定*/
}
@keyframes fluidrotate {
0%, 100% {
border-radius: 63% 37% 54% 46%/55% 48% 52% 45%;
}
14% {
border-radius: 40% 60% 54% 46%/49% 60% 40% 51%;
}
28% {
border-radius: 54% 46% 38% 62%/49% 70% 30% 51%;
}
42% {
border-radius: 61% 39% 55% 45%/61% 38% 62% 39%;
}
56% {
border-radius: 61% 39% 67% 33%/70% 50% 50% 30%;
}
70% {
border-radius: 50% 50% 34% 66%/56% 68% 32% 44%;
}
84% {
border-radius: 46% 54% 50% 50%/35% 61% 39% 65%;
}
}