mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: compare in-table ads
This commit is contained in:
1 parent
40f3311ff7
commit
30cb319c1e
8 files changed
+49
-8
No files matched your search
@@ -58,6 +58,7 @@ export function Ad({ id, commonHeight, ...props }: AdProps) {
|
|||||||
<Box
|
<Box
|
||||||
id={id}
|
id={id}
|
||||||
width="100%"
|
width="100%"
|
||||||
|
className="ad-container"
|
||||||
height={commonHeight ? `${commonHeight}px` : 'auto'}
|
height={commonHeight ? `${commonHeight}px` : 'auto'}
|
||||||
{...props}
|
{...props}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
import { Flex, Table } from '@radix-ui/themes';
|
||||||
|
import { Ad } from './Ad';
|
||||||
|
|
||||||
|
interface AdStickyTableRowProps {
|
||||||
|
id: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function AdStickyTableRow({ id }: AdStickyTableRowProps) {
|
||||||
|
return (
|
||||||
|
<Table.Body style={{ height: 250 }}>
|
||||||
|
<Table.Row align="center">
|
||||||
|
<Flex
|
||||||
|
justify="center"
|
||||||
|
align="center"
|
||||||
|
position="absolute"
|
||||||
|
width="100%"
|
||||||
|
left="0"
|
||||||
|
>
|
||||||
|
<Ad commonHeight={250} id={id} />
|
||||||
|
</Flex>
|
||||||
|
</Table.Row>
|
||||||
|
</Table.Body>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@ import { asset } from '@blitzkit/core';
|
|||||||
import { Flex, Heading, IconButton, Table } from '@radix-ui/themes';
|
import { Flex, Heading, IconButton, Table } from '@radix-ui/themes';
|
||||||
import type { TankCharacteristics } from '../../core/blitzkit/tankCharacteristics';
|
import type { TankCharacteristics } from '../../core/blitzkit/tankCharacteristics';
|
||||||
import { CompareEphemeral } from '../../stores/compareEphemeral';
|
import { CompareEphemeral } from '../../stores/compareEphemeral';
|
||||||
|
import { AdStickyTableRow } from '../AdStickyTableRow';
|
||||||
import { StickyColumnHeaderCell } from '../StickyColumnHeaderCell';
|
import { StickyColumnHeaderCell } from '../StickyColumnHeaderCell';
|
||||||
import { CompareRow } from './CompareRow';
|
import { CompareRow } from './CompareRow';
|
||||||
import { CompareSectionTitle } from './CompareSectionTitle';
|
import { CompareSectionTitle } from './CompareSectionTitle';
|
||||||
@@ -74,6 +75,9 @@ export function Body({ stats }: BodyProps) {
|
|||||||
))}
|
))}
|
||||||
</Table.Row>
|
</Table.Row>
|
||||||
</Table.Header>
|
</Table.Header>
|
||||||
|
|
||||||
|
<AdStickyTableRow id="compare-1" />
|
||||||
|
|
||||||
<Table.Body>
|
<Table.Body>
|
||||||
<CompareRow stats={stats} name="DPM" value="dpm" decimals={0} />
|
<CompareRow stats={stats} name="DPM" value="dpm" decimals={0} />
|
||||||
<CompareRow
|
<CompareRow
|
||||||
@@ -219,6 +223,8 @@ export function Body({ stats }: BodyProps) {
|
|||||||
/>
|
/>
|
||||||
</Table.Body>
|
</Table.Body>
|
||||||
|
|
||||||
|
<AdStickyTableRow id="compare-2" />
|
||||||
|
|
||||||
<CompareSectionTitle>Maneuverability</CompareSectionTitle>
|
<CompareSectionTitle>Maneuverability</CompareSectionTitle>
|
||||||
<Table.Body>
|
<Table.Body>
|
||||||
<CompareRow
|
<CompareRow
|
||||||
@@ -329,6 +335,8 @@ export function Body({ stats }: BodyProps) {
|
|||||||
/>
|
/>
|
||||||
</Table.Body>
|
</Table.Body>
|
||||||
|
|
||||||
|
<AdStickyTableRow id="compare-3" />
|
||||||
|
|
||||||
<CompareSectionTitle>Survivability</CompareSectionTitle>
|
<CompareSectionTitle>Survivability</CompareSectionTitle>
|
||||||
<Table.Body>
|
<Table.Body>
|
||||||
<CompareRow stats={stats} name="Health" value="health" decimals={0} />
|
<CompareRow stats={stats} name="Health" value="health" decimals={0} />
|
||||||
|
|||||||
@@ -45,7 +45,10 @@ export function CompareTable({ stats }: CompareTableProps) {
|
|||||||
<StickyTableRoot
|
<StickyTableRoot
|
||||||
size="1"
|
size="1"
|
||||||
variant="surface"
|
variant="surface"
|
||||||
style={{ maxWidth: '100%', height: 'calc(100vh - 128px)' }}
|
style={{
|
||||||
|
maxWidth: '100%',
|
||||||
|
// height: 'calc(100vh - 128px)'
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<Table.Header>
|
<Table.Header>
|
||||||
<Table.Row>
|
<Table.Row>
|
||||||
|
|||||||
@@ -477,7 +477,7 @@ export const TankSearch = memo<TankSearchProps>(
|
|||||||
<Flex gridColumn="1 / -1">
|
<Flex gridColumn="1 / -1">
|
||||||
<Ad
|
<Ad
|
||||||
commonHeight={250}
|
commonHeight={250}
|
||||||
id={`tankopedia-search-ad-${Math.floor(index / 32)}`}
|
id={`tankopedia-search-${Math.floor(index / 32)}`}
|
||||||
/>
|
/>
|
||||||
</Flex>
|
</Flex>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -16,6 +16,11 @@ const isRoot = pathname === '/';
|
|||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ad-container {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<!-- MIGRATION TODO: roboto flex font -->
|
<!-- MIGRATION TODO: roboto flex font -->
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import BaseLayout from '../layouts/BaseLayout.astro';
|
|||||||
<ToolCard tool={tankopediaTool} />
|
<ToolCard tool={tankopediaTool} />
|
||||||
|
|
||||||
<Flex justify="center">
|
<Flex justify="center">
|
||||||
<Ad client:idle id="homepage-ad-1" commonHeight={250} />
|
<Ad client:idle id="homepage-1" commonHeight={250} />
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|
||||||
<Flex gap="4" direction={{ initial: 'column', sm: 'row' }}>
|
<Flex gap="4" direction={{ initial: 'column', sm: 'row' }}>
|
||||||
@@ -42,7 +42,7 @@ import BaseLayout from '../layouts/BaseLayout.astro';
|
|||||||
</Flex>
|
</Flex>
|
||||||
|
|
||||||
<Flex justify="center">
|
<Flex justify="center">
|
||||||
<Ad client:idle id="homepage-ad-2" commonHeight={250} />
|
<Ad client:idle id="homepage-2" commonHeight={250} />
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|
||||||
<Flex gap="4" direction={{ initial: 'column', sm: 'row' }}>
|
<Flex gap="4" direction={{ initial: 'column', sm: 'row' }}>
|
||||||
|
|||||||
@@ -48,16 +48,16 @@ export function Page({ id }: PageProps) {
|
|||||||
>
|
>
|
||||||
<HeroSection />
|
<HeroSection />
|
||||||
<ShotDisplaySection />
|
<ShotDisplaySection />
|
||||||
<Ad id="tankopedia-ad-1" commonHeight={250} />
|
<Ad id="tankopedia-1" commonHeight={250} />
|
||||||
<CalloutsSection />
|
<CalloutsSection />
|
||||||
<MetaSection />
|
<MetaSection />
|
||||||
<TechTreeSection />
|
<TechTreeSection />
|
||||||
<Ad id="tankopedia-ad-2" commonHeight={250} />
|
<Ad id="tankopedia-2" commonHeight={250} />
|
||||||
<CharacteristicsSection />
|
<CharacteristicsSection />
|
||||||
<Ad id="tankopedia-ad-3" commonHeight={250} />
|
<Ad id="tankopedia-3" commonHeight={250} />
|
||||||
<GameModeSection />
|
<GameModeSection />
|
||||||
<VideoSection />
|
<VideoSection />
|
||||||
<Ad id="tankopedia-ad-4" commonHeight={250} />
|
<Ad id="tankopedia-4" commonHeight={250} />
|
||||||
<HistorySection />
|
<HistorySection />
|
||||||
</PageWrapper>
|
</PageWrapper>
|
||||||
</Duel.Provider>
|
</Duel.Provider>
|
||||||
|
|||||||
Reference in new issue
Block a user