这里是css样式代码
/**************** 蓝色科技感文本面板 ****************/
.hot-spot {
background-image: url("../../img/marker/circleBlue.png");
position: absolute;
background-repeat: no-repeat;
user-select: none;
z-index: 100000;
width: 70px;
height: 44px;
background-size: cover;
bottom: -80px;
left: -30px;
}
.hot-spot-board {
background-image: url("../../img/marker/divBlue.png");
top: -165px;
transform: translateX(-30%);
width: 180px;
height: 52px;
padding: 15px 0;
background-position: 50%;
background-size: contain;
cursor: pointer;
position: absolute;
background-repeat: no-repeat;
}
.hot-spot:hover {
background-image: url("../../img/marker/divYellow.png");
position: absolute;
background-repeat: no-repeat;
user-select: none;
z-index: 999;
width: 70px;
height: 44px;
background-size: cover;
bottom: -60px;
left: calc(50% - 3px);
}
.hot-spot-line {
position: absolute;
top: -108px;
left: 35px;
width: 2px;
height: 140px;
background: linear-gradient(180deg, #38c9ff, transparent);
}
.hot-spot-line:before {
height: 40%;
left: 6px;
animation: rise 3s linear 2s infinite;
-webkit-animation: rise 3s linear 2s infinite;
content: "";
display: block;
width: 1px;
background: linear-gradient(180deg, #38c9ff, transparent);
position: absolute;
cursor: pointer;
}
.hot-spot-line:after {
content: "";
display: block;
width: 1px;
background: linear-gradient(180deg, #38c9ff, transparent);
position: absolute;
cursor: pointer;
height: 60%;
left: -5px;
animation: rise 3s linear infinite;
-webkit-animation: rise 3s linear infinite;
}
.hot-spot-board h5{
width: 100%;
text-align: center;
line-height: 24px;
color: #beedff;
font-size: 16px;
margin: 0;
}
这里是关于他的动画的设置,我作为初学者第一次使用annimation这个属性,但是实现效果还是非常不错的。总之非常好看而且自己试试很有成就感的!
@keyframes rise {
0% {
opacity: 0.1;
transform: translate(0, 100%);
}
5% {
opacity: 0.3;
transform: translate(0, 95%);
}
10% {
opacity: 0.6;
transform: translate(0, 90%);
}
15% {
opacity: 1;
transform: translate(0, 85%);
}
75% {
opacity: 1;
transform: translate(0, 25%);
}
80% {
opacity: 0.7;
transform: translate(0, 20%);
}
90% {
opacity: 0.3;
transform: translate(0, 10%);
}
95% {
opacity: 0.2;
transform: translate(0, 5%);
}
100% {
opacity: 0.1;
transform: translate(0, 0);
}
}