点击查看html编辑器说明文档

第二十六天edit icon

|
|
Fork(复制)
|
|
作者:
lynn-ssk
提交反馈
嵌入
设置
下载
HTML
格式化
支持Emmet,输入 p 后按 Tab键试试吧!
<head> ...
展开
</head>
<body>
            
            <!DOCTYPE html>
<html lang="pt-br">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="style.css">
    <title>Dia 26</title>
</head>
<body>
    <div class="line">
        <div class="hexagon"></div>
    </div>
    
</body>
</html>
        
</body>
CSS
格式化
            
            body
{
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background-color: #212121;
}
.line
{
    width: 300px;
    border-bottom: 4px solid white;
    position: relative;
    animation: animateline 2s linear infinite;
}

.hexagon
{
    position: absolute;
    left: 0;
    bottom: 14px;
    width: 50px;
    height: 30px;
    background-color: white;
    animation: animatehexagon 2s linear infinite;
}

.hexagon:before 
{
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    transform: rotate(60deg);

}
.hexagon:after
{
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    transform: rotate(-60deg);
    
}

@keyframes animatehexagon 
{
    0% {left: 0;}
    50% {left: calc(100% - 50px);
    transform: rotate(720deg);}
    100% {left: 0;}
}

@keyframes animateline 
{
    0% {transform: rotate(30deg);}
    25% {transform: rotate(0deg);}
    50% {transform: rotate(-30deg);}
    75% {transform: rotate(0deg);}
    100% {transform: rotate(30deg);}
}
        
JS
格式化
            
            
        
预览
控制台