Skip to content

Commit fcee30e

Browse files
author
yunyuyuan
committed
calendar
1 parent 041dfdc commit fcee30e

File tree

11 files changed

+129
-34
lines changed

11 files changed

+129
-34
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@
2727
### Powered by:
2828
* Manjaro Linux
2929
* Vue
30-
* @kangc/v-md-editor
31-
* dayjs
30+
* [vue-markdown-editor](https://github.com/code-farmer-i/vue-markdown-editor)
31+
* [dayjs](https://github.com/iamkun/dayjs)
32+
* [color-calendar](https://github.com/yunyuyuan/color-calendar)
33+
* [viewerjs](https://github.com/fengyuanchen/viewerjs)
3234
* iframe: [github1s](https://github1s.com)
33-
* iframe: [3dimg](https://https://3dimg.com/editor)
3435
* iframe: [vue-netease-music](https://github.com/sl1673495/vue-netease-music)
3536
* And more...
3637

README.zh.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@
2727
### Powered by:
2828
* Manjaro Linux
2929
* Vue
30-
* @kangc/v-md-editor
31-
* dayjs
30+
* [vue-markdown-editor](https://github.com/code-farmer-i/vue-markdown-editor)
31+
* [dayjs](https://github.com/iamkun/dayjs)
32+
* [color-calendar](https://github.com/yunyuyuan/color-calendar)
33+
* [viewerjs](https://github.com/fengyuanchen/viewerjs)
3234
* iframe: [github1s](https://github1s.com)
33-
* iframe: [3dimg](https://https://3dimg.com/editor)
3435
* iframe: [vue-netease-music](https://github.com/sl1673495/vue-netease-music)
3536
* 以及其它的项目...
3637

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010
"@fontsource/noto-sans": "^4.3.0",
1111
"@fontsource/source-code-pro": "^4.3.0",
1212
"@kangc/v-md-editor": "^2.2.4",
13+
"color-calendar": "^1.0.5",
1314
"dayjs": "^1.10.4",
14-
"yunyuyuan-viewerjs": "^1.9.0",
15-
"vue": "^3.0.5"
15+
"vue": "^3.0.5",
16+
"yunyuyuan-viewerjs": "^1.9.0"
1617
},
1718
"devDependencies": {
1819
"@types/node": "^15.0.2",

src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import apps from "./utils/apps";
1313
createApp(App)
1414
.component('svg-icon', IconSvg)
1515
.provide('apps', apps)
16-
.provide('lock', ref(true))
16+
.provide('lock', ref(false))
1717
.provide('power', ref(''))
1818
.use(VMdEditor)
1919
.mount('#app')

src/utils/apps.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export default [{
9191
icon: "about",
9292
order: ref(0),
9393
position: reactive([50, 50]),
94-
size: reactive([500, 500]),
94+
size: reactive([450, 400]),
9595
status: ref(2),
9696
maxed: ref(false),
9797
zindex: ref(1),

src/views/app/about/index.vue

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,12 @@
66
<img src="https://blog.halberd.cn/image/i.png" alt="avatar"/>
77
<a target="_blank" href="https://github.com/yunyuyuan">yunyuyuan</a>
88
</div>
9-
<strong>This project is powered by:</strong>
10-
<ul>
11-
<li>Manjaro Linux</li>
12-
<li>Vue</li>
13-
<li>@kangc/v-md-editor</li>
14-
<li>dayjs</li>
15-
<li>iframe: <a target="_blank" href="https://github1s.com">github1s</a></li>
16-
<li>iframe: <a target="_blank" href="https://3dimg.com/editor/">3dimg</a></li>
17-
<li>iframe: <a target="_blank" href="https://github.com/sl1673495/vue-netease-music">vue-netease-music</a></li>
18-
<li>And more...</li>
19-
</ul>
20-
<a target="_blank" href="https://github.com/yunyuyuan/vue3-manjaro-ui">click to github repo</a>
9+
<div>
10+
<b>Contributors:</b>
11+
<span>Need your code!</span>
12+
</div>
13+
<hr/>
14+
<strong>Go to <a target="_blank" href="https://github.com/yunyuyuan/vue3-manjaro-ui#readme">github</a> to get more information!</strong>
2115
<a href="mailto:yun-yu-yuan@qq.com">Email to me</a>
2216
</div>
2317
</template>
@@ -43,7 +37,6 @@ export default {
4337
align-items: center;
4438
margin: 1rem;
4539
padding-bottom: 1rem;
46-
border-bottom: 1px solid gray;
4740
b{
4841
margin-right: 2rem;
4942
}
@@ -56,8 +49,9 @@ export default {
5649
}
5750
}
5851
>strong{
59-
font-size: 1.1rem;
52+
font-size: 1rem;
6053
margin: .8rem;
54+
display: block;
6155
}
6256
>ul{
6357
margin-left: 3rem;
@@ -70,6 +64,7 @@ export default {
7064
}
7165
>a{
7266
margin: 1rem;
67+
color: #ff7533;
7368
}
7469
}
7570
</style>

src/views/app/image viewer/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<script lang="ts">
1111
import {defineComponent, watchEffect} from 'vue';
1212
import 'yunyuyuan-viewerjs/dist/viewer.css';
13-
import Viewer from 'yunyuyuan-viewerjs';
13+
import Viewer from 'yunyuyuan-viewerjs/dist/viewer';
1414
import dolphinFiles from "../../../../get-dolphin-filesystem";
1515
import {typeFile} from "../../../../filesystem";
1616

src/views/taskbar/calendar.vue

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<template>
2+
<div :class="{active: show}" class="calendar" tabindex="1" @focusout="$emit('focusout')">
3+
<div id="calendar"></div>
4+
</div>
5+
</template>
6+
7+
<script lang="ts">
8+
import {defineComponent} from 'vue';
9+
import Calendar from "color-calendar";
10+
import "color-calendar/dist/css/theme-glass.css";
11+
12+
export default defineComponent({
13+
name: "calendar",
14+
props: {
15+
show: Boolean
16+
},
17+
emits: ['focusout'],
18+
watch: {
19+
show (){
20+
if (this.show) {
21+
this.$el.focus();
22+
}
23+
}
24+
},
25+
mounted() {
26+
new Calendar({
27+
id: "#calendar",
28+
theme: "glass"
29+
});
30+
}
31+
})
32+
</script>
33+
34+
<style scoped lang="scss">
35+
.calendar{
36+
width: 20rem;
37+
position: absolute;
38+
right: 0;
39+
top: 0;
40+
transform: translateY(4rem);
41+
transition: transform .12s ease-in;
42+
outline: none;
43+
z-index: 0;
44+
&.active{
45+
transform: translateY(-100%);
46+
}
47+
}
48+
</style>

src/views/taskbar/index.vue

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,15 @@
3030
<i @click="showDesktop">
3131
<svg-icon name="desktop" style="width: 2.2rem;height: 2.2rem"/>
3232
</i>
33-
<div class="time flex">
33+
<div class="time flex" @click="toggleCalendar">
3434
<time>{{time}}</time>
3535
<span>{{date}}</span>
3636
</div>
3737
</div>
3838

39-
<left-menu :show="showLeft" @focusout="leftFocusout"/>
39+
<left-menu ref="leftmenu" :show="showLeft" @focusout="leftFocusout"/>
4040
<right-menu :show="showRight" @focusout="rightFocusout"/>
41+
<the-calendar ref="calendar" :show="showCalendar" @focusout="calendarFocusout"/>
4142
<span class="bg"></span>
4243
</section>
4344
</template>
@@ -47,17 +48,19 @@ import {defineComponent} from 'vue';
4748
import AppIcon from "./appIcon.vue";
4849
import leftMenu from "./leftMenu.vue";
4950
import rightMenu from "./rightMenu.vue";
51+
import TheCalendar from "./calendar.vue";
5052
import dayjs, {Dayjs} from "dayjs";
5153
import {typeApp} from "../../utils/apps";
5254
import mixin from "../../utils/mixin";
5355
5456
export default defineComponent({
5557
name: "index",
56-
components: {AppIcon, leftMenu, rightMenu},
58+
components: {AppIcon, leftMenu, rightMenu, TheCalendar},
5759
data (){
5860
return {
5961
showLeft: false,
6062
showRight: '',
63+
showCalendar: false,
6164
oldShowRight: '',
6265
animation: false,
6366
@@ -89,7 +92,9 @@ export default defineComponent({
8992
},
9093
methods: {
9194
toggleLeftMenu (){
92-
if (this.animation) return
95+
const actived = this.$refs.leftmenu.$el.classList.contains('active');
96+
if (this.animation && actived) return;
97+
this.animation = false;
9398
!this.showLeft && (this.showLeft = !this.showLeft);
9499
},
95100
leftFocusout (){
@@ -117,6 +122,17 @@ export default defineComponent({
117122
this.showDesktopLis.push(app.name)
118123
}
119124
})
125+
},
126+
toggleCalendar (){
127+
const actived = this.$refs.calendar.$el.classList.contains('active');
128+
if (this.animation && actived) return;
129+
this.showCalendar = !actived;
130+
this.animation = false;
131+
},
132+
calendarFocusout (){
133+
this.showCalendar = false;
134+
this.animation = true;
135+
setTimeout(()=>this.animation=false, 200)
120136
}
121137
}
122138
})

src/views/taskbar/rightMenu.vue

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="right-menu" tabindex="1" :class="{active: show !== ''}" @focusout="focusout">
2+
<div class="right-menu" tabindex="1" :class="{active: show !== ''}" @focusout="$emit('focusout')">
33
<div class="head flex">
44
<i class="flex"><svg-icon name="arrow"/></i>
55
<span>{{title}}</span>
@@ -135,9 +135,6 @@ export default defineComponent({
135135
}
136136
},
137137
methods: {
138-
focusout (e: FocusEvent){
139-
this.$emit('focusout')
140-
},
141138
startVolume (){
142139
},
143140
changeVolume (){

0 commit comments

Comments
 (0)