constant.ts 4.0 KB
Newer Older
L
LeoKu 已提交
1
import type { AvatarOption, AvatarSettings } from '@/types'
L
LeoKu 已提交
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73

import {
  BeardShape,
  ClothesShape,
  EarringsShape,
  EarShape,
  EyebrowsShape,
  EyesShape,
  FaceShape,
  Gender,
  GlassesShape,
  MouthShape,
  NoseShape,
  TopsShape,
  WidgetType,
  WrapperShape,
} from '../enums'

export const AVATAR_LAYER: Readonly<{
  [key in `${WidgetType}`]: { zIndex: number }
}> = {
  [WidgetType.Face]: {
    zIndex: 10,
  },
  [WidgetType.Ear]: {
    zIndex: 102,
  },
  [WidgetType.Earrings]: {
    zIndex: 103,
  },
  [WidgetType.Eyebrows]: {
    zIndex: 70,
  },
  [WidgetType.Eyes]: {
    zIndex: 50,
  },
  [WidgetType.Nose]: {
    zIndex: 60,
  },
  [WidgetType.Glasses]: {
    zIndex: 90,
  },
  [WidgetType.Mouth]: {
    zIndex: 100,
  },
  [WidgetType.Beard]: {
    zIndex: 105,
  },
  [WidgetType.Tops]: {
    zIndex: 80,
  },
  [WidgetType.Clothes]: {
    zIndex: 110,
  },
}

export const SETTINGS: Readonly<AvatarSettings> = {
  gender: [Gender.Male, Gender.Female],

  wrapperShape: Object.values(WrapperShape),
  faceShape: Object.values(FaceShape),
  topsShape: Object.values(TopsShape),
  earShape: Object.values(EarShape),
  earringsShape: Object.values(EarringsShape),
  eyebrowsShape: Object.values(EyebrowsShape),
  eyesShape: Object.values(EyesShape),
  noseShape: Object.values(NoseShape),
  glassesShape: Object.values(GlassesShape),
  mouthShape: Object.values(MouthShape),
  beardShape: Object.values(BeardShape),
  clothesShape: Object.values(ClothesShape),

L
LeoKu 已提交
74
  commonColors: [
L
LeoKu 已提交
75 76 77 78 79 80 81 82 83
    '#6BD9E9',
    '#FC909F',
    '#F4D150',
    '#E0DDFF',
    '#D2EFF3',
    '#FFEDEF',
    '#FFEBA4',
    '#506AF4',
    '#F48150',
L
LeoKu 已提交
84 85 86
    '#48A99A',
    '#C09FFF',
    '#FD6F5D',
L
LeoKu 已提交
87
  ],
L
LeoKu 已提交
88

L
LeoKu 已提交
89
  skinColors: ['#F8D9CE', '#F9C9B6', '#DEB3A3', '#C89583', '#9C6458'],
L
LeoKu 已提交
90

L
LeoKu 已提交
91 92 93 94 95 96 97 98 99 100 101
  get backgroundColor() {
    return [
      ...this.commonColors,
      'linear-gradient(45deg, #E3648C, #D97567)',
      'linear-gradient(62deg, #8EC5FC, #E0C3FC)',
      'linear-gradient(90deg, #ffecd2, #fcb69f)',
      'linear-gradient(120deg, #a1c4fd, #c2e9fb)',
      'linear-gradient(-135deg, #fccb90, #d57eeb)',
      'transparent',
    ]
  },
L
LeoKu 已提交
102 103 104 105 106 107 108 109 110 111
}

export const SCREEN = {
  lg: 976,
} as const

export const NONE = 'none'

export const TRIGGER_PROBABILITY = 0.1

L
LeoKu 已提交
112
export const SPECIAL_AVATARS: Readonly<AvatarOption[]> = [
L
LeoKu 已提交
113 114 115
  {
    wrapperShape: 'squircle',
    background: {
L
LeoKu 已提交
116
      color: 'linear-gradient(62deg, #8EC5FC, #E0C3FC)',
L
LeoKu 已提交
117 118 119 120
    },
    widgets: {
      face: {
        shape: FaceShape.Base,
L
LeoKu 已提交
121
        fillColor: '#F9C9B6',
L
LeoKu 已提交
122 123 124
      },
      tops: {
        shape: TopsShape.Pixie,
L
LeoKu 已提交
125
        fillColor: '#d2eff3',
L
LeoKu 已提交
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152
      },
      ear: {
        shape: EarShape.Attached,
      },
      earrings: {
        shape: EarringsShape.Stud,
      },
      eyebrows: {
        shape: EyebrowsShape.Up,
      },
      eyes: {
        shape: EyesShape.Eyeshadow,
      },
      nose: {
        shape: NoseShape.Pointed,
      },
      glasses: {
        shape: NONE,
      },
      mouth: {
        shape: MouthShape.Laughing,
      },
      beard: {
        shape: NONE,
      },
      clothes: {
        shape: ClothesShape.Crew,
L
LeoKu 已提交
153
        fillColor: '#e0ddff',
L
LeoKu 已提交
154 155 156 157 158 159
      },
    },
  },
  {
    wrapperShape: 'squircle',
    background: {
L
LeoKu 已提交
160
      color: '#fd6f5d',
L
LeoKu 已提交
161 162 163 164
    },
    widgets: {
      face: {
        shape: FaceShape.Base,
L
LeoKu 已提交
165
        fillColor: '#F9C9B6',
L
LeoKu 已提交
166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195
      },
      tops: {
        shape: TopsShape.Clean,
      },
      ear: {
        shape: EarShape.Attached,
      },
      earrings: {
        shape: NONE,
      },
      eyebrows: {
        shape: EyebrowsShape.Eyelashesdown,
      },
      eyes: {
        shape: EyesShape.Round,
      },
      nose: {
        shape: NoseShape.Round,
      },
      glasses: {
        shape: NONE,
      },
      mouth: {
        shape: MouthShape.Surprised,
      },
      beard: {
        shape: NONE,
      },
      clothes: {
        shape: ClothesShape.Crew,
L
LeoKu 已提交
196
        fillColor: '#f4d150',
L
LeoKu 已提交
197 198 199 200 201 202 203 204 205 206 207 208 209
      },
    },
  },
]

export const NOT_COMPATIBLE_AGENTS = [
  'quark',
  'micromessenger',
  'weibo',
  'douban',
] as const

export const DOWNLOAD_DELAY = 800