feat:2.6.1增加 数物对应 和 根据颜色画图形
This commit is contained in:
@@ -127,6 +127,28 @@ export function getRandomNumberColor(): string {
|
||||
return colors[Math.floor(Math.random() * colors.length)];
|
||||
}
|
||||
|
||||
/**
|
||||
* 从 NUMBER_COLORS 中随机获取指定数量的不重复颜色
|
||||
* @param count 需要获取的颜色数量
|
||||
* @returns 不重复的颜色数组
|
||||
*/
|
||||
export function getRandomUniqueNumberColors(count: number): string[] {
|
||||
const allColors = getNumberColors();
|
||||
if (count >= allColors.length) {
|
||||
// 如果需要的数量大于等于总数,返回打乱后的所有颜色
|
||||
return [...allColors].sort(() => Math.random() - 0.5);
|
||||
}
|
||||
|
||||
// 使用 Set 确保不重复
|
||||
const selectedColors = new Set<string>();
|
||||
while (selectedColors.size < count) {
|
||||
const randomIndex = Math.floor(Math.random() * allColors.length);
|
||||
selectedColors.add(allColors[randomIndex]);
|
||||
}
|
||||
|
||||
return Array.from(selectedColors);
|
||||
}
|
||||
|
||||
export const PAPER_SIZE = {
|
||||
A4: {
|
||||
// width: 2480,
|
||||
|
||||
@@ -9,14 +9,14 @@ export interface FocusFunctionType {
|
||||
}
|
||||
|
||||
export const FOCUS_FUNCTION_TYPES: FocusFunctionType[] = [
|
||||
// 形状识别
|
||||
// 根据颜色画图形
|
||||
{
|
||||
id: 'shape-recognition',
|
||||
page: 'shape',
|
||||
title: '识别形状',
|
||||
desc: '识别形状,涂一涂',
|
||||
icon: '🔍',
|
||||
img: '/assets/focusEntrance/shape-recognition.png',
|
||||
id: 'color-shape-match',
|
||||
page: 'colorShapeMatch',
|
||||
title: '根据颜色画图形',
|
||||
desc: '根据颜色画出对应的图形',
|
||||
icon: '🎯',
|
||||
img: '/assets/focusEntrance/color-shape-match.png',
|
||||
},
|
||||
// 图形符号配对
|
||||
{
|
||||
@@ -27,6 +27,15 @@ export const FOCUS_FUNCTION_TYPES: FocusFunctionType[] = [
|
||||
icon: '🔗',
|
||||
img: '/assets/focusEntrance/shape-symbol.png',
|
||||
},
|
||||
// 形状识别
|
||||
{
|
||||
id: 'shape-recognition',
|
||||
page: 'shape',
|
||||
title: '识别形状',
|
||||
desc: '识别形状,涂一涂',
|
||||
icon: '🔍',
|
||||
img: '/assets/focusEntrance/shape-recognition.png',
|
||||
},
|
||||
// 方位涂涂乐
|
||||
{
|
||||
id: 'position-coloring',
|
||||
@@ -54,6 +63,7 @@ export const FOCUS_FUNCTION_TYPES: FocusFunctionType[] = [
|
||||
icon: '🔗',
|
||||
img: '/assets/focusEntrance/match-connect.png',
|
||||
},
|
||||
|
||||
// 线条识别
|
||||
{
|
||||
id: 'line-recognition',
|
||||
|
||||
@@ -42,6 +42,15 @@ export const MATH_FUNCTION_TYPES: MathFunctionType[] = [
|
||||
icon: '🔗',
|
||||
img: '/assets/mathEntrance/count-match.png',
|
||||
},
|
||||
// 数物对应
|
||||
{
|
||||
id: 'number-object-match',
|
||||
page: 'numberObjectMatch',
|
||||
title: '数物对应',
|
||||
desc: '连线相同数量的物品和数字',
|
||||
icon: '🔗',
|
||||
img: '/assets/mathEntrance/number-object-match.png',
|
||||
},
|
||||
{
|
||||
id: 'counting-select',
|
||||
page: 'countingSelect',
|
||||
|
||||
Reference in New Issue
Block a user