114 lines
3.2 KiB
HTML
114 lines
3.2 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>工作室吉祥物</title>
|
|
<style>
|
|
body {
|
|
margin: 0;
|
|
padding: 0;
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
height: 100vh;
|
|
background-color: #f8f9fa;
|
|
}
|
|
|
|
.gear-container {
|
|
position: relative;
|
|
width: 500px;
|
|
height: 500px;
|
|
}
|
|
|
|
.gear {
|
|
position: absolute;
|
|
top: 50%;
|
|
left: 50%;
|
|
transform: translate(-50%, -50%);
|
|
width: 230px;
|
|
height: 230px;
|
|
background: transparent;
|
|
border-radius: 50%;
|
|
border: 16px solid #1E3A8A;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
animation: spin 4s linear infinite;
|
|
}
|
|
|
|
.gear-inner {
|
|
width: 150px;
|
|
height: 150px;
|
|
background: #ffffff;
|
|
border-radius: 50%;
|
|
border: 12px solid #3B82F6;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
|
|
.gear-tooth {
|
|
position: absolute;
|
|
width: 40px;
|
|
height: 24px;
|
|
background: #1E3A8A;
|
|
border-radius: 6px;
|
|
}
|
|
|
|
.gear-tooth:nth-child(1) { transform: rotate(0deg) translateY(-200px); }
|
|
.gear-tooth:nth-child(2) { transform: rotate(45deg) translateY(-200px); }
|
|
.gear-tooth:nth-child(3) { transform: rotate(90deg) translateY(-200px); }
|
|
.gear-tooth:nth-child(4) { transform: rotate(135deg) translateY(-200px); }
|
|
.gear-tooth:nth-child(5) { transform: rotate(180deg) translateY(-200px); }
|
|
.gear-tooth:nth-child(6) { transform: rotate(225deg) translateY(-200px); }
|
|
.gear-tooth:nth-child(7) { transform: rotate(270deg) translateY(-200px); }
|
|
.gear-tooth:nth-child(8) { transform: rotate(315deg) translateY(-200px); }
|
|
.gear-tooth:nth-child(9) { transform: rotate(360deg) translateY(-200px); }
|
|
.gear-tooth:nth-child(10) {
|
|
animation: spin2 4s linear infinite;
|
|
width: 70px;
|
|
transition: all 0.3s ease-out;
|
|
}
|
|
|
|
@keyframes spin {
|
|
from { transform: translate(-50%, -50%) rotate(0deg); }
|
|
to { transform: translate(-50%, -50%) rotate(360deg); }
|
|
}
|
|
|
|
@keyframes spin2 {
|
|
from { transform: rotate(360deg); }
|
|
to { transform: rotate(0deg); }
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="gear-container">
|
|
<div class="gear">
|
|
<div class="gear-inner"></div>
|
|
<div class="gear-tooth"></div>
|
|
<div class="gear-tooth"></div>
|
|
<div class="gear-tooth"></div>
|
|
<div class="gear-tooth"></div>
|
|
<div class="gear-tooth"></div>
|
|
<div class="gear-tooth"></div>
|
|
<div class="gear-tooth"></div>
|
|
<div class="gear-tooth"></div>
|
|
<div class="gear-tooth" id="eye"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
const eye = document.getElementById('eye');
|
|
// 70 24
|
|
function AnimateEye(width, height) {
|
|
eye.style.width = width + 'px';
|
|
eye.style.height = height + 'px';
|
|
}
|
|
eye.addEventListener('click', (event) => {
|
|
AnimateEye(50, 30);
|
|
setTimeout(() => AnimateEye(70, 24), 2000);
|
|
});
|
|
</script>
|
|
</body>
|
|
</html> |