Red apple
unknown
plain_text
a year ago
1.8 kB
13
Indexable
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Spinning Red Apple</title>
<style>
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background-color: #f0f0f0;
}
.apple-container {
width: 200px;
height: 200px;
perspective: 1000px;
}
.apple {
width: 100%;
height: 100%;
background-color: red;
border-radius: 50%;
position: relative;
transform-style: preserve-3d;
animation: spin 3s linear infinite;
}
.stem {
width: 10px;
height: 50px;
background-color: brown;
position: absolute;
top: -25px;
left: 50%;
transform: translateX(-50%);
border-radius: 5px;
}
.leaf {
width: 40px;
height: 20px;
background-color: green;
position: absolute;
top: -10px;
left: 50%;
transform: translateX(-50%) rotate(-45deg);
transform-origin: left bottom;
border-radius: 10px 10px 0 0;
}
@keyframes spin {
from {
transform: rotateY(0deg);
}
to {
transform: rotateY(360deg);
}
}
</style>
</head>
<body>
<div class="apple-container">
<div class="apple">
<div class="stem"></div>
<div class="leaf"></div>
</div>
</div>
</body>
</html>Editor is loading...
Leave a Comment