4.HTML + CSS3—— KoBe_轮廓转动小球

KoBe_轮廓转动小球
4.HTML + CSS3—— KoBe_轮廓转动小球_第1张图片


HTML部分:


<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Documenttitle>
    <link href="https://fonts.font.im/css?family=Do+Hyeon" rel="stylesheet">

    <link rel="stylesheet" href="css/5-25.css">
head>

<body>
    <div class="ring">
        KoBe
        <span>span>
    div>
body>

html>

css部分:

* {
    padding: 0;
    margin: 0;
}

body {
    position: relative;
    background-color: #262626;
}

.ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(50%, 50%);
    width: 150px;
    height: 150px;
    background: #2c1d52;
    border: 3px solid transparent;
    border-radius: 50%;
    text-align: center;
    line-height: 150px;
    font-size: 20px;
    font-family: 'Do Hyeon', sans-serif;
    color: #fff000;
    letter-spacing: 4px;
    text-transform: uppercase;
    text-shadow: 0 0 10px #fff000;
    box-shadow: 0 0 40px rgba(0, 0, 0, .4);
}

.ring::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
}

span {
    display: block;
    position: absolute;
    top: calc(50% - 2px);
    left: 50%;
    width: 50%;
    height: 4px;
    background: transparent;
    transform-origin: left;
    animation: kobeLight 2s linear infinite;
}

span:before {
    content: '';
    position: absolute;
    top: -6px;
    right: -8px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff000;
    box-shadow: 10px 30px 50px #fff000;
}

@keyframes kobeLight {
    0% {
        transform: rotate(45deg);
    }
    100% {
        transform: rotate(405deg);
    }
}

看了好久才看懂,挺有趣

你可能感兴趣的:(前端案例合集)