Ich weiß nicht, warum das script nicht wie gewünscht funktioniert und der Text im Kreis um das Bild läuft. Kann jemand helfen
HTML
HTML
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<title>Document</title>
</head>
<body>
<div class="circle">
<div class="logo"></div>
<div class="text">
<p>LUPUS-Media - Erich Wolf - Creative Web-Design</p>
</div>
</div>
<script>
const text = document.querySelector('.text p');
text.innerHTML = text.innerText.split("").map(
(char, i) =>
<span style="transform:rotate(${i * 8.2}deg)">${char}</span>
).join("");
</script>
</body>
</html>
Alles anzeigen
Code
CSS
*
{
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: consolas;
}
body{
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
}
.circle
{
position: relative;
width: 200px;
height: 200px;
border-radius: 50%;
/*background-color: #ccc;*/
display: flex;
justify-content: center;
align-items: center;
}
.logo
{
position: absolute;
width: 150px;
height: 150px;
border-radius: 50%;
background: url(img.jpg);
background-size: cover;
filter: brightness(1.5) contrast(1);
}
.text
{
position: absolute;
width: 100%;
height: 100%;
animation: rotateText 10s linear infinite;
}
@keyframes rotateText
{
0%{
transform: rotate(360deg);
}
100%{
transform: rotate(0deg);
}
}
.text span
{
position: absolute;
left: 50%;
font-size: 1.2em;
transform-origin: 0 100px;
}
Alles anzeigen