fix(ui): 统一下载页主题与智能路由页签间距
This commit is contained in:
@@ -10,6 +10,22 @@
|
|||||||
|
|
||||||
## 2026-11-18
|
## 2026-11-18
|
||||||
|
|
||||||
|
### 调整 · 智能路由卡片首部页签间距
|
||||||
|
|
||||||
|
- **范围**:`/console/smart-router` 的选项卡卡片,以及 UI 公共规范第 10 节。
|
||||||
|
- **变更**:参照官网设置页,将页签卡片主体顶部内边距从 24px 调整为 8px,减少 16px 多余留白;规范明确卡片首部页签的顶部间距、默认高度与适用条件。
|
||||||
|
- **影响**:仅调整该卡片顶部间距,保留页签高度、文字、切换逻辑、权限、请求和其他方向内边距;企业中心的智能路由组件不受影响。
|
||||||
|
- **回滚**:移除 `SmartRouter/index.jsx` 的 `smart-router-tabs-card` 类及对应 CSS 规则,按差异还原规范条目。
|
||||||
|
- **关联**:`docs/standards/UI_COMPONENT_STANDARDS.md` 第 10 节。
|
||||||
|
|
||||||
|
### 修复 · WeyAi 下载页与顶部菜单统一主题
|
||||||
|
|
||||||
|
- **范围**:`/weyai/download`、用户中心内嵌下载页,以及共享顶栏的账户、语言与主导航菜单。
|
||||||
|
- **变更**:本站下载页进入系统样式作用域,修复头像浮层缺少背景与颜色变量;下载页复用公共页头与原生 antd 按钮、标签、骨架,对齐浅深主题、卡片、间距、图标和响应式布局,移除旧装饰渐变与悬浮动效。顶部菜单使用原生 antd 菜单与可聚焦触发器,账户和语言菜单支持点击,下载页锚点跟随实际顶栏高度并遵守减少动态效果偏好。
|
||||||
|
- **影响**:仅调整展示与菜单操作方式,保留下载地址、开放范围、权限判断、请求、语言与主题持久化;其他 WeyAI 外部页仍使用原作用域。
|
||||||
|
- **回滚**:按本条涉及的下载页、`UiThemeProvider.jsx` 与顶栏菜单组件差异还原,保留其他工作区修改。
|
||||||
|
- **关联**:`docs/ui/GLOBAL_UI_BASELINE.md` 第 1、4 节;`docs/standards/UI_COMPONENT_STANDARDS.md`。
|
||||||
|
|
||||||
### 修复 · 平台 Skill 分类标签与搜索栏左对齐
|
### 修复 · 平台 Skill 分类标签与搜索栏左对齐
|
||||||
|
|
||||||
- **范围**:`/console/skill-platform` 分类速览标签区域。
|
- **范围**:`/console/skill-platform` 分类速览标签区域。
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# UI 公共组件与样式规范
|
# UI 公共组件与样式规范
|
||||||
|
|
||||||
> 状态:有效 · 适用:antd 6.7.0 · 更新:2026-11-18 · 版本:v2.4
|
> 状态:有效 · 适用:antd 6.7.0 · 更新:2026-11-18 · 版本:v2.5
|
||||||
|
|
||||||
所有后台页面共用的主题与组件标准。页面规范只记录与本文不同的部分;编码约定见 `DEV_STANDARDS.md`,外壳与布局见 `GLOBAL_UI_BASELINE.md`。
|
所有后台页面共用的主题与组件标准。页面规范只记录与本文不同的部分;编码约定见 `DEV_STANDARDS.md`,外壳与布局见 `GLOBAL_UI_BASELINE.md`。
|
||||||
|
|
||||||
@@ -208,6 +208,7 @@ html.dark .km-page {
|
|||||||
| 类型 | 用法 |
|
| 类型 | 用法 |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| 列表页签 | antd `Tabs`;导航与下方内容间距 20px(控制台 16px);页签间距 28px;文字 14 / 22px;选中与悬停为品牌色,2px 下划线 |
|
| 列表页签 | antd `Tabs`;导航与下方内容间距 20px(控制台 16px);页签间距 28px;文字 14 / 22px;选中与悬停为品牌色,2px 下划线 |
|
||||||
|
| 卡片首部页签 | 控制台卡片主体以 `Tabs` 开始、页签上方没有标题或提示时,主体顶部内边距 8px,参考 `/console/website-setting`、`/console/smart-router`;保留页签默认上下内边距 12px、导航高 46px、与下方内容间距 16px,不叠加空白占位或顶部外边距。卡片其余内边距不变;页签前有错误提示或说明块时按对应容器规则处理。浅深主题、桌面与移动端一致。 |
|
||||||
| 筛选页签 | 只切换筛选条件时隐藏内容区(企业中心 `.oc-tabs-nav-only`),筛选结果由下方列表卡展示 |
|
| 筛选页签 | 只切换筛选条件时隐藏内容区(企业中心 `.oc-tabs-nav-only`),筛选结果由下方列表卡展示 |
|
||||||
| 分段控件 | 2–4 个互斥选项(如趋势维度、充值类型、头像类型)用 `Segmented`,`onChange(value)` 直接接值处理函数 |
|
| 分段控件 | 2–4 个互斥选项(如趋势维度、充值类型、头像类型)用 `Segmented`,`onChange(value)` 直接接值处理函数 |
|
||||||
| 预渲染 | 原先预渲染全部页签的页面保留 `forceRender`,不改变请求时机 |
|
| 预渲染 | 原先预渲染全部页签的页面保留 `forceRender`,不改变请求时机 |
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
- 原型定义的颜色、尺寸、样式、状态与视觉交互优先;原型只作视觉依据,不作业务、数据、状态、接口、路由依据。
|
- 原型定义的颜色、尺寸、样式、状态与视觉交互优先;原型只作视觉依据,不作业务、数据、状态、接口、路由依据。
|
||||||
- 专项规范见 `docs/README.md` 索引;专项未覆盖的部分按本文执行。
|
- 专项规范见 `docs/README.md` 索引;专项未覆盖的部分按本文执行。
|
||||||
- 不重做:WeyAI 外部页与第三方 SDK 的内部视觉;体验中心只检查宿主布局。图表、流程画布、编辑器与新手引导保留专用组件。
|
- 不重做:WeyAI 外部页与第三方 SDK 的内部视觉;本站托管的 `/weyai/download` 属于系统页面,沿用统一主题、顶栏与浮层 token。体验中心只检查宿主布局。图表、流程画布、编辑器与新手引导保留专用组件。
|
||||||
- 改造前先列出已覆盖、未覆盖、排除的页面;配置隐藏、权限重定向和原型失效入口单独列出。
|
- 改造前先列出已覆盖、未覆盖、排除的页面;配置隐藏、权限重定向和原型失效入口单独列出。
|
||||||
|
|
||||||
## 2. 目录职责
|
## 2. 目录职责
|
||||||
|
|||||||
@@ -19,8 +19,7 @@ For commercial licensing, please contact support@quantumnous.com
|
|||||||
|
|
||||||
import { Globe as ActionGlobe } from '@/components/common/icons/ActionIcons';
|
import { Globe as ActionGlobe } from '@/components/common/icons/ActionIcons';
|
||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { Button as AntButton } from 'antd';
|
import { Button as AntButton, Dropdown } from 'antd';
|
||||||
import { Dropdown } from '@/components/ui';
|
|
||||||
import { CN, GB, JP, KR, TH, VN } from 'country-flag-icons/react/3x2';
|
import { CN, GB, JP, KR, TH, VN } from 'country-flag-icons/react/3x2';
|
||||||
import { normalizeLanguage } from '../../../i18n/language';
|
import { normalizeLanguage } from '../../../i18n/language';
|
||||||
import { orderEnabledLanguages } from '../../../i18n/catalog';
|
import { orderEnabledLanguages } from '../../../i18n/catalog';
|
||||||
@@ -47,41 +46,32 @@ const LanguageSelector = ({ currentLang, onLanguageChange, t }) => {
|
|||||||
window.removeEventListener(LANG_BOOT_UPDATED_EVENT, handleBootUpdated);
|
window.removeEventListener(LANG_BOOT_UPDATED_EVENT, handleBootUpdated);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const getItemClassName = (isSelected) =>
|
|
||||||
`!flex !items-center !gap-2 !px-3 !py-1.5 !text-sm ${
|
|
||||||
isSelected
|
|
||||||
? '!bg-ui-color-primary-light-default !font-semibold'
|
|
||||||
: 'hover:!bg-ui-color-fill-1'
|
|
||||||
}`;
|
|
||||||
|
|
||||||
// 展示哪些语言、按什么顺序由后台「语言与地区」配置决定(经 /api/i18n/locale 缓存下发)
|
// 展示哪些语言、按什么顺序由后台「语言与地区」配置决定(经 /api/i18n/locale 缓存下发)
|
||||||
const languages = orderEnabledLanguages(getBootConfig()?.enabled_languages);
|
const languages = orderEnabledLanguages(getBootConfig()?.enabled_languages);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dropdown
|
<Dropdown
|
||||||
position='bottomRight'
|
trigger={['hover', 'click']}
|
||||||
render={
|
placement='bottomRight'
|
||||||
<Dropdown.Menu>
|
menu={{
|
||||||
{languages.map(({ code, endonym, flag }) => {
|
selectable: true,
|
||||||
const Flag = FLAGS[flag];
|
selectedKeys: [lang],
|
||||||
return (
|
onClick: ({ key }) => onLanguageChange(key),
|
||||||
<Dropdown.Item
|
items: languages.map(({ code, endonym, flag }) => {
|
||||||
key={code}
|
const Flag = FLAGS[flag];
|
||||||
onClick={() => onLanguageChange(code)}
|
return {
|
||||||
className={getItemClassName(lang === code)}
|
key: code,
|
||||||
>
|
icon: Flag ? <Flag title={endonym} className='w-5 h-auto' /> : null,
|
||||||
{Flag && <Flag title={endonym} className='!w-5 !h-auto' />}
|
label: endonym,
|
||||||
<span>{endonym}</span>
|
};
|
||||||
</Dropdown.Item>
|
}),
|
||||||
);
|
}}
|
||||||
})}
|
|
||||||
</Dropdown.Menu>
|
|
||||||
}
|
|
||||||
>
|
>
|
||||||
<AntButton
|
<AntButton
|
||||||
type='text'
|
type='text'
|
||||||
icon={<ActionGlobe size={16} strokeWidth={1.5} aria-hidden />}
|
icon={<ActionGlobe size={16} strokeWidth={1.5} aria-hidden />}
|
||||||
aria-label={t('common.changeLanguage')}
|
aria-label={t('common.changeLanguage')}
|
||||||
|
aria-haspopup='menu'
|
||||||
className='ui-header-icon-action'
|
className='ui-header-icon-action'
|
||||||
/>
|
/>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ For commercial licensing, please contact support@quantumnous.com
|
|||||||
import { Compass as ActionCompass } from '@/components/common/icons/ActionIcons';
|
import { Compass as ActionCompass } from '@/components/common/icons/ActionIcons';
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { useLocation, useNavigate } from 'react-router-dom';
|
import { useLocation, useNavigate } from 'react-router-dom';
|
||||||
import { Button, Dropdown } from '@/components/ui';
|
import { Button, Dropdown } from 'antd';
|
||||||
import { ExternalLink } from 'lucide-react';
|
import { ExternalLink } from 'lucide-react';
|
||||||
import { isNavigationPathActive } from '../../console/consoleRoutes';
|
import { isNavigationPathActive } from '../../console/consoleRoutes';
|
||||||
|
|
||||||
@@ -92,63 +92,51 @@ const MobileNavMenu = ({ mainNavLinks, userState, t }) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Dropdown
|
<Dropdown
|
||||||
trigger='click'
|
trigger={['click']}
|
||||||
position='bottomLeft'
|
placement='bottomLeft'
|
||||||
visible={visible}
|
open={visible}
|
||||||
onVisibleChange={setVisible}
|
onOpenChange={setVisible}
|
||||||
render={
|
menu={{
|
||||||
<Dropdown.Menu className='!min-w-[168px] !p-1.5 !rounded-xl !border !border-gray-100 dark:!border-neutral-800 !shadow-xl !shadow-gray-200/50 dark:!shadow-black/30 !backdrop-blur-xl !bg-white/95 dark:!bg-neutral-900/95'>
|
selectedKeys: menuItems
|
||||||
{menuItems.map((item) => (
|
.filter((item) => item.active)
|
||||||
<Dropdown.Item
|
.map((item) => item.key),
|
||||||
key={item.key}
|
items: menuItems.map((item) => ({
|
||||||
onClick={() => {
|
key: item.key,
|
||||||
setVisible(false);
|
onClick: () => {
|
||||||
if (item.externalLink) {
|
setVisible(false);
|
||||||
window.open(
|
if (item.externalLink) {
|
||||||
item.externalLink,
|
window.open(item.externalLink, '_blank', 'noopener,noreferrer');
|
||||||
'_blank',
|
} else if (item.to) {
|
||||||
'noopener,noreferrer',
|
navigate(item.to);
|
||||||
);
|
}
|
||||||
} else if (item.to) {
|
},
|
||||||
navigate(item.to);
|
label: (
|
||||||
}
|
<span
|
||||||
}}
|
className='flex items-center gap-1.5'
|
||||||
className={`!rounded-lg !my-0.5 !px-3 !py-2 !text-sm !transition-colors ${
|
aria-current={item.active ? 'page' : undefined}
|
||||||
item.active
|
|
||||||
? '!bg-brand/10 dark:!bg-brand-deep/40 !text-brand-deep dark:!text-brand-from !font-semibold'
|
|
||||||
: '!text-gray-700 dark:!text-neutral-200'
|
|
||||||
}`}
|
|
||||||
>
|
>
|
||||||
<span
|
{item.text}
|
||||||
className='flex items-center gap-1.5'
|
{item.externalLink && (
|
||||||
aria-current={item.active ? 'page' : undefined}
|
<ExternalLink size={12} className='opacity-50' />
|
||||||
>
|
)}
|
||||||
{item.text}
|
</span>
|
||||||
{item.externalLink && (
|
),
|
||||||
<ExternalLink size={12} className='opacity-50' />
|
})),
|
||||||
)}
|
}}
|
||||||
</span>
|
|
||||||
</Dropdown.Item>
|
|
||||||
))}
|
|
||||||
</Dropdown.Menu>
|
|
||||||
}
|
|
||||||
>
|
>
|
||||||
<span className='inline-flex'>
|
<Button
|
||||||
<Button
|
type='text'
|
||||||
theme='borderless'
|
aria-label={t('主导航')}
|
||||||
type='tertiary'
|
title={activeItem?.text}
|
||||||
aria-label={t('主导航')}
|
aria-haspopup='menu'
|
||||||
title={activeItem?.text}
|
aria-expanded={visible}
|
||||||
aria-haspopup='menu'
|
icon={<ActionCompass size={16} />}
|
||||||
aria-expanded={visible}
|
className='ml-1 px-2 max-w-[9rem] [&_.ant-btn-content]:min-w-0'
|
||||||
icon={<ActionCompass size={16} />}
|
>
|
||||||
className='!ml-1 !px-2 !h-8 max-w-[9rem] !rounded-xl !text-current hover:!bg-brand/10 dark:hover:!bg-brand/15 hover:!text-brand-deep dark:hover:!text-brand-from !transition-all !duration-200 active:!scale-95 [&_.ant-btn-content]:min-w-0'
|
<span className='ml-1 text-[13px] font-semibold truncate'>
|
||||||
>
|
{activeItem?.mobileText || activeItem?.text || t('导航')}
|
||||||
<span className='ml-1 text-[13px] font-semibold truncate'>
|
</span>
|
||||||
{activeItem?.mobileText || activeItem?.text || t('导航')}
|
</Button>
|
||||||
</span>
|
|
||||||
</Button>
|
|
||||||
</span>
|
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -19,7 +19,11 @@ For commercial licensing, please contact support@quantumnous.com
|
|||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Link, useLocation } from 'react-router-dom';
|
import { Link, useLocation } from 'react-router-dom';
|
||||||
import { Dropdown } from '@/components/ui';
|
import { Dropdown } from 'antd';
|
||||||
|
import {
|
||||||
|
ChevronDown,
|
||||||
|
ExternalLink,
|
||||||
|
} from '@/components/common/icons/ActionIcons';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import SkeletonWrapper from '../components/SkeletonWrapper';
|
import SkeletonWrapper from '../components/SkeletonWrapper';
|
||||||
import { isNavigationPathActive } from '../../console/consoleRoutes';
|
import { isNavigationPathActive } from '../../console/consoleRoutes';
|
||||||
@@ -68,44 +72,27 @@ const Navigation = ({ mainNavLinks, isMobile, isLoading, userState }) => {
|
|||||||
return (
|
return (
|
||||||
<Dropdown
|
<Dropdown
|
||||||
key={link.itemKey}
|
key={link.itemKey}
|
||||||
trigger={'hover'}
|
trigger={['hover', 'click']}
|
||||||
position={'bottomLeft'}
|
placement='bottomLeft'
|
||||||
render={
|
menu={{
|
||||||
<Dropdown.Menu>
|
selectedKeys: link.items
|
||||||
{link.items.map((subItem) => (
|
.filter((item) => isPathActive(item.to))
|
||||||
<Dropdown.Item key={subItem.itemKey}>
|
.map((item) => item.itemKey),
|
||||||
<Link
|
items: link.items.map((subItem) => ({
|
||||||
to={subItem.to}
|
key: subItem.itemKey,
|
||||||
className='block w-full py-0.5 text-gray-700 dark:text-neutral-200 hover:text-brand-deep dark:hover:text-brand-from transition-colors'
|
label: <Link to={subItem.to}>{subItem.text}</Link>,
|
||||||
style={{ textDecoration: 'none' }}
|
})),
|
||||||
>
|
}}
|
||||||
{subItem.text}
|
|
||||||
</Link>
|
|
||||||
</Dropdown.Item>
|
|
||||||
))}
|
|
||||||
</Dropdown.Menu>
|
|
||||||
}
|
|
||||||
>
|
>
|
||||||
<div
|
<button
|
||||||
|
type='button'
|
||||||
className={`${finalClasses} cursor-pointer`}
|
className={`${finalClasses} cursor-pointer`}
|
||||||
|
aria-haspopup='menu'
|
||||||
aria-current={isActive ? 'page' : undefined}
|
aria-current={isActive ? 'page' : undefined}
|
||||||
>
|
>
|
||||||
{linkContent}
|
{linkContent}
|
||||||
{/* Dropdown arrow */}
|
<ChevronDown size={14} aria-hidden />
|
||||||
<svg
|
</button>
|
||||||
className='w-3.5 h-3.5 opacity-50 group-hover:opacity-100 transition-all duration-300 group-hover:rotate-180'
|
|
||||||
fill='none'
|
|
||||||
viewBox='0 0 24 24'
|
|
||||||
stroke='currentColor'
|
|
||||||
>
|
|
||||||
<path
|
|
||||||
strokeLinecap='round'
|
|
||||||
strokeLinejoin='round'
|
|
||||||
strokeWidth={2}
|
|
||||||
d='M19 9l-7 7-7-7'
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
</div>
|
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -120,20 +107,7 @@ const Navigation = ({ mainNavLinks, isMobile, isLoading, userState }) => {
|
|||||||
className={`${baseClasses} ${spacingClasses} ${defaultClasses} ${hoverClasses}`}
|
className={`${baseClasses} ${spacingClasses} ${defaultClasses} ${hoverClasses}`}
|
||||||
>
|
>
|
||||||
{linkContent}
|
{linkContent}
|
||||||
{/* External link icon */}
|
<ExternalLink size={12} aria-hidden />
|
||||||
<svg
|
|
||||||
className='w-3 h-3 opacity-50 group-hover:opacity-100 transition-opacity'
|
|
||||||
fill='none'
|
|
||||||
viewBox='0 0 24 24'
|
|
||||||
stroke='currentColor'
|
|
||||||
>
|
|
||||||
<path
|
|
||||||
strokeLinecap='round'
|
|
||||||
strokeLinejoin='round'
|
|
||||||
strokeWidth={2}
|
|
||||||
d='M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14'
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
</a>
|
</a>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ const UserArea = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<AntDropdown
|
<AntDropdown
|
||||||
trigger={['hover']}
|
trigger={['hover', 'click']}
|
||||||
placement='bottomRight'
|
placement='bottomRight'
|
||||||
open={open}
|
open={open}
|
||||||
onOpenChange={setOpen}
|
onOpenChange={setOpen}
|
||||||
|
|||||||
@@ -20,6 +20,11 @@
|
|||||||
margin-bottom: 18px;
|
margin-bottom: 18px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Match the tab-first card spacing used by WebsiteSettings. */
|
||||||
|
.console-page .smart-router-tabs-card.ant-card > .ant-card-body {
|
||||||
|
padding-top: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
/* 控制台介绍区:无图标、无渐变的说明块;标题与内边距由公共页头 / 容器统一 */
|
/* 控制台介绍区:无图标、无渐变的说明块;标题与内边距由公共页头 / 容器统一 */
|
||||||
.smart-router-hero {
|
.smart-router-hero {
|
||||||
padding: 16px 24px;
|
padding: 16px 24px;
|
||||||
|
|||||||
@@ -261,8 +261,11 @@ export default function UiThemeProvider({ children }) {
|
|||||||
// 日期面板的星期、月份名称来自 dayjs 全局语言,需与 Ant Design locale 保持一致。
|
// 日期面板的星期、月份名称来自 dayjs 全局语言,需与 Ant Design locale 保持一致。
|
||||||
dayjs.locale(DAYJS_LOCALES[language] || 'zh-cn');
|
dayjs.locale(DAYJS_LOCALES[language] || 'zh-cn');
|
||||||
useLayoutEffect(() => {
|
useLayoutEffect(() => {
|
||||||
|
// The hosted download page shares the system shell and its popup tokens.
|
||||||
|
const isDownloadPage = /^\/weyai\/download\/?$/.test(pathname);
|
||||||
document.body.dataset.uiScope =
|
document.body.dataset.uiScope =
|
||||||
pathname.startsWith('/weyai/') || pathname.startsWith('/client/authorize')
|
(pathname.startsWith('/weyai/') && !isDownloadPage) ||
|
||||||
|
pathname.startsWith('/client/authorize')
|
||||||
? 'external'
|
? 'external'
|
||||||
: 'admin';
|
: 'admin';
|
||||||
}, [pathname]);
|
}, [pathname]);
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ const SmartRouterPage = () => {
|
|||||||
)}
|
)}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<ConsoleCard>
|
<ConsoleCard className='smart-router-tabs-card'>
|
||||||
<ConsoleTabs
|
<ConsoleTabs
|
||||||
activeKey={activeKey}
|
activeKey={activeKey}
|
||||||
onChange={onTab}
|
onChange={onTab}
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ import {
|
|||||||
} from '@/components/common/icons/ActionIcons';
|
} from '@/components/common/icons/ActionIcons';
|
||||||
import React, { useContext, useEffect, useMemo, useState } from 'react';
|
import React, { useContext, useEffect, useMemo, useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Button, Skeleton, Tag } from '@/components/ui';
|
import { Button, Skeleton, Tag } from 'antd';
|
||||||
import {
|
import {
|
||||||
AlertTriangle,
|
AlertTriangle,
|
||||||
Cpu,
|
Cpu,
|
||||||
@@ -49,8 +49,7 @@ import {
|
|||||||
import { API } from '../../helpers/api';
|
import { API } from '../../helpers/api';
|
||||||
import { StatusContext } from '../../context/Status';
|
import { StatusContext } from '../../context/Status';
|
||||||
import { UserContext } from '../../context/User';
|
import { UserContext } from '../../context/User';
|
||||||
import PageBackground from '../../components/common/PageBackground';
|
import UserCenterPageHeader from '../../components/common/UserCenterPageHeader';
|
||||||
import UserCenterBreadcrumb from '../../components/common/UserCenterBreadcrumb';
|
|
||||||
import { useWeyAiWebEntry } from '../../hooks/common/useWeyAiWebEntry';
|
import { useWeyAiWebEntry } from '../../hooks/common/useWeyAiWebEntry';
|
||||||
import {
|
import {
|
||||||
PLATFORMS,
|
PLATFORMS,
|
||||||
@@ -247,9 +246,12 @@ const WeyAiDownload = ({ embedded = false }) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const scrollToAll = () => {
|
const scrollToAll = () => {
|
||||||
document
|
document.getElementById(ALL_PACKAGES_ID)?.scrollIntoView({
|
||||||
.getElementById(ALL_PACKAGES_ID)
|
behavior: window.matchMedia('(prefers-reduced-motion: reduce)').matches
|
||||||
?.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
? 'instant'
|
||||||
|
: 'smooth',
|
||||||
|
block: 'start',
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const download = (url) => window.open(url, '_self');
|
const download = (url) => window.open(url, '_self');
|
||||||
@@ -275,21 +277,16 @@ const WeyAiDownload = ({ embedded = false }) => {
|
|||||||
<div className='wd-file__main'>
|
<div className='wd-file__main'>
|
||||||
<div className='wd-file__title'>
|
<div className='wd-file__title'>
|
||||||
<span>{archLabel(file.arch) || file.name}</span>
|
<span>{archLabel(file.arch) || file.name}</span>
|
||||||
{file.kind && <Tag size='small'>{file.kind}</Tag>}
|
{file.kind && <Tag>{file.kind}</Tag>}
|
||||||
{isReco && (
|
{isReco && <Tag className='wd-recommended-tag'>{t('推荐')}</Tag>}
|
||||||
<Tag size='small' color='blue'>
|
|
||||||
{t('推荐')}
|
|
||||||
</Tag>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
<span className='wd-file__meta' title={file.name}>
|
<span className='wd-file__meta' title={file.name}>
|
||||||
{fileMeta(file)}
|
{fileMeta(file)}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<Button
|
<Button
|
||||||
icon={<ActionDownload size={14} />}
|
icon={<ActionDownload size={16} aria-hidden />}
|
||||||
theme={isReco ? 'solid' : 'light'}
|
type={isReco ? 'primary' : 'default'}
|
||||||
type='primary'
|
|
||||||
aria-label={`${t('下载')} ${file.name}`}
|
aria-label={`${t('下载')} ${file.name}`}
|
||||||
onClick={() => download(file.url)}
|
onClick={() => download(file.url)}
|
||||||
>
|
>
|
||||||
@@ -322,7 +319,7 @@ const WeyAiDownload = ({ embedded = false }) => {
|
|||||||
</h2>
|
</h2>
|
||||||
<div className='wd-reco__meta'>
|
<div className='wd-reco__meta'>
|
||||||
<code>{recommended.name}</code>
|
<code>{recommended.name}</code>
|
||||||
{recommended.size && (
|
{recommended.size > 0 && (
|
||||||
<span>{formatSize(recommended.size)}</span>
|
<span>{formatSize(recommended.size)}</span>
|
||||||
)}
|
)}
|
||||||
{release?.version && <span>v{release.version}</span>}
|
{release?.version && <span>v{release.version}</span>}
|
||||||
@@ -342,15 +339,13 @@ const WeyAiDownload = ({ embedded = false }) => {
|
|||||||
</div>
|
</div>
|
||||||
<div className='wd-reco__actions'>
|
<div className='wd-reco__actions'>
|
||||||
<Button
|
<Button
|
||||||
size='large'
|
|
||||||
theme='solid'
|
|
||||||
type='primary'
|
type='primary'
|
||||||
icon={<ActionDownload size={16} />}
|
icon={<ActionDownload size={16} aria-hidden />}
|
||||||
onClick={() => download(recommended.url)}
|
onClick={() => download(recommended.url)}
|
||||||
>
|
>
|
||||||
{t('下载 WeyAi')}
|
{t('下载 WeyAi')}
|
||||||
</Button>
|
</Button>
|
||||||
<Button theme='borderless' type='tertiary' onClick={scrollToAll}>
|
<Button type='text' onClick={scrollToAll}>
|
||||||
{t('其他平台与架构')}
|
{t('其他平台与架构')}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
@@ -387,10 +382,8 @@ const WeyAiDownload = ({ embedded = false }) => {
|
|||||||
</div>
|
</div>
|
||||||
<div className='wd-reco__actions'>
|
<div className='wd-reco__actions'>
|
||||||
<Button
|
<Button
|
||||||
size='large'
|
|
||||||
theme='solid'
|
|
||||||
type='primary'
|
type='primary'
|
||||||
icon={<ActionDownload size={16} />}
|
icon={<ActionDownload size={16} aria-hidden />}
|
||||||
onClick={() => download(androidApk.url)}
|
onClick={() => download(androidApk.url)}
|
||||||
>
|
>
|
||||||
{t('下载 Android 版')}
|
{t('下载 Android 版')}
|
||||||
@@ -431,7 +424,7 @@ const WeyAiDownload = ({ embedded = false }) => {
|
|||||||
</div>
|
</div>
|
||||||
{client.os !== 'mobile' && (
|
{client.os !== 'mobile' && (
|
||||||
<div className='wd-reco__actions'>
|
<div className='wd-reco__actions'>
|
||||||
<Button theme='solid' type='primary' onClick={scrollToAll}>
|
<Button type='primary' onClick={scrollToAll}>
|
||||||
{t('查看全部安装包')}
|
{t('查看全部安装包')}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
@@ -445,17 +438,8 @@ const WeyAiDownload = ({ embedded = false }) => {
|
|||||||
if (!statusLoaded || loading) {
|
if (!statusLoaded || loading) {
|
||||||
return (
|
return (
|
||||||
<section className='wd-card wd-skeleton' aria-busy='true'>
|
<section className='wd-card wd-skeleton' aria-busy='true'>
|
||||||
<Skeleton
|
<Skeleton active title={{ width: '40%' }} paragraph={{ rows: 2 }} />
|
||||||
loading
|
<Skeleton.Button active style={{ width: 160, maxWidth: '100%' }} />
|
||||||
active
|
|
||||||
placeholder={
|
|
||||||
<>
|
|
||||||
<Skeleton.Title style={{ width: 240 }} />
|
|
||||||
<Skeleton.Paragraph rows={2} style={{ marginTop: 12 }} />
|
|
||||||
<Skeleton.Button style={{ width: 160, marginTop: 12 }} />
|
|
||||||
</>
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -477,9 +461,8 @@ const WeyAiDownload = ({ embedded = false }) => {
|
|||||||
desc={loadError}
|
desc={loadError}
|
||||||
actions={
|
actions={
|
||||||
<Button
|
<Button
|
||||||
theme='solid'
|
|
||||||
type='primary'
|
type='primary'
|
||||||
icon={<ActionRefreshCw size={14} />}
|
icon={<ActionRefreshCw size={16} aria-hidden />}
|
||||||
onClick={load}
|
onClick={load}
|
||||||
>
|
>
|
||||||
{t('重试')}
|
{t('重试')}
|
||||||
@@ -542,16 +525,14 @@ const WeyAiDownload = ({ embedded = false }) => {
|
|||||||
<div className='wd-file__main'>
|
<div className='wd-file__main'>
|
||||||
<div className='wd-file__title'>
|
<div className='wd-file__title'>
|
||||||
<span>{I18N_TECHNICAL_TEXT.ANDROID}</span>
|
<span>{I18N_TECHNICAL_TEXT.ANDROID}</span>
|
||||||
<Tag size='small'>apk</Tag>
|
<Tag>apk</Tag>
|
||||||
</div>
|
</div>
|
||||||
<span className='wd-file__meta' title={androidApk.name}>
|
<span className='wd-file__meta' title={androidApk.name}>
|
||||||
{androidMeta}
|
{androidMeta}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<Button
|
<Button
|
||||||
icon={<ActionDownload size={14} />}
|
icon={<ActionDownload size={16} aria-hidden />}
|
||||||
theme='light'
|
|
||||||
type='primary'
|
|
||||||
aria-label={`${t('下载')} ${androidApk.name}`}
|
aria-label={`${t('下载')} ${androidApk.name}`}
|
||||||
onClick={() => download(androidApk.url)}
|
onClick={() => download(androidApk.url)}
|
||||||
>
|
>
|
||||||
@@ -572,72 +553,71 @@ const WeyAiDownload = ({ embedded = false }) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const rootClass = `weyai-download ${
|
const rootClass = `weyai-download ${
|
||||||
embedded
|
embedded ? 'weyai-download--embedded' : 'weyai-download--standalone'
|
||||||
? 'weyai-download--embedded'
|
|
||||||
: 'weyai-download--standalone mt-[60px]'
|
|
||||||
}`;
|
}`;
|
||||||
|
|
||||||
|
const heroActions = (
|
||||||
|
<div className='wd-hero-actions'>
|
||||||
|
{isLoggedIn && webVisible && webUrl && (
|
||||||
|
<Button
|
||||||
|
icon={<ActionGlobe size={16} aria-hidden />}
|
||||||
|
onClick={() => window.open(webUrl, '_blank', 'noopener')}
|
||||||
|
>
|
||||||
|
{t('使用网页版')}
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
<Button
|
||||||
|
icon={<ActionExternalLink size={16} aria-hidden />}
|
||||||
|
onClick={() => {
|
||||||
|
window.location.href = OPEN_APP_URL;
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t('已安装?打开 WeyAi')}
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={rootClass}>
|
<div className={rootClass}>
|
||||||
{!embedded && <PageBackground grid />}
|
|
||||||
<div className='weyai-download__inner'>
|
<div className='weyai-download__inner'>
|
||||||
{embedded && <UserCenterBreadcrumb />}
|
<div className='wd-hero'>
|
||||||
<header className='wd-hero'>
|
{!embedded && (
|
||||||
<div className='min-w-0'>
|
|
||||||
<div className='wd-eyebrow'>
|
<div className='wd-eyebrow'>
|
||||||
<MonitorDown size={14} aria-hidden='true' />
|
<MonitorDown size={16} aria-hidden='true' />
|
||||||
{I18N_TECHNICAL_TEXT.WEYAI_DESKTOP}
|
{I18N_TECHNICAL_TEXT.WEYAI_DESKTOP}
|
||||||
</div>
|
</div>
|
||||||
<h1>{t('下载 WeyAi 桌面端')}</h1>
|
)}
|
||||||
<p>{t('用你的账号登录,直接使用平台提供的模型和余额')}</p>
|
<UserCenterPageHeader
|
||||||
<div className='wd-hero-meta'>
|
title={t('下载 WeyAi 桌面端')}
|
||||||
{release?.version && (
|
subtitle={t('用你的账号登录,直接使用平台提供的模型和余额')}
|
||||||
<span className='wd-chip'>
|
breadcrumb={embedded ? undefined : null}
|
||||||
{t('最新版本 v{{version}}', { version: release.version })}
|
extra={heroActions}
|
||||||
</span>
|
/>
|
||||||
)}
|
<div className='wd-hero-meta'>
|
||||||
{release?.releaseDate && (
|
{release?.version && (
|
||||||
<span className='wd-chip wd-chip--muted'>
|
<span className='wd-chip'>
|
||||||
{t('发布于 {{date}}', {
|
{t('最新版本 v{{version}}', { version: release.version })}
|
||||||
date: formatReleaseDate(release.releaseDate),
|
|
||||||
})}
|
|
||||||
</span>
|
|
||||||
)}
|
|
||||||
{/* 有清单时按实际有安装包的平台展示,别在缺某平台 feed 时还声称支持 */}
|
|
||||||
<span className='wd-chip wd-chip--muted'>
|
|
||||||
{[
|
|
||||||
...(platformsWithFiles.length
|
|
||||||
? platformsWithFiles
|
|
||||||
: PLATFORMS
|
|
||||||
).map((platform) => PLATFORM_LABEL[platform]),
|
|
||||||
...(androidApk ? ['Android'] : []),
|
|
||||||
].join(' · ')}
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className='wd-hero-actions'>
|
|
||||||
{/* 未登录访客不给网页版按钮:hook 对匿名恒可见,点了会直接打到网关的
|
|
||||||
/sso/start 再被弹回登录,不如顶栏那样先引导登录 */}
|
|
||||||
{isLoggedIn && webVisible && webUrl && (
|
|
||||||
<Button
|
|
||||||
icon={<ActionGlobe size={14} />}
|
|
||||||
theme='light'
|
|
||||||
type='primary'
|
|
||||||
onClick={() => window.open(webUrl, '_blank', 'noopener')}
|
|
||||||
>
|
|
||||||
{t('使用网页版')}
|
|
||||||
</Button>
|
|
||||||
)}
|
)}
|
||||||
<Button
|
{release?.releaseDate && (
|
||||||
icon={<ActionExternalLink size={14} />}
|
<span className='wd-chip wd-chip--muted'>
|
||||||
onClick={() => {
|
{t('发布于 {{date}}', {
|
||||||
window.location.href = OPEN_APP_URL;
|
date: formatReleaseDate(release.releaseDate),
|
||||||
}}
|
})}
|
||||||
>
|
</span>
|
||||||
{t('已安装?打开 WeyAi')}
|
)}
|
||||||
</Button>
|
{/* 有清单时按实际有安装包的平台展示,别在缺某平台 feed 时还声称支持 */}
|
||||||
|
<span className='wd-chip wd-chip--muted'>
|
||||||
|
{[
|
||||||
|
...(platformsWithFiles.length
|
||||||
|
? platformsWithFiles
|
||||||
|
: PLATFORMS
|
||||||
|
).map((platform) => PLATFORM_LABEL[platform]),
|
||||||
|
...(androidApk ? ['Android'] : []),
|
||||||
|
].join(' · ')}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</div>
|
||||||
|
|
||||||
{renderPackages()}
|
{renderPackages()}
|
||||||
|
|
||||||
|
|||||||
@@ -1,53 +1,42 @@
|
|||||||
/* WeyAi 桌面端下载页:控制台风格,配色全部从主题 token 派生。
|
/* The standalone and embedded download views share the system theme. */
|
||||||
独立路由时由本页渲染 <PageBackground>;嵌入用户中心时 shell 已提供背景,本页不再自绘。 */
|
|
||||||
.weyai-download {
|
.weyai-download {
|
||||||
--wd-ink: var(--text-primary);
|
--wd-ink: var(--text-primary);
|
||||||
--wd-muted: var(--text-secondary);
|
--wd-muted: var(--text-secondary);
|
||||||
--wd-line: var(--border-subtle);
|
--wd-line: var(--border-subtle);
|
||||||
--wd-card: var(--surface-card);
|
--wd-card: var(--surface-card);
|
||||||
--wd-accent: var(--ui-color-primary);
|
--wd-accent: var(--brand-primary);
|
||||||
--wd-accent-deep: var(--ui-color-primary-active, var(--ui-color-primary));
|
--wd-accent-deep: var(--brand-primary);
|
||||||
--wd-tint: color-mix(in srgb, var(--ui-color-primary) 8%, transparent);
|
--wd-tint: color-mix(in srgb, var(--brand-primary) 8%, transparent);
|
||||||
--wd-tint-strong: color-mix(
|
--wd-tint-strong: color-mix(in srgb, var(--brand-primary) 14%, transparent);
|
||||||
in srgb,
|
--wd-accent-line: color-mix(in srgb, var(--brand-primary) 28%, transparent);
|
||||||
var(--ui-color-primary) 14%,
|
|
||||||
transparent
|
|
||||||
);
|
|
||||||
--wd-accent-line: color-mix(
|
|
||||||
in srgb,
|
|
||||||
var(--ui-color-primary) 28%,
|
|
||||||
transparent
|
|
||||||
);
|
|
||||||
--wd-danger: var(--ui-color-danger);
|
--wd-danger: var(--ui-color-danger);
|
||||||
--wd-danger-tint: color-mix(in srgb, var(--ui-color-danger) 8%, transparent);
|
--wd-danger-tint: color-mix(in srgb, var(--ui-color-danger) 8%, transparent);
|
||||||
|
--wd-focus: var(--brand-primary);
|
||||||
position: relative;
|
position: relative;
|
||||||
|
min-width: 0;
|
||||||
color: var(--wd-ink);
|
color: var(--wd-ink);
|
||||||
}
|
}
|
||||||
|
|
||||||
.weyai-download--standalone {
|
.weyai-download--standalone {
|
||||||
min-height: calc(100vh - 60px);
|
margin-top: calc(
|
||||||
overflow: hidden;
|
var(--console-header-offset, 72px) - var(--content-top-offset, 0px)
|
||||||
|
);
|
||||||
|
min-height: calc(100dvh - var(--console-header-offset, 72px));
|
||||||
|
background: var(--surface-bg-base);
|
||||||
}
|
}
|
||||||
|
|
||||||
.weyai-download__inner {
|
.weyai-download__inner {
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 10;
|
|
||||||
max-width: 1120px;
|
max-width: 1120px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
padding: 16px;
|
padding: 24px 30px;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 20px;
|
gap: 18px;
|
||||||
}
|
}
|
||||||
@media (min-width: 640px) {
|
@media (max-width: 768px) {
|
||||||
.weyai-download__inner {
|
.weyai-download__inner {
|
||||||
padding: 24px;
|
padding: 16px;
|
||||||
gap: 24px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@media (min-width: 1024px) {
|
|
||||||
.weyai-download__inner {
|
|
||||||
padding: 32px;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* 嵌入用户中心:跟随内容区宽度,不再居中收窄;内边距与面包屑对齐 .uc-page 统一边距 */
|
/* 嵌入用户中心:跟随内容区宽度,不再居中收窄;内边距与面包屑对齐 .uc-page 统一边距 */
|
||||||
@@ -56,14 +45,9 @@
|
|||||||
padding: var(--uc-page-pad-top, 30px) var(--uc-page-pad-x, 36px)
|
padding: var(--uc-page-pad-top, 30px) var(--uc-page-pad-x, 36px)
|
||||||
var(--uc-page-pad-bottom, 36px);
|
var(--uc-page-pad-bottom, 36px);
|
||||||
}
|
}
|
||||||
.weyai-download--embedded .ui-user-center-breadcrumb {
|
/* Keep package headings visible below the fixed header and announcement. */
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 「其他平台与架构」锚点:独立路由下顶栏 64px 与跑马灯 40px 都是 fixed,
|
|
||||||
scrollIntoView 会把标题顶到它们后面;嵌入模式滚动容器本身在顶栏之下 */
|
|
||||||
.weyai-download--standalone #weyai-download-all {
|
.weyai-download--standalone #weyai-download-all {
|
||||||
scroll-margin-top: 120px;
|
scroll-margin-top: calc(var(--console-header-offset, 72px) + 16px);
|
||||||
}
|
}
|
||||||
.weyai-download--embedded #weyai-download-all {
|
.weyai-download--embedded #weyai-download-all {
|
||||||
scroll-margin-top: 16px;
|
scroll-margin-top: 16px;
|
||||||
@@ -71,11 +55,13 @@
|
|||||||
|
|
||||||
/* ───── hero ───── */
|
/* ───── hero ───── */
|
||||||
.wd-hero {
|
.wd-hero {
|
||||||
display: flex;
|
min-width: 0;
|
||||||
flex-wrap: wrap;
|
}
|
||||||
align-items: flex-end;
|
.wd-hero > .wd-eyebrow {
|
||||||
justify-content: space-between;
|
margin-bottom: 8px;
|
||||||
gap: 16px 24px;
|
}
|
||||||
|
.wd-hero .uc-page-header {
|
||||||
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
.wd-eyebrow {
|
.wd-eyebrow {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
@@ -87,25 +73,6 @@
|
|||||||
letter-spacing: 0.08em;
|
letter-spacing: 0.08em;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
}
|
}
|
||||||
.wd-hero h1 {
|
|
||||||
margin: 8px 0 6px;
|
|
||||||
font-size: 24px;
|
|
||||||
font-weight: 700;
|
|
||||||
letter-spacing: -0.01em;
|
|
||||||
line-height: 1.3;
|
|
||||||
color: var(--wd-ink);
|
|
||||||
}
|
|
||||||
@media (min-width: 640px) {
|
|
||||||
.wd-hero h1 {
|
|
||||||
font-size: 28px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.wd-hero p {
|
|
||||||
margin: 0;
|
|
||||||
font-size: 13px;
|
|
||||||
line-height: 20px;
|
|
||||||
color: var(--wd-muted);
|
|
||||||
}
|
|
||||||
.wd-hero-meta {
|
.wd-hero-meta {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
@@ -119,7 +86,7 @@
|
|||||||
gap: 6px;
|
gap: 6px;
|
||||||
padding: 3px 10px;
|
padding: 3px 10px;
|
||||||
border: 1px solid var(--wd-accent-line);
|
border: 1px solid var(--wd-accent-line);
|
||||||
border-radius: 999px;
|
border-radius: 8px;
|
||||||
background: var(--wd-tint);
|
background: var(--wd-tint);
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
@@ -141,7 +108,7 @@
|
|||||||
/* ───── 卡片基础 ───── */
|
/* ───── 卡片基础 ───── */
|
||||||
.wd-card {
|
.wd-card {
|
||||||
border: 1px solid var(--wd-line);
|
border: 1px solid var(--wd-line);
|
||||||
border-radius: 14px;
|
border-radius: 12px;
|
||||||
background: var(--wd-card);
|
background: var(--wd-card);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -149,28 +116,21 @@
|
|||||||
.wd-reco {
|
.wd-reco {
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
padding: 20px;
|
padding: 24px;
|
||||||
border-color: var(--wd-accent-line);
|
border-color: var(--wd-accent-line);
|
||||||
background:
|
background: var(--wd-card);
|
||||||
radial-gradient(120% 160% at 100% 0%, var(--wd-tint) 0%, transparent 55%),
|
|
||||||
var(--wd-card);
|
|
||||||
}
|
|
||||||
@media (min-width: 640px) {
|
|
||||||
.wd-reco {
|
|
||||||
padding: 24px 28px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
.wd-reco::before {
|
.wd-reco::before {
|
||||||
content: '';
|
content: '';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
inset: 0 auto 0 0;
|
inset: 0 auto 0 0;
|
||||||
width: 4px;
|
width: 4px;
|
||||||
background: linear-gradient(180deg, var(--wd-accent), var(--wd-accent-deep));
|
background: var(--wd-accent);
|
||||||
}
|
}
|
||||||
.wd-reco__row {
|
.wd-reco__row {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 18px;
|
gap: 16px;
|
||||||
}
|
}
|
||||||
@media (min-width: 768px) {
|
@media (min-width: 768px) {
|
||||||
.wd-reco__row {
|
.wd-reco__row {
|
||||||
@@ -192,7 +152,7 @@
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
width: 52px;
|
width: 52px;
|
||||||
height: 52px;
|
height: 52px;
|
||||||
border-radius: 14px;
|
border-radius: 10px;
|
||||||
border: 1px solid var(--wd-accent-line);
|
border: 1px solid var(--wd-accent-line);
|
||||||
background: var(--wd-tint-strong);
|
background: var(--wd-tint-strong);
|
||||||
color: var(--wd-accent-deep);
|
color: var(--wd-accent-deep);
|
||||||
@@ -233,7 +193,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 10px;
|
gap: 8px;
|
||||||
}
|
}
|
||||||
@media (min-width: 768px) {
|
@media (min-width: 768px) {
|
||||||
.wd-reco__actions {
|
.wd-reco__actions {
|
||||||
@@ -247,7 +207,7 @@
|
|||||||
.wd-features {
|
.wd-features {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: minmax(0, 1fr);
|
grid-template-columns: minmax(0, 1fr);
|
||||||
gap: 12px;
|
gap: 16px;
|
||||||
}
|
}
|
||||||
@media (min-width: 640px) {
|
@media (min-width: 640px) {
|
||||||
.wd-features {
|
.wd-features {
|
||||||
@@ -273,14 +233,6 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
padding: 14px 16px;
|
padding: 14px 16px;
|
||||||
transition:
|
|
||||||
transform 0.18s ease,
|
|
||||||
box-shadow 0.18s ease;
|
|
||||||
}
|
|
||||||
.wd-feature:hover {
|
|
||||||
transform: translateY(-2px);
|
|
||||||
box-shadow: 0 8px 24px -12px
|
|
||||||
color-mix(in srgb, var(--ui-color-primary) 45%, transparent);
|
|
||||||
}
|
}
|
||||||
.wd-feature__icon {
|
.wd-feature__icon {
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
@@ -317,8 +269,8 @@
|
|||||||
}
|
}
|
||||||
.wd-section-head h2 {
|
.wd-section-head h2 {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-size: 16px;
|
font-size: 15px;
|
||||||
font-weight: 700;
|
font-weight: 600;
|
||||||
letter-spacing: -0.01em;
|
letter-spacing: -0.01em;
|
||||||
color: var(--wd-ink);
|
color: var(--wd-ink);
|
||||||
}
|
}
|
||||||
@@ -384,7 +336,9 @@
|
|||||||
gap: 12px;
|
gap: 12px;
|
||||||
padding: 12px 16px;
|
padding: 12px 16px;
|
||||||
border-bottom: 1px solid var(--wd-line);
|
border-bottom: 1px solid var(--wd-line);
|
||||||
transition: background 0.15s ease;
|
}
|
||||||
|
.wd-file > .ant-btn {
|
||||||
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
.wd-file:last-child {
|
.wd-file:last-child {
|
||||||
border-bottom: 0;
|
border-bottom: 0;
|
||||||
@@ -403,10 +357,18 @@
|
|||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 6px;
|
gap: 6px;
|
||||||
font-size: 13px;
|
font-size: 14px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: var(--wd-ink);
|
color: var(--wd-ink);
|
||||||
}
|
}
|
||||||
|
.wd-file__title .ant-tag {
|
||||||
|
margin-inline-end: 0;
|
||||||
|
}
|
||||||
|
.wd-recommended-tag.ant-tag {
|
||||||
|
color: var(--wd-accent);
|
||||||
|
background: var(--wd-tint);
|
||||||
|
border-color: var(--wd-accent-line);
|
||||||
|
}
|
||||||
.wd-file__meta {
|
.wd-file__meta {
|
||||||
display: block;
|
display: block;
|
||||||
margin-top: 2px;
|
margin-top: 2px;
|
||||||
@@ -443,8 +405,8 @@
|
|||||||
width: 28px;
|
width: 28px;
|
||||||
height: 28px;
|
height: 28px;
|
||||||
border-radius: 999px;
|
border-radius: 999px;
|
||||||
background: linear-gradient(135deg, var(--wd-accent), var(--wd-accent-deep));
|
background: var(--wd-tint-strong);
|
||||||
color: var(--ui-color-white, var(--surface-card));
|
color: var(--wd-accent);
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
font-variant-numeric: tabular-nums;
|
font-variant-numeric: tabular-nums;
|
||||||
@@ -478,7 +440,7 @@
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
width: 56px;
|
width: 56px;
|
||||||
height: 56px;
|
height: 56px;
|
||||||
border-radius: 16px;
|
border-radius: 12px;
|
||||||
background: var(--wd-tint);
|
background: var(--wd-tint);
|
||||||
color: var(--wd-accent-deep);
|
color: var(--wd-accent-deep);
|
||||||
margin-bottom: 4px;
|
margin-bottom: 4px;
|
||||||
@@ -523,7 +485,17 @@
|
|||||||
|
|
||||||
.weyai-download button:focus-visible,
|
.weyai-download button:focus-visible,
|
||||||
.weyai-download a:focus-visible {
|
.weyai-download a:focus-visible {
|
||||||
outline: 2px solid
|
outline: 2px solid var(--wd-focus);
|
||||||
color-mix(in srgb, var(--ui-color-primary) 55%, transparent);
|
|
||||||
outline-offset: 2px;
|
outline-offset: 2px;
|
||||||
}
|
}
|
||||||
|
@media (prefers-reduced-motion: reduce) {
|
||||||
|
.weyai-download .ant-btn,
|
||||||
|
.weyai-download .wd-skeleton .ant-skeleton.ant-skeleton-active *,
|
||||||
|
.weyai-download *,
|
||||||
|
.weyai-download *::before,
|
||||||
|
.weyai-download *::after {
|
||||||
|
animation: none;
|
||||||
|
transition: none;
|
||||||
|
scroll-behavior: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user