Skip to content

Commit 580dd03

Browse files
committed
feat: add leidian ad
1 parent 1337e9c commit 580dd03

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

public/ad_leidian.jpg

-404 KB
Binary file not shown.

public/ad_leidian.webp

45.4 KB
Loading

src/pages/index.tsx

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import { Card } from '@blueprintjs/core'
22

3+
import dayjs from 'dayjs'
34
import { useLinks } from 'hooks/useLinks'
45
import { ComponentType } from 'react'
6+
import ReactGA from 'react-ga-neo'
57

68
import { CardTitle } from 'components/CardTitle'
79
import { withGlobalErrorBoundary } from 'components/GlobalErrorBoundary'
@@ -21,6 +23,7 @@ export const IndexPage: ComponentType = withGlobalErrorBoundary(() => {
2123
const { SOCIAL_LINKS } = useLinks()
2224
return (
2325
<div className="flex flex-col md:flex-row px-4 pb-16 mt-4 md:px-8 md:mt-8 max-w-[96rem] mx-auto">
26+
{isMD && <Ad />}
2427
<div className="md:w-2/3 order-2 md:order-1 mr-0 md:mr-8 mt-4 md:mt-0">
2528
<Operations />
2629
</div>
@@ -59,6 +62,8 @@ export const IndexPage: ComponentType = withGlobalErrorBoundary(() => {
5962
</>
6063
))}
6164
</div>
65+
66+
<Ad />
6267
</div>
6368
</div>
6469
)}
@@ -67,3 +72,26 @@ export const IndexPage: ComponentType = withGlobalErrorBoundary(() => {
6772
</div>
6873
)
6974
})
75+
76+
const Ad = dayjs().isBefore('2025-07-06 00:00:00+8')
77+
? () => {
78+
const t = useTranslation()
79+
const sendEvent = () => {
80+
ReactGA.event('click_ad', { ad_type: 'ld' })
81+
}
82+
return (
83+
// eslint-disable-next-line react/jsx-no-target-blank
84+
<a
85+
className="block relative dark:brightness-[85%]"
86+
href="https://lddl01.ldmnq.com/downloader/ldplayerinst9.exe?n=LDplayer9_ld_406237_3586_ld.exe"
87+
target="_blank"
88+
onClick={sendEvent}
89+
>
90+
<img src="/ad_leidian.webp" alt="雷电模拟器" />
91+
<div className="absolute bottom-2 right-2 border border-current rounded text-[10px] text-zinc-300 px-1 ">
92+
{t.pages.index.advertisement}
93+
</div>
94+
</a>
95+
)
96+
}
97+
: () => null

0 commit comments

Comments
 (0)