mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: remove vanilla-extract
This commit is contained in:
1 parent
a58079eed6
commit
2e39b77c80
9 files changed
+63
-82
No files matched your search
Vendored
+1
@@ -67,6 +67,7 @@
|
|||||||
"echarts",
|
"echarts",
|
||||||
"Everytime",
|
"Everytime",
|
||||||
"FASTNAME",
|
"FASTNAME",
|
||||||
|
"flexdirection",
|
||||||
"FOURCC",
|
"FOURCC",
|
||||||
"frameloop",
|
"frameloop",
|
||||||
"fsformat",
|
"fsformat",
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
import react from '@astrojs/react';
|
import react from '@astrojs/react';
|
||||||
import sitemap from '@astrojs/sitemap';
|
import sitemap from '@astrojs/sitemap';
|
||||||
import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin';
|
|
||||||
import { defineConfig } from 'astro/config';
|
import { defineConfig } from 'astro/config';
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
@@ -14,7 +13,6 @@ export default defineConfig({
|
|||||||
|
|
||||||
integrations: [react(), sitemap()],
|
integrations: [react(), sitemap()],
|
||||||
vite: {
|
vite: {
|
||||||
plugins: [vanillaExtractPlugin()],
|
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
'.prisma/client/index-browser':
|
'.prisma/client/index-browser':
|
||||||
|
|||||||
@@ -19,8 +19,6 @@
|
|||||||
"@radix-ui/themes": "^3.1.4",
|
"@radix-ui/themes": "^3.1.4",
|
||||||
"@react-three/drei": "^9.115.0",
|
"@react-three/drei": "^9.115.0",
|
||||||
"@react-three/fiber": "^8.17.10",
|
"@react-three/fiber": "^8.17.10",
|
||||||
"@vanilla-extract/css": "1.15.5",
|
|
||||||
"@vanilla-extract/dynamic": "^2.1.2",
|
|
||||||
"compare-versions": "^6.1.1",
|
"compare-versions": "^6.1.1",
|
||||||
"echarts": "^5.5.1",
|
"echarts": "^5.5.1",
|
||||||
"immer": "^10.1.1",
|
"immer": "^10.1.1",
|
||||||
@@ -42,7 +40,6 @@
|
|||||||
"@types/react": "^18.3.12",
|
"@types/react": "^18.3.12",
|
||||||
"@types/react-dom": "^18.3.1",
|
"@types/react-dom": "^18.3.1",
|
||||||
"@types/three": "^0.160.0",
|
"@types/three": "^0.160.0",
|
||||||
"@vanilla-extract/vite-plugin": "4.0.15",
|
|
||||||
"astro": "^4.16.7"
|
"astro": "^4.16.7"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
import { createVar, style } from '@vanilla-extract/css';
|
|
||||||
|
|
||||||
export const cardBackgroundVar = createVar();
|
|
||||||
|
|
||||||
export const card = style({
|
|
||||||
cursor: 'pointer',
|
|
||||||
display: 'flex',
|
|
||||||
flexDirection: 'column',
|
|
||||||
alignItems: 'center',
|
|
||||||
gap: 'var(--space-2)',
|
|
||||||
background: cardBackgroundVar,
|
|
||||||
overflow: 'hidden',
|
|
||||||
});
|
|
||||||
|
|
||||||
export const image = style({
|
|
||||||
height: 64,
|
|
||||||
width: '100%',
|
|
||||||
objectPosition: 'center right',
|
|
||||||
objectFit: 'contain',
|
|
||||||
});
|
|
||||||
|
|
||||||
export const classIcon = style({
|
|
||||||
width: '1em',
|
|
||||||
height: '1em',
|
|
||||||
minWidth: '1em',
|
|
||||||
minHeight: '1em',
|
|
||||||
});
|
|
||||||
|
|
||||||
export const name = style({
|
|
||||||
whiteSpace: 'nowrap',
|
|
||||||
overflow: 'hidden',
|
|
||||||
textOverflow: 'ellipsis',
|
|
||||||
});
|
|
||||||
|
|
||||||
export const link = style({
|
|
||||||
color: 'inherit',
|
|
||||||
textDecoration: 'none',
|
|
||||||
width: '100%',
|
|
||||||
display: 'flex',
|
|
||||||
flexDirection: 'column',
|
|
||||||
|
|
||||||
':hover': {
|
|
||||||
textDecoration: 'underline',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
.tank-search-card {
|
||||||
|
cursor: pointer;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
gap: var(--space-2);
|
||||||
|
background-position: top left;
|
||||||
|
background-size: contain;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tank-search-card .link {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tank-search-card .image {
|
||||||
|
width: 100%;
|
||||||
|
height: 4rem;
|
||||||
|
object-position: center right;
|
||||||
|
object-fit: contain;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tank-search-card .class-icon {
|
||||||
|
width: 1em;
|
||||||
|
height: 1em;
|
||||||
|
min-width: 1em;
|
||||||
|
min-height: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tank-search-card .name {
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
+15
-15
@@ -10,12 +10,11 @@ import {
|
|||||||
} from '@blitzkit/core';
|
} from '@blitzkit/core';
|
||||||
import { useStore } from '@nanostores/react';
|
import { useStore } from '@nanostores/react';
|
||||||
import { Flex, Link, Text } from '@radix-ui/themes';
|
import { Flex, Link, Text } from '@radix-ui/themes';
|
||||||
import { assignInlineVars } from '@vanilla-extract/dynamic';
|
|
||||||
import { useMemo } from 'react';
|
import { useMemo } from 'react';
|
||||||
import { resolveReload } from '../../../core/blitzkit/resolveReload';
|
import { resolveReload } from '../../../../core/blitzkit/resolveReload';
|
||||||
import { $tankopediaSort } from '../../../stores/tankopediaSort';
|
import { $tankopediaSort } from '../../../../stores/tankopediaSort';
|
||||||
import { classIcons } from '../../ClassIcon';
|
import { classIcons } from '../../../ClassIcon';
|
||||||
import * as styles from './TankCard.css';
|
import './index.css';
|
||||||
|
|
||||||
interface TankCardProps {
|
interface TankCardProps {
|
||||||
tank: TankDefinition;
|
tank: TankDefinition;
|
||||||
@@ -151,21 +150,22 @@ export function TankCard({ tank, onSelect }: TankCardProps) {
|
|||||||
}
|
}
|
||||||
highContrast={tank.type === TankType.RESEARCHABLE}
|
highContrast={tank.type === TankType.RESEARCHABLE}
|
||||||
onClick={onSelect ? () => onSelect(tank) : undefined}
|
onClick={onSelect ? () => onSelect(tank) : undefined}
|
||||||
className={styles.card}
|
className="tank-search-card"
|
||||||
style={assignInlineVars({
|
style={{
|
||||||
[styles.cardBackgroundVar]: `top left / contain no-repeat url(${asset(
|
backgroundImage: `url(${asset(`flags/scratched/${tank.nation}.webp`)})`,
|
||||||
`flags/scratched/${tank.nation}.webp`,
|
}}
|
||||||
)})`,
|
|
||||||
})}
|
|
||||||
>
|
>
|
||||||
<Link
|
<Link
|
||||||
className={styles.link}
|
className="link"
|
||||||
|
color="gray"
|
||||||
|
highContrast
|
||||||
|
underline="hover"
|
||||||
href={onSelect ? '#' : `/tools/tankopedia/${tank.id}`}
|
href={onSelect ? '#' : `/tools/tankopedia/${tank.id}`}
|
||||||
onClick={(event) => {
|
onClick={(event) => {
|
||||||
if (onSelect) event.preventDefault();
|
if (onSelect) event.preventDefault();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<img alt={tank.name} src={tankIcon(tank.id)} className={styles.image} />
|
<img alt={tank.name} src={tankIcon(tank.id)} className="image" />
|
||||||
|
|
||||||
<Flex
|
<Flex
|
||||||
justify="center"
|
justify="center"
|
||||||
@@ -174,8 +174,8 @@ export function TankCard({ tank, onSelect }: TankCardProps) {
|
|||||||
overflow="hidden"
|
overflow="hidden"
|
||||||
width="100%"
|
width="100%"
|
||||||
>
|
>
|
||||||
<Icon className={styles.classIcon} />
|
<Icon className="class-icon" />
|
||||||
<Text align="center" className={styles.name}>
|
<Text align="center" className="name">
|
||||||
{tank.name}
|
{tank.name}
|
||||||
</Text>
|
</Text>
|
||||||
</Flex>
|
</Flex>
|
||||||
+8
@@ -0,0 +1,8 @@
|
|||||||
|
.quick-inputs {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.quick-inputs:focus-within,
|
||||||
|
.tank-sandbox-container:hover .quick-inputs {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
-15
@@ -1,15 +0,0 @@
|
|||||||
import { style } from '@vanilla-extract/css';
|
|
||||||
|
|
||||||
export const container = style({
|
|
||||||
display: 'none',
|
|
||||||
|
|
||||||
':focus-within': {
|
|
||||||
display: 'flex',
|
|
||||||
},
|
|
||||||
|
|
||||||
selectors: {
|
|
||||||
'.tank-sandbox-container:hover &': {
|
|
||||||
display: 'flex',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
+2
-2
@@ -10,7 +10,7 @@ import {
|
|||||||
import { useEquipment } from '../../../../../../../hooks/useEquipment';
|
import { useEquipment } from '../../../../../../../hooks/useEquipment';
|
||||||
import { useTankModelDefinition } from '../../../../../../../hooks/useTankModelDefinition';
|
import { useTankModelDefinition } from '../../../../../../../hooks/useTankModelDefinition';
|
||||||
import { Duel } from '../../../../../../../stores/duel';
|
import { Duel } from '../../../../../../../stores/duel';
|
||||||
import * as styles from './index.css';
|
import './index.css';
|
||||||
|
|
||||||
export function QuickInputs() {
|
export function QuickInputs() {
|
||||||
const mutateDuel = Duel.useMutation();
|
const mutateDuel = Duel.useMutation();
|
||||||
@@ -73,7 +73,7 @@ export function QuickInputs() {
|
|||||||
top: 16,
|
top: 16,
|
||||||
transform: 'translateX(-50%)',
|
transform: 'translateX(-50%)',
|
||||||
}}
|
}}
|
||||||
className={styles.container}
|
className="quick-inputs"
|
||||||
>
|
>
|
||||||
<TextField.Root
|
<TextField.Root
|
||||||
size="1"
|
size="1"
|
||||||
|
|||||||
Reference in new issue
Block a user