|
|

楼主 |
发表于 2023-3-23 20:14
|
显示全部楼层
本帖最后由 马黑黑 于 2023-3-23 20:16 编辑
代码
- <style>
- #mydiv {
- width: 80px;
- height: 160px;
- background: black;
- border-radius: 8px;
- box-shadow: 6px 4px 12px black;
- position: relative;
- pointer-events: none;
- --state: running;
- }
- #mydiv::before, #mydiv::after {
- position: absolute;
- content: '';
- }
- #mydiv::before {
- width: 30px;
- height: 30px;
- left: calc(50% - 15px);
- bottom: 15px;
- border-radius: 50%;
- background: darkgreen;
- pointer-events: auto;
- cursor: pointer;
- border: 2px solid snow;
- box-shadow: 0 0 10px white;
- animation: flash .2s infinite alternate var(--state);
- }
- #mydiv::after {
- content:attr(data-tt);
- top: 6px; right: 6px; bottom: 60px; left: 6px;
- background: #333;
- color: green;
- text-align: center;
- padding: 4px;
- white-space:pre;
- }
- @keyframes flash {
- to { box-shadow: 0 0 30px white; }
- }
- </style>
- <div id="mydiv" data-tt="小遥控器"></div>
复制代码
|
|