我有这样的css&;html代码:
.item-video-kami {
width: 480px;
overflow: hidden;
position: relative;
}
.item-video-kami>.play-icon.full-height>svg {
width: 106px;
color: #ffffff50;
}
.item-video-kami img {
transition: all .5s ease;
}
.item-video-kami>.play-icon {
height: 100%;
position: absolute;
display: flex;
width: 100%;
justify-content: center;
align-items: center;
background-color: #1e1e1e94;
opacity: 0;
/* Initial opacity set to 0 */
transition: opacity 0.2s ease-in 0.1s;
}
.item-video-kami:hover img {
transform: scale(1.1);
}
.item-video-kami:hover .play-icon {
opacity: 0.8;
/* Adjusted opacity value to 0.8 for 80% */
}
<a href="#" class="item-video-kami">
<div class="play-icon full-height">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="w-6 h-6">
<path fill-rule="evenodd"
d="M4.5 5.653c0-1.427 1.529-2.33 2.779-1.643l11.54 6.347c1.295.712 1.295 2.573 0 3.286L7.28 19.99c-1.25.687-2.779-.217-2.779-1.643V5.653Z"
clip-rule="evenodd" />
</svg>
</div>
<img src="https://picsum.photos/200/300" alt="">
</a>
<a href="#" class="item-video-kami">
<div class="play-icon full-height">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="w-6 h-6">
<path fill-rule="evenodd"
d="M4.5 5.653c0-1.427 1.529-2.33 2.779-1.643l11.54 6.347c1.295.712 1.295 2.573 0 3.286L7.28 19.99c-1.25.687-2.779-.217-2.779-1.643V5.653Z"
clip-rule="evenodd" />
</svg>
</div>
<img src="https://picsum.photos/200/300" alt="">
</a>
预期的结果是,当光标悬停在.Item-Video-kami上方时,图像将zoom (放大),同时,div.play-图标将不透明度更改为0.8
但在上面的片断中,动画只用于放大图像,而第二个动画不是触发器(如果不清楚,请判断片断)