下記Beyondコード
JS head
なし
HTML
<div class="purupuruBtn__area">
<a href="○○○" class="purupuruBtn" draggable="false"><span class="purupuruText">テキストが入ります</span></a>
</div>
CSS
.purupuruBtn__area {
width: 100%;
height: auto;
animation: purupuru 1.5s infinite;
}
.purupuruBtn {
padding: 0;
margin: 0 auto;
position: relative;
display: block;
width: 80%;
max-width: 500px;
height: 80px;
border: 1px solid #0b5e29;
border-radius: 10vw;
background: linear-gradient(to bottom, #3acf7a 0%, #006c2b 40%, #006c2b 65%, #3acf7a 100%);
box-shadow: 0px 0px 4px 2px #9ce7bb inset, 0 3px 0 #0b5e29;
text-decoration: none;
overflow: hidden;
opacity: 1;
transition: opacity 0.2s;
}
@media screen and (max-width:600px) {
.purupuruBtn {
height: 60px;
}
}
.purupuruBtn:hover {
opacity: 0.8;
}
.purupuruBtn::before {
content: '';
position: absolute;
border-radius: 40%;
width: 100%;
height: 60%;
background: linear-gradient(to bottom, rgba(250, 250, 255, 1) 0%, rgba(250, 250, 255, 0.7) 10%, rgba(250, 250, 255, 0) 100%);
z-index: 1;
top: -10px;
left: 50%;
transform: translateX(-50%);
}
.purupuruBtn .purupuruText {
display: block;
color: rgba(255, 255, 255, 0.9);
font-weight: 700;
font-size: 30px;
text-shadow: 0px 0px 2px #13562b;
text-align: center;
width: calc(100% - 50px);
height: auto;
padding-right: 50px;
line-height: 80px;
z-index: 1;
position: relative;
}
@media screen and (max-width:600px) {
.purupuruBtn .purupuruText {
line-height: 60px;
font-size: 20px;
}
}
.purupuruBtn .purupuruText:before {
content: '';
width: 30px;
height: 30px !important;
background: linear-gradient(to bottom, #006c2b 0%, #3acf7a 80%);
display: block;
position: absolute;
top: 50%;
right: 20px;
transform: translateY(-50%);
border-radius: 15px;
}
.purupuruBtn .purupuruText:after {
content: '';
width: 0;
height: 0;
border-style: solid;
border-width: 6px 0 6px 8px;
border-color: transparent transparent transparent #ffffff;
position: absolute;
top: 50%;
right: 30px;
transform: translateY(-50%);
}
@keyframes purupuru {
0% {
transform: translate(0, 0);
}
5% {
transform: translate(0, -5px);
}
10% {
transform: translate(0, 5px);
}
15% {
transform: translate(0, -5px);
}
20% {
transform: translate(0, 5px);
}
25% {
transform: translate(0, -5px);
}
30% {
transform: translate(0, 0);
}
100% {
transform: translate(0, 0);
}
}