<div id="sample">
<!-- リース -->
<div class="wreath"></div>
<!-- ベル -->
<div class="bell">
<!-- ベルの本体 -->
<div class="bell-casting">
<div class="bell-casting-item bell-casting-t"></div>
<div class="bell-casting-item bell-casting-l"></div>
<div class="bell-casting-item bell-casting-r"></div>
<div class="bell-casting-item bell-casting-b"></div>
</div>
<!-- ベルのクラッパー -->
<div class="bell-clapper">
<div class="bell-clapper-item"></div>
</div>
</div>
<!-- 飾り -->
<div class="decoration-item-1 decoration-1"></div>
<div class="decoration-item-1 decoration-2"></div>
<div class="decoration-item-1 decoration-3"></div>
<div class="decoration-item-1 decoration-4"></div>
<div class="decoration-item-1 decoration-5"></div>
<div class="decoration-item-1 decoration-6"></div>
<div class="decoration-item-2 decoration-7"></div>
<div class="decoration-item-2 decoration-8"></div>
<div class="decoration-item-2 decoration-9"></div>
<div class="decoration-item-2 decoration-10"></div>
<div class="decoration-item-2 decoration-11"></div>
</div>
body {
display: flex;
justify-content: center;
align-items: center;
}
#sample{
--wreath-color: #55aa55;
--bell-color: #ffff55;
--background-color: #333;
min-width: 300px;
height: 300px;
background-color: var(--background-color);
display: flex;
justify-content: center;
align-items: center;
position: relative;
padding: 50px;
}
/* リース */
/* リースの外側 */
.wreath {
background-color: var(--wreath-color);
height: 100%;
width: 100%;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
}
/* リースの内側 */
.wreath::after {
content: "";
background-color: var(--background-color);
height: 50%;
width: 50%;
border-radius: 50%;
}
/* ベル */
.bell {
position: absolute;
top: 30px;
width: 100px;
}
.bell-casting {
display: flex;
justify-content: center;
align-items: center;
flex-wrap: wrap;
}
.bell-casting-item {
z-index: 1;
background-color: var(--bell-color);
}
/* 部品1 */
.bell-casting-t {
width: 70px;
height: 30px;
border-radius: 50% / 100% 100% 0% 0%;
}
/* 部品2、部品3 */
.bell-casting-l,
.bell-casting-r {
position: relative;
width: 35px;
height: 60px;
--bell-side-width: 15px;
}
.bell-casting-l::before,
.bell-casting-r::before {
position: absolute;
content: "";
background-color: var(--bell-color);
height: 30px;
width: var(--bell-side-width);
bottom: 0;
}
.bell-casting-l::before {
left: calc(var(--bell-side-width) * -1);
}
.bell-casting-r::before {
right: calc(var(--bell-side-width) * -1);
}
.bell-casting-l::after,
.bell-casting-r::after {
position: absolute;
content: "";
background-color: var(--wreath-color);
height: 30px;
width: var(--bell-side-width);
bottom: 0;
}
.bell-casting-l::after {
border-radius: 0% 0% 100%;
left: calc(var(--bell-side-width) * -1);
}
.bell-casting-r::after {
border-radius: 0% 0% 0% 100%;
right: calc(var(--bell-side-width) * -1);
}
/* 部品4 */
.bell-casting-b {
width: 100%;
height: 10px;
border-radius: 50% / 0 0 100% 100%;
}
/* 部品5 */
.bell-clapper {
position: absolute;
top: 5px;
left: 50%;
transform: translateX(-50%);
}
.bell-clapper-item {
width: 30px;
height: 110px;
background-color: #aaaa55;
border-radius: 0% 0% 50% 50%;
animation-name: shake-bell-clapper;
animation-duration: 3s;
animation-iteration-count: infinite;
transform-origin: left top;
transform-origin: 50% 0;
}
@keyframes shake-bell-clapper {
0% {
transform: rotate(10deg);
}
50% {
transform: rotate(-10deg);
}
100% {
transform: rotate(10deg);
}
}
/* 飾り */
.decoration-item-1,
.decoration-item-2 {
position: absolute;
width: 30px;
height: 30px;
border-radius: 50%;
}
.decoration-item-1 {
background-color: #ff5555;
}
.decoration-item-2 {
background-color: #ff7755;
}
.decoration-1 {
top: 90px;
left: 90px;
}
.decoration-2 {
top: 180px;
left: 50px;
}
.decoration-3 {
top: 290px;
left: 100px;
}
.decoration-4 {
top: 180px;
right: 50px;
}
.decoration-5 {
top: 290px;
right: 100px;
}
.decoration-6 {
top: 90px;
right: 90px;
}
.decoration-7 {
top: 150px;
left: 105px;
}
.decoration-8 {
top: 230px;
left: 105px;
}
.decoration-9 {
top: 275px;
left: 185px;
}
.decoration-10 {
top: 230px;
right: 105px;
}
.decoration-11 {
top: 150px;
right: 105px;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.