Skip to content

Commit 73a4c10

Browse files
committed
chore: add leidian ad
1 parent 20b5eac commit 73a4c10

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

public/ad_leidian.jpg

404 KB
Loading

src/pages/index.tsx

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Card } from '@blueprintjs/core'
22

3+
import dayjs from 'dayjs'
34
import { ComponentType } from 'react'
45

56
import { CardTitle } from 'components/CardTitle'
@@ -18,12 +19,13 @@ export const IndexPage: ComponentType = withGlobalErrorBoundary(() => {
1819
const { isMD } = useCurrentSize()
1920
return (
2021
<div className="flex flex-col md:flex-row px-4 mt-4 md:px-8 md:mt-8 max-w-[96rem] mx-auto">
22+
{isMD && <Ad />}
2123
<div className="md:w-2/3 order-2 md:order-1 mr-0 md:mr-8 mt-4 md:mt-0">
2224
<Operations />
2325
</div>
2426
{!isMD && (
2527
<div className="md:w-1/3 order-1 md:order-2">
26-
<div className="sticky top-20">
28+
<div className="top-20">
2729
<Card className="flex flex-col mb-4 space-y-2">
2830
<CardTitle icon="add" className="mb-4">
2931
创建新作业
@@ -55,6 +57,8 @@ export const IndexPage: ComponentType = withGlobalErrorBoundary(() => {
5557
</>
5658
))}
5759
</div>
60+
61+
<Ad />
5862
</div>
5963
</div>
6064
)}
@@ -63,3 +67,19 @@ export const IndexPage: ComponentType = withGlobalErrorBoundary(() => {
6367
</div>
6468
)
6569
})
70+
71+
const Ad = dayjs().isBefore('2025-05-11 00:00:00+8')
72+
? () => (
73+
// eslint-disable-next-line react/jsx-no-target-blank
74+
<a
75+
className="block relative dark:brightness-[85%]"
76+
href="https://www.ldmnq.com/ldy/ldymuban/#/landing/9651"
77+
target="_blank"
78+
>
79+
<img src="/ad_leidian.jpg" alt="雷电模拟器" />
80+
<div className="absolute bottom-2 right-2 border border-current rounded text-[10px] text-zinc-300 px-1 ">
81+
广告
82+
</div>
83+
</a>
84+
)
85+
: () => null

0 commit comments

Comments
 (0)