Rotate text

by rga4

HTML

<!DOCTYPE html>
<html lang="ru">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Вращающийся Текст</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <div class="container">
        <div class="rotating-text">
            Этот текст вращается!
        </div>
    </div>
</body>
</html>

CSS

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f0f0f0;
    margin: 0;
}

.container {
    perspective: 500px; /* Создаем перспективу для 3D-эффекта */
}

.rotating-text {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    padding: 20px;
    background-color: #eee;
    border: 1px solid #ccc;
    border-radius: 5px;
    transform-origin: center center; /* Устанавливаем центр вращения */
    animation: rotate 5s linear infinite; /* Запускаем анимацию */
}

@keyframes rotate {
    from {
        transform: rotateY(0deg);
    }
    to {
        transform: rotateY(360deg);
    }
}