-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
201 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
<template> | ||
<div class="task-item"> | ||
<div | ||
class="task-status" | ||
:class="getStatusClass" | ||
> | ||
<!-- 根据状态显示不同的图标 --> | ||
<div v-if="status === '已发布'" class="check-circle"></div> | ||
<div v-else class="circle-container" :style="{ animationDuration: '5s' }"> | ||
<div v-for="n in 8" :key="n" :style="{ backgroundColor: statusColor }"></div> | ||
</div> | ||
</div> | ||
<div class="task-description" v-html="compiledMarkdown"></div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import { marked } from 'marked'; | ||
export default { | ||
name: 'Task', | ||
props: { | ||
status: { | ||
type: String, | ||
default: '待确定', | ||
validator: (value) => ['待确定', '开发中', '已发布'].includes(value) | ||
}, | ||
content: { | ||
type: String, | ||
required: true | ||
} | ||
}, | ||
computed: { | ||
getStatusClass() { | ||
return `status-${this.status}`; | ||
}, | ||
statusColor() { | ||
switch (this.status) { | ||
case '待确定': | ||
return 'grey'; | ||
case '开发中': | ||
return 'yellow'; | ||
case '已发布': | ||
return 'green'; | ||
default: | ||
return 'grey'; | ||
} | ||
}, | ||
compiledMarkdown() { | ||
return marked(this.content); | ||
} | ||
} | ||
}; | ||
</script> | ||
|
||
<style scoped> | ||
.task-item { | ||
display: flex; | ||
align-items: center; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
.task-status { | ||
margin-right: 8px; | ||
} | ||
/* 圆圈 + 勾的样式 */ | ||
.check-circle { | ||
position: relative; | ||
width: 20px; | ||
height: 20px; | ||
border: 1.5px solid #20CC20; | ||
border-radius: 50%; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
.check-circle::after { | ||
content: ''; | ||
width: 5px; | ||
height: 10px; | ||
border-right: 1.5px solid #20CC20; | ||
border-bottom: 1.5px solid #20CC20; | ||
transform: rotate(45deg); | ||
position: absolute; | ||
margin: 0 0 1.5px 0.8px; | ||
} | ||
/* 动态旋转的小圆点动画 */ | ||
.circle-container { | ||
position: relative; | ||
width: 15px; | ||
height: 15px; | ||
margin: 0 auto; | ||
border-radius: 50%; | ||
animation: rotate 5s linear infinite; | ||
} | ||
.circle-container div { | ||
position: absolute; | ||
width: 3px; | ||
height: 3px; | ||
border-radius: 50%; | ||
} | ||
@keyframes rotate { | ||
from { | ||
transform: rotate(0deg); | ||
} | ||
to { | ||
transform: rotate(1440deg); /* 4圈 */ | ||
} | ||
} | ||
/* 定位点的位置 */ | ||
.circle-container div:nth-child(1) { top: 50%; left: 100%; transform: translate(-50%, -50%); } | ||
.circle-container div:nth-child(2) { top: 15%; left: 85%; transform: translate(-50%, -50%); } | ||
.circle-container div:nth-child(3) { top: 0%; left: 50%; transform: translate(-50%, -50%); } | ||
.circle-container div:nth-child(4) { top: 15%; left: 15%; transform: translate(-50%, -50%); } | ||
.circle-container div:nth-child(5) { top: 50%; left: 0%; transform: translate(-50%, -50%); } | ||
.circle-container div:nth-child(6) { top: 85%; left: 15%; transform: translate(-50%, -50%); } | ||
.circle-container div:nth-child(7) { top: 100%; left: 50%; transform: translate(-50%, -50%); } | ||
.circle-container div:nth-child(8) { top: 85%; left: 85%; transform: translate(-50%, -50%); } | ||
.vp-doc p, .vp-doc summary { | ||
margin: 16px 0; | ||
} | ||
.task-description { | ||
flex: 1; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Rotating Dots Circle</title> | ||
<style> | ||
.circle-container { | ||
position: relative; | ||
width: 200px; | ||
height: 200px; | ||
margin: 50px auto; | ||
border-radius: 50%; | ||
animation: rotate 5s linear infinite; | ||
} | ||
|
||
.circle-container div { | ||
position: absolute; | ||
width: 10px; | ||
height: 10px; | ||
background-color: yellow; | ||
border-radius: 50%; | ||
} | ||
|
||
@keyframes rotate { | ||
from { | ||
transform: rotate(0deg); | ||
} | ||
to { | ||
transform: rotate(360deg); | ||
} | ||
} | ||
|
||
/* Positioning the dots around the circle */ | ||
.circle-container div:nth-child(1) { top: 0; left: 50%; transform: translateX(-50%); } | ||
.circle-container div:nth-child(2) { top: 15%; left: 85%; transform: translate(-50%, -50%); } | ||
.circle-container div:nth-child(3) { top: 50%; left: 100%; transform: translate(-50%, -50%); } | ||
.circle-container div:nth-child(4) { top: 85%; left: 85%; transform: translate(-50%, -50%); } | ||
.circle-container div:nth-child(5) { top: 100%; left: 50%; transform: translate(-50%, -50%); } | ||
.circle-container div:nth-child(6) { top: 85%; left: 15%; transform: translate(-50%, -50%); } | ||
.circle-container div:nth-child(7) { top: 50%; left: 0; transform: translate(-50%, -50%); } | ||
.circle-container div:nth-child(8) { top: 15%; left: 15%; transform: translate(-50%, -50%); } | ||
</style> | ||
</head> | ||
<body> | ||
<div class="circle-container"> | ||
<div></div> | ||
<div></div> | ||
<div></div> | ||
<div></div> | ||
<div></div> | ||
<div></div> | ||
<div></div> | ||
<div></div> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters