Skip to content

Commit 9b4038b

Browse files
committed
docs: stay tuned
1 parent f71de46 commit 9b4038b

File tree

6 files changed

+219
-56
lines changed

6 files changed

+219
-56
lines changed

docs/archive/index.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
layout: home
3+
title: Archive
4+
titleTemplate: ':title - NewStar CTF'
5+
6+
hero:
7+
# name:
8+
# text:
9+
tagline:
10+
11+
features:
12+
- title: NewStar CTF 2024 × 春秋杯
13+
details: '2024.9.27 - 2024.11.3'
14+
link: /archive/nsctf24/
15+
---

docs/archive/nsctf24/index.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
# https://vitepress.dev/reference/default-theme-home-page
3+
layout: index
4+
5+
title: NewStar CTF 2024
6+
titleTemplate: ':title'
7+
8+
information: |
9+
<span style='font-size: 1.2em; font-weight: 600;'>NewStar CTF 2024</span>
10+
2024.9.30 - 2024.11.3
11+
12+
13+
actions:
14+
-
15+
- usevue: true
16+
# - text: 报名参赛
17+
# type: primary
18+
# size: large
19+
# click: signup
20+
21+
-
22+
- text: 快速入门
23+
link: /learn/
24+
type: secondary
25+
26+
- text: 赛事信息
27+
link: /guide/2024/
28+
type: secondary
29+
30+
---

docs/archive/nsctf24/index.ts

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
import { ElMessage } from 'element-plus';
2+
3+
export function signup() {
4+
let nowdate = new Date();
5+
let signdate = [new Date('2024-09-13 10:00:00'), new Date('2024-11-03 21:00:00')];
6+
if (nowdate.getTime() < signdate[0].getTime()) {
7+
ElMessage({
8+
message: '公开赛道报名通道于 9.13 10:00 开放',
9+
type: 'warning',
10+
})
11+
} else if (nowdate.getTime() > signdate[1].getTime()) {
12+
ElMessage({
13+
message: '报名已结束!',
14+
type: 'warning',
15+
})
16+
} else {
17+
let year = signdate[0].getFullYear();
18+
let matchname = 'newstar';
19+
let origin = 'endbm.ichunqiu.com';
20+
let protocol = 'https:';
21+
let path = '/' + year + matchname;
22+
window.open(`${protocol}//${origin}` + path);
23+
}
24+
}
25+
26+
export function participate(channel: 'internal' | 'external') {
27+
let time = {
28+
'internal': [new Date('2024-09-23 09:00:00').getTime(), new Date('2024-10-27 21:00:00').getTime()],
29+
'external': [new Date('2024-09-30 09:00:00').getTime(), new Date('2024-11-03 21:00:00').getTime()],
30+
}
31+
let now = Date.now();
32+
let gap = time[channel];
33+
if (!gap) return
34+
if (now < gap[0]) {
35+
ElMessage({
36+
message: '比赛尚未开始!',
37+
type: 'warning',
38+
})
39+
} else if (now > gap[1]) {
40+
ElMessage({
41+
message: '比赛已结束!',
42+
type: 'warning',
43+
})
44+
} else {
45+
let year = new Date(gap[0]).getFullYear();
46+
let matchname = 'newstar';
47+
let origin = 'match.ichunqiu.com';
48+
let protocol = 'https:';
49+
let tail = {
50+
'internal': 'xn',
51+
'external': 'gk',
52+
}[channel];
53+
let path = '/' + year + matchname + tail;
54+
window.open(`${protocol}//${origin}` + path);
55+
}
56+
}

docs/archive/nsctf24/index.vue

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
<script lang="ts" setup>
2+
import { ElButton, ElButtonGroup } from "element-plus";
3+
import { ElPopover } from "element-plus";
4+
import IndexButton from "@/components/IndexButton.vue";
5+
import { signup, participate } from "./index";
6+
</script>
7+
8+
<template>
9+
<div>
10+
<ElPopover placement="bottom" :width="270" trigger="click">
11+
<template #reference>
12+
<IndexButton text="报名参赛" type="primary" size="large" />
13+
</template>
14+
<div style="text-align: center">
15+
<ElButtonGroup class="group">
16+
<ElButton class="action-btn" style="width: 100%" @click="signup()">立即报名</ElButton>
17+
</ElButtonGroup>
18+
<ElButtonGroup class="group">
19+
<div class="group-label"><label>参赛</label></div>
20+
<ElButton class="action-btn" @click="participate('external')">公开赛道</ElButton>
21+
<ElButton class="action-btn" @click="participate('internal')">校内赛道</ElButton>
22+
</ElButtonGroup>
23+
</div>
24+
</ElPopover>
25+
</div>
26+
</template>
27+
28+
<style lang="scss" scoped>
29+
.top-radius {
30+
border-radius: var(--el-border-radius-base) var(--el-border-radius-base) 0 0 !important;
31+
}
32+
.bottom-radius {
33+
border-radius: 0 0 var(--el-border-radius-base) var(--el-border-radius-base) !important;
34+
}
35+
36+
.group {
37+
display: flex;
38+
width: 100%;
39+
& + .group > * {
40+
&:first-child {
41+
border-top-left-radius: 0;
42+
}
43+
&:last-child {
44+
border-top-right-radius: 0;
45+
}
46+
}
47+
&:not(:last-child) > * {
48+
&:first-child {
49+
border-bottom-left-radius: 0;
50+
}
51+
&:last-child {
52+
border-bottom-right-radius: 0;
53+
}
54+
}
55+
56+
& + .group {
57+
margin-top: -1px;
58+
}
59+
}
60+
61+
.group-label {
62+
--label-bg-color: var(--el-color-info-light-9);
63+
.dark & {
64+
--label-bg-color: var(--el-color-info-light-8);
65+
}
66+
width: 100%;
67+
padding: 8px 15px;
68+
background-color: var(--label-bg-color);
69+
color: var(--el-color-info);
70+
border: var(--el-border);
71+
border-color: var(--el-border-color);
72+
border-radius: 0 0 0 var(--el-border-radius-base);
73+
border-right: none;
74+
align-items: center;
75+
box-sizing: border-box;
76+
display: inline-flex;
77+
font-weight: var(--el-button-font-weight);
78+
height: 32px;
79+
justify-content: center;
80+
line-height: 1;
81+
outline: none;
82+
text-align: center;
83+
transition: 0.1s;
84+
-webkit-user-select: none;
85+
-moz-user-select: none;
86+
user-select: none;
87+
vertical-align: middle;
88+
white-space: nowrap;
89+
}
90+
91+
.action-btn {
92+
position: relative;
93+
z-index: 10;
94+
&:hover {
95+
z-index: 11;
96+
}
97+
&:active {
98+
z-index: 12;
99+
}
100+
}
101+
102+
.no-top-border {
103+
border-top: none;
104+
}
105+
106+
.no-bottom-border {
107+
border-bottom: none;
108+
}
109+
</style>

docs/index.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
# https://vitepress.dev/reference/default-theme-home-page
33
layout: index
44

5-
title: NewStar CTF 2024
5+
title: NewStar CTF
66
titleTemplate: ':title'
77

88
information: |
9-
<span style='font-size: 1.2em; font-weight: 600;'>NewStar CTF 2024</span>
10-
2024.9.30 - 2024.11.3
9+
<span style='font-size: 1.2em; font-weight: 600;'>NewStar CTF 2025</span>
10+
敬请期待
1111
1212
1313
actions:
14-
-
15-
- usevue: true
14+
# -
15+
# - usevue: true
1616
# - text: 报名参赛
1717
# type: primary
1818
# size: large
@@ -23,8 +23,8 @@ actions:
2323
link: /learn/
2424
type: secondary
2525

26-
- text: 赛事信息
27-
link: /guide/2024/
26+
- text: 往届题解
27+
link: /wp/
2828
type: secondary
2929

3030
---

docs/index.ts

Lines changed: 2 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,9 @@
11
import { ElMessage } from 'element-plus';
22

33
export function signup() {
4-
let nowdate = new Date();
5-
let signdate = [new Date('2024-09-13 10:00:00'), new Date('2024-11-03 21:00:00')];
6-
if (nowdate.getTime() < signdate[0].getTime()) {
7-
ElMessage({
8-
message: '公开赛道报名通道于 9.13 10:00 开放',
9-
type: 'warning',
10-
})
11-
} else if (nowdate.getTime() > signdate[1].getTime()) {
12-
ElMessage({
13-
message: '报名已结束!',
14-
type: 'warning',
15-
})
16-
} else {
17-
let year = signdate[0].getFullYear();
18-
let matchname = 'newstar';
19-
let origin = 'endbm.ichunqiu.com';
20-
let protocol = 'https:';
21-
let path = '/' + year + matchname;
22-
window.open(`${protocol}//${origin}` + path);
23-
}
4+
return
245
}
256

267
export function participate(channel: 'internal' | 'external') {
27-
let time = {
28-
'internal': [new Date('2024-09-23 09:00:00').getTime(), new Date('2024-10-27 21:00:00').getTime()],
29-
'external': [new Date('2024-09-30 09:00:00').getTime(), new Date('2024-11-03 21:00:00').getTime()],
30-
}
31-
let now = Date.now();
32-
let gap = time[channel];
33-
if (!gap) return
34-
if (now < gap[0]) {
35-
ElMessage({
36-
message: '比赛尚未开始!',
37-
type: 'warning',
38-
})
39-
} else if (now > gap[1]) {
40-
ElMessage({
41-
message: '比赛已结束!',
42-
type: 'warning',
43-
})
44-
} else {
45-
let year = new Date(gap[0]).getFullYear();
46-
let matchname = 'newstar';
47-
let origin = 'match.ichunqiu.com';
48-
let protocol = 'https:';
49-
let tail = {
50-
'internal': 'xn',
51-
'external': 'gk',
52-
}[channel];
53-
let path = '/' + year + matchname + tail;
54-
window.open(`${protocol}//${origin}` + path);
55-
}
8+
return
569
}

0 commit comments

Comments
 (0)