Stroop.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916
  1. <script lang="ts" setup>
  2. import { onMounted, onUnmounted, ref } from 'vue'
  3. import CpdmTask from '../components/CpdmTask.vue'
  4. import CpdmMessage from '../components/CpdmMessage.vue'
  5. import { useRoute, useRouter } from 'vue-router';
  6. import { userInfoStore } from '@/stores'
  7. import { getCurrentTimeApi, querySelectTaskApi, saveStroopApi } from '@/api/plan';
  8. import { userPlanDetailApi } from '@/api/home';
  9. import { getUnread, planNumGet } from '@/utils/test';
  10. import { ElMessage } from 'element-plus';
  11. const cpdmTask = ref<any>()
  12. const route = useRoute()
  13. const router = useRouter()
  14. //获取个人信息
  15. const userInfo = userInfoStore()
  16. const testFlag = ref<boolean>(true)
  17. const planId = ref<string>('');
  18. const planName = ref<string>('');
  19. const flag = ref<string>('');
  20. const flagName = ref<string>('');
  21. //是否是练习测试
  22. const formalTest = ref<string>('')
  23. //测试总轮数
  24. const allCount = ref<number>(20)
  25. //数据列表
  26. const list = ref<any>({
  27. })
  28. //是否显示倒计时
  29. const timingShow = ref<boolean>(false)
  30. //倒计时字段
  31. const countDownStr = ref<string>('开始测试')
  32. //倒计时计时器1
  33. const time1 = ref<any>()
  34. //倒计时计时器2
  35. const time2 = ref<any>()
  36. //倒计时计时器3
  37. const time3 = ref<any>()
  38. const addFlag = ref<boolean>(false)
  39. //
  40. const fontFlag = ref<boolean>(false)
  41. //计时器
  42. const timeNum1 = ref<number>(5)
  43. //开始测试 测试到第几轮的标志
  44. const numberFlag = ref<number>(0)
  45. const numberFlagTem = ref<number>(0)
  46. //保存数据的格式
  47. const recordResult = ref<any>([])
  48. const startTime1 = ref<any>()
  49. const cpdmMe = ref<any>()
  50. const saveStart = ref<boolean>(false)
  51. const responseFlag = ref<boolean>(false)
  52. onMounted(() => {
  53. //接收参数
  54. planId.value = route.params.planId as string;
  55. planName.value = route.params.planName as string;
  56. flag.value = route.params.flag as string
  57. flagName.value = route.params.flagName as string
  58. formalTest.value = route.params.formalTest as string
  59. //组合数据后
  60. if (formalTest.value == '0') {
  61. allCount.value = 20
  62. } else {
  63. allCount.value = 90
  64. }
  65. formatterData();
  66. //开始随机数据进行
  67. //开始显示倒计时
  68. countdown()
  69. //监听电脑按键
  70. // document.addEventListener("keydown", listenFun)
  71. getStartTime()
  72. })
  73. const getStartTime = async () => {
  74. let res: any = await getCurrentTimeApi();
  75. // let date = new Date()
  76. startTime1.value = res.data;
  77. // startTime.value = format(date, "yyyy-MM-dd HH:mm:ss");
  78. }
  79. const listenFun = (e: any) => {
  80. if (list.value.length > 0 && !timingShow.value && !addFlag.value) {
  81. if (e.key == 'f') {
  82. clickColor(e.key)
  83. }
  84. if (e.key == 'g') {
  85. clickColor(e.key)
  86. }
  87. if (e.key == 'h') {
  88. clickColor(e.key)
  89. }
  90. if (e.key == 'j') {
  91. clickColor(e.key)
  92. }
  93. }
  94. }
  95. onUnmounted(() => {
  96. //点击测试
  97. clearInterval(time1.value)
  98. clearTimeout(time2.value)
  99. clearTimeout(time3.value)
  100. document.removeEventListener("keydown", listenFun)
  101. })
  102. const countdown = () => {
  103. // countDownStr.value = '开始测试'
  104. timingShow.value = true;
  105. time1.value = setInterval(() => {
  106. if (timeNum1.value == 0) {
  107. countDownStr.value = `开始`;
  108. //当等于0的时候
  109. //开始调用开始数据
  110. setTimeout(() => {
  111. timingShow.value = false;
  112. //调用开始方法
  113. startFun()
  114. }, 1000);
  115. if (time1.value) clearInterval(time1.value);
  116. } else {
  117. countDownStr.value = `${timeNum1.value}`;
  118. //时间倒计时计数器
  119. timeNum1.value--
  120. }
  121. //倒计时
  122. }, 1000)
  123. }
  124. //开始测试方法
  125. const startFun = () => {
  126. fontFlag.value = true;
  127. showFont()
  128. }
  129. //开始显示变颜色的文字
  130. const currentDate = ref<any>()
  131. const showFont = () => {
  132. currentDate.value = new Date().getTime()
  133. time2.value = setTimeout(() => {
  134. clickColor('none')
  135. //开始调用方法
  136. }, formalTest.value == '0' ? 2000000 : 2000);
  137. //
  138. if (formalTest.value == '0') {
  139. if (list.value[numberFlag.value].color == 'red') {
  140. needColor.value = '红色'
  141. needJ.value = '1'
  142. } else if (list.value[numberFlag.value].color == 'yellow') {
  143. needColor.value = '黄色'
  144. needJ.value = '2'
  145. } else if (list.value[numberFlag.value].color == 'blue') {
  146. needColor.value = '蓝色'
  147. needJ.value = '3'
  148. } else if (list.value[numberFlag.value].color == 'green') {
  149. needColor.value = '绿色'
  150. needJ.value = '4'
  151. }
  152. }
  153. }
  154. //开始显示 + 号
  155. const showAdd = () => {
  156. addFlag.value = true;
  157. time3.value = setTimeout(() => {
  158. addFlag.value = false;
  159. clearInterval(time3.value)
  160. showFont()
  161. }, 2000)
  162. }
  163. //出现的颜色
  164. const needColor = ref<string>('')
  165. //出现需要按下的按键
  166. const needJ = ref<string>('')
  167. const isCom = ref<boolean>(false)
  168. //调用当前方法
  169. const clickColor = async (val: string) => {
  170. if (saveStart.value) {
  171. return
  172. }
  173. let useTime = 0
  174. //
  175. if (val == 'none') {
  176. useTime = 2000
  177. } else {
  178. // 当主动点击的时候
  179. let tt = new Date().getTime()
  180. useTime = tt - currentDate.value
  181. //清空文件
  182. clearTimeout(time2.value)
  183. }
  184. //当数是19时----就去保存了
  185. //修改文件
  186. responseFlag.value = false
  187. let currentP = false
  188. if (list.value[numberFlag.value].color == 'red') {
  189. needColor.value = '红色'
  190. needJ.value = '1'
  191. if (val == '1') {
  192. responseFlag.value = true
  193. currentP = true
  194. }
  195. } else if (list.value[numberFlag.value].color == 'yellow') {
  196. needColor.value = '黄色'
  197. needJ.value = '2'
  198. if (val == '2') {
  199. responseFlag.value = true
  200. currentP = true
  201. }
  202. } else if (list.value[numberFlag.value].color == 'blue') {
  203. needColor.value = '蓝色'
  204. needJ.value = '3'
  205. if (val == '3') {
  206. responseFlag.value = true
  207. currentP = true
  208. }
  209. } else if (list.value[numberFlag.value].color == 'green') {
  210. needColor.value = '绿色'
  211. needJ.value = '4'
  212. if (val == '4') {
  213. responseFlag.value = true
  214. currentP = true
  215. }
  216. }
  217. timeFun()
  218. let obj = {
  219. //按键
  220. key: val,
  221. //反应时长
  222. duration: useTime,
  223. //是否超时 --超时算是错误的
  224. isTimeOut: useTime > 1500 ? true : false,
  225. //颜色和按键是否是对上了
  226. isColorCorrent: currentP,
  227. //出现的选项
  228. showOptions: JSON.parse(JSON.stringify(list.value[numberFlag.value])),
  229. //已选的选项
  230. }
  231. //测试结果的集合
  232. recordResult.value.push(obj)
  233. //修改文本
  234. //88
  235. if (numberFlag.value < allCount.value - 1) {
  236. showAdd()
  237. numberFlag.value++
  238. numberFlagTem.value++
  239. } else {
  240. // numberFlagTem.value++
  241. //开始保存了
  242. saveStart.value = true
  243. //开始调用-----
  244. //判断是测试还是正式测试
  245. if (formalTest.value == '0') {
  246. //判断测试是否通过
  247. //如果正确率大于80% 就跳转到
  248. //如果是测试计划的话
  249. let count = 0;
  250. for (let i = 0; i < recordResult.value.length; i++) {
  251. // recordResult.value[i].isColorCorrent =
  252. if (recordResult.value[i].isColorCorrent) {
  253. count++
  254. }
  255. }
  256. let score = parseInt(((count / recordResult.value.length) * 100).toFixed(2));
  257. // ElMessage({
  258. // type: 'info',
  259. // //正确率
  260. // message: `正确率为${score}%`
  261. // })
  262. if (score >= 60) {
  263. ElMessage({
  264. type: 'success',
  265. //正确率
  266. message: `正确率为${score}%`
  267. })
  268. //正确率大于60 时
  269. //设置通过的标志
  270. userInfo.saveIspass(flag.value)
  271. setTimeout(() => {
  272. router.go(-1)
  273. }, 1000)
  274. } else {
  275. ElMessage({
  276. type: 'info',
  277. //正确率
  278. message: `正确率为${score}%`
  279. })
  280. setTimeout(() => {
  281. router.go(-1)
  282. }, 1000)
  283. }
  284. } else {
  285. let testResult = {
  286. totalScore: '',
  287. }
  288. let count = 0
  289. for (let i = 0; i < recordResult.value.length; i++) {
  290. if (!recordResult.value[i].isTimeOut) {
  291. count++
  292. }
  293. }
  294. testResult.totalScore = (count / allCount.value * 100).toFixed(2)
  295. let params = {
  296. beginTime: startTime1.value,
  297. orgName: userInfo.userInfo.orgName,
  298. orgNo: userInfo.userInfo.orgNo,
  299. planId: planId.value,
  300. planName: planName.value,
  301. taskFlag: flag.value,
  302. taskName: flagName.value,
  303. // testRecord: JSON.stringify(productData()),
  304. testRecord: JSON.stringify(recordResult.value),
  305. testResult: JSON.stringify(testResult),
  306. type: '1',
  307. userName: userInfo.userInfo.userName,
  308. userNo: userInfo.userInfo.userNo,
  309. }
  310. let res: any = await saveStroopApi(params)
  311. if (res.code == 200) {
  312. let paramsCu = {
  313. planId: planId.value,
  314. userNo: userInfo.userInfo.userNo
  315. }
  316. let temp: any = await userPlanDetailApi(paramsCu)
  317. let listT = temp.data;
  318. let listP = []
  319. listP = listT.filter((item: any) => {
  320. return item.isCompleted == '0' && item.contentType == '1'
  321. })
  322. //等--认知任务如果有未测试的话--需要跳转到测试计划页面
  323. //否则--跳转到测试计划页面
  324. if (listP.length > 0) {
  325. router.push({ name: 'plan' })
  326. } else {
  327. let res: any = await querySelectTaskApi(planId.value)
  328. if (res.data.length == 0) {
  329. cpdmMe.value.open()
  330. planNumGet()
  331. getUnread()
  332. } else {
  333. cpdmTask.value.open(planId.value)
  334. }
  335. }
  336. } else {
  337. ElMessage({
  338. type: 'error',
  339. message: res.msg
  340. })
  341. }
  342. }
  343. //-----------------------------------
  344. //开始保存方法--保存成功后判断
  345. }
  346. }
  347. const errorTime = ref<any>();
  348. const timeFun = () => {
  349. isCom.value = true
  350. errorTime.value = setTimeout(() => {
  351. isCom.value = false
  352. }, 500)
  353. }
  354. //组合数据
  355. const formatterData = () => {
  356. const listGrouop = [
  357. { type: 'depressed', name: '沮丧' },
  358. { type: 'depressed', name: '哀伤' },
  359. { type: 'depressed', name: '绝望' },
  360. { type: 'depressed', name: '忧郁' },
  361. { type: 'depressed', name: '孤寂' },
  362. { type: 'depressed', name: '沉重' },
  363. { type: 'depressed', name: '压抑' },
  364. { type: 'depressed', name: '焦虑' },
  365. { type: 'depressed', name: '落寞' },
  366. { type: 'depressed', name: '悲观' },
  367. { type: 'depressed', name: '愁苦' },
  368. { type: 'depressed', name: '无力' },
  369. { type: 'depressed', name: '低落' },
  370. { type: 'depressed', name: '迷惘' },
  371. { type: 'depressed', name: '消沉' },
  372. { type: 'depressed', name: '灰心' },
  373. { type: 'depressed', name: '苦楚' },
  374. { type: 'depressed', name: '厌世' },
  375. { type: 'depressed', name: '冷漠' },
  376. { type: 'depressed', name: '苦楚' },
  377. { type: 'anxiety', name: '紧张' },
  378. { type: 'anxiety', name: '不安' },
  379. { type: 'anxiety', name: '恐慌' },
  380. { type: 'anxiety', name: '担忧' },
  381. { type: 'anxiety', name: '烦躁' },
  382. { type: 'anxiety', name: '急躁' },
  383. { type: 'anxiety', name: '易怒' },
  384. { type: 'anxiety', name: '焦虑' },
  385. { type: 'anxiety', name: '心悸' },
  386. { type: 'anxiety', name: '忐忑' },
  387. { type: 'anxiety', name: '惊悸' },
  388. { type: 'anxiety', name: '紧迫感' },
  389. { type: 'anxiety', name: '压力' },
  390. { type: 'anxiety', name: '忧虑' },
  391. { type: 'anxiety', name: '惊惧' },
  392. { type: 'anxiety', name: '惶恐' },
  393. { type: 'anxiety', name: '恐惧' },
  394. { type: 'anxiety', name: '惊慌' },
  395. { type: 'anxiety', name: '畏惧' },
  396. { type: 'anxiety', name: '忧烦' },
  397. { type: 'neutral', name: '天空' },
  398. { type: 'neutral', name: '大地' },
  399. { type: 'neutral', name: '河流' },
  400. { type: 'neutral', name: '树木' },
  401. { type: 'neutral', name: '花朵' },
  402. { type: 'neutral', name: '阳光' },
  403. { type: 'neutral', name: '月亮' },
  404. { type: 'neutral', name: '星星' },
  405. { type: 'neutral', name: '山峰' },
  406. { type: 'neutral', name: '草原' },
  407. { type: 'neutral', name: '房屋' },
  408. { type: 'neutral', name: '道路' },
  409. { type: 'neutral', name: '书本' },
  410. { type: 'neutral', name: '笔记' },
  411. { type: 'neutral', name: '时间' },
  412. { type: 'neutral', name: '空间' },
  413. { type: 'neutral', name: '音乐' },
  414. { type: 'neutral', name: '电影' },
  415. { type: 'neutral', name: '旅行' },
  416. { type: 'neutral', name: '工作' },
  417. { type: 'neutral', name: '学习' },
  418. { type: 'neutral', name: '朋友' },
  419. { type: 'neutral', name: '家人' },
  420. { type: 'neutral', name: '生活' },
  421. { type: 'neutral', name: '动物' },
  422. { type: 'neutral', name: '植物' },
  423. { type: 'neutral', name: '季节' },
  424. { type: 'neutral', name: '天气' },
  425. { type: 'neutral', name: '日常' },
  426. { type: 'neutral', name: '平静' },
  427. ]
  428. let listNew = []
  429. // let colorList = ['红色', "黄色", "蓝色", "绿色"]
  430. let colorList = ['red', "yellow", "blue", "green"]
  431. for (let i = 0; i < listGrouop.length; i++) {
  432. for (let j = 0; j < colorList.length; j++) {
  433. let obj = {
  434. type: listGrouop[i].type,
  435. name: listGrouop[i].name,
  436. color: colorList[j]
  437. }
  438. listNew.push(obj)
  439. }
  440. }
  441. //随机数
  442. let listRandom = []
  443. for (let i = 0; i < allCount.value; i++) {
  444. let a = Math.floor(Math.random() * 280);
  445. listRandom.push(listNew[a])
  446. }
  447. // 修改文本
  448. // let listRandon =[]
  449. // for(let i=0;i<listNew.length;i++){
  450. // }
  451. //将组合好的数据
  452. list.value = listRandom;
  453. //长度280
  454. }
  455. const buttonList = ref<any>([
  456. { name: '1', val: '1' },
  457. { name: '2', val: '2' },
  458. { name: '3', val: '3' },
  459. { name: '4', val: '4' }
  460. ]);
  461. </script>
  462. <template>
  463. <div class="activeTask">
  464. <div style="width: 50%; margin-left: 10%; margin-top: 24px; z-index: 1000">
  465. <el-progress class="main_progress" color="linear-gradient(to right, hwb(17 58% 9%), #99ebee)"
  466. :text-inside="true" :stroke-width="48" :percentage="((numberFlagTem + 1) / (allCount)) * 100">
  467. <span style="color: #000;font-size: 20px;">{{ numberFlagTem + 1 }}/{{ allCount }}</span>
  468. </el-progress>
  469. </div>
  470. <p class="correct_txt" v-show="formalTest == '0' && isCom">
  471. <img src="../assets/cognize/correct.png" alt="" v-show="responseFlag">
  472. <img src="../assets/cognize/wrong.png" v-show="!responseFlag" alt=""><span></span>
  473. </p>
  474. <p v-if="timingShow" class="timingBox">{{ countDownStr }}</p>
  475. <div v-if="list.length > 0 && !timingShow" class="timingBox">
  476. <div v-if="(formalTest == '0' && numberFlag <= 19 && !addFlag) || (formalTest == '1' && numberFlag <= 89 && !addFlag)"
  477. :style="{ color: list[numberFlag].color }">{{
  478. list[numberFlag].name }}</div>
  479. </div>
  480. <div v-if="addFlag" style="text-align: center" class="timingBox">
  481. <img src="../assets/cognize/whiteFlag-new.png" alt="" style="width: 50px; height: 50px; margin-top: 20%" />
  482. </div>
  483. <!-- <div class="tip_cla" v-show="!timingShow && formalTest == '0' && !addFlag">
  484. 当前颜色为<span class="font_sub_one sbclass">{{ needColor }}</span>,请按下 <span class="font_sub_two sbclass">{{
  485. needJ }}</span>按钮
  486. </div> -->
  487. <div style="margin-top:20px" class="tip_claFun btn-content" v-show="list.length > 0 && !timingShow && !addFlag">
  488. <el-button @click="clickColor('1')">1</el-button>
  489. <el-button @click="clickColor('2')">2</el-button>
  490. <el-button @click="clickColor('3')">3</el-button>
  491. <el-button @click="clickColor('4')">4</el-button>
  492. </div>
  493. </div>
  494. <div class="activeTaskTest" v-show="formalTest == '0'">
  495. <div style="width: 50%; margin-left: 10%; margin-top: 24px; z-index: 1000">
  496. <el-progress class="main_progress" color="linear-gradient(to right, hwb(17 58% 9%), #99ebee)"
  497. :text-inside="true" :stroke-width="48" :percentage="((numberFlagTem + 1) / (allCount)) * 100">
  498. <span style="color: #000;font-size: 20px;">{{ numberFlagTem + 1 }}/{{ allCount }}</span>
  499. </el-progress>
  500. </div>
  501. <p class="correct_txt" v-show="formalTest == '0' && isCom">
  502. <img src="../assets/cognize/correct.png" alt="" v-show="responseFlag">
  503. <img src="../assets/cognize/wrong.png" v-show="!responseFlag" alt=""><span></span>
  504. </p>
  505. <p v-if="timingShow" class="timingBox">{{ countDownStr }}</p>
  506. <div v-if="list.length > 0 && !timingShow" class="timingBox">
  507. <div v-if="(formalTest == '0' && numberFlag <= 19 && !addFlag) || (formalTest == '1' && numberFlag <= 89 && !addFlag)"
  508. :style="{ color: list[numberFlag].color }">{{
  509. list[numberFlag].name }}</div>
  510. </div>
  511. <div v-if="addFlag" style="text-align: center" class="timingBox">
  512. <img src="../assets/cognize/whiteFlag-new.png" alt="" style="width: 50px; height: 50px; margin-top: 20%" />
  513. </div>
  514. <!-- <div class="tip_cla" v-show="!timingShow && formalTest == '0' && !addFlag">
  515. 当前颜色为<span class="font_sub_one sbclass">{{ needColor }}</span>,请按下 <span class="font_sub_two sbclass">{{
  516. needJ }}</span>按钮
  517. </div> -->
  518. <div class="tip_cla" v-show="!timingShow && formalTest == '0' && !addFlag">
  519. 1:代表红色 2:代表黄色 3:代表蓝色 4:代表绿色
  520. </div>
  521. <!-- <div class="tip_cla" v-show="!timingShow && formalTest == '0' && !addFlag">
  522. 当前颜色为<span class="font_sub_one sbclass">{{ needColor }}</span>,请按下 <span class="font_sub_two sbclass">{{
  523. needJ }}</span>按钮
  524. </div> -->
  525. <div style="margin-top:20px" class="tip_claFun btn-content" v-show="list.length > 0 && !timingShow && !addFlag">
  526. <el-button v-for="item in buttonList" :key="item.name" :class="{ active: item.name == needJ }"
  527. @click="clickColor(item.val)">{{ item.name }}</el-button>
  528. <!-- <el-button @click="clickColor('f')">F</el-button>
  529. <el-button @click="clickColor('g')">G</el-button>
  530. <el-button @click="clickColor('h')">H</el-button>
  531. <el-button @click="clickColor('j')">J</el-button> -->
  532. </div>
  533. </div>
  534. <CpdmMessage ref="cpdmMe" />
  535. <CpdmTask ref="cpdmTask" />
  536. </template>
  537. <style lang="scss" scoped>
  538. .sbclass {
  539. animation-duration: 1s;
  540. animation-name: slidein;
  541. animation-iteration-count: infinite;
  542. animation-direction: alternate;
  543. }
  544. @keyframes slidein {
  545. from {
  546. /* margin-left: 100%; */
  547. /* width: 300%; */
  548. font-size: 20px;
  549. }
  550. to {
  551. /* margin-left: 0%;
  552. width: 100%; */
  553. font-size: 30px;
  554. }
  555. }
  556. .font_sub_one {
  557. font-size: 35px;
  558. font-weight: 700;
  559. }
  560. .font_sub_two {
  561. font-size: 35px;
  562. font-weight: 700;
  563. }
  564. .butt {
  565. width: 100px;
  566. text-align: center;
  567. border: 1px solid rgb(87, 172, 187);
  568. opacity: 1;
  569. border-radius: 10px;
  570. }
  571. .bgAdd {
  572. width: 150px;
  573. height: 400px;
  574. background: url("../assets/cognize/whiteFlag-new.png") no-repeat center;
  575. position: absolute;
  576. top: 25%;
  577. left: 50%;
  578. margin-left: -75px;
  579. }
  580. // .activeTask {
  581. // width: 100%;
  582. // height: 100%;
  583. // background: url("../assets/cognize/rememberAbilityTask.png") no-repeat center;
  584. // background-size: cover;
  585. // position: fixed;
  586. // top: 0;
  587. // left: 0;
  588. // right: 0;
  589. // bottom: 0;
  590. // background-color: #000000
  591. // }
  592. .timingBox {
  593. font-size: 50px;
  594. font-weight: 700;
  595. position: absolute;
  596. top: 50%;
  597. left: 50%;
  598. transform: translate(-50%, -50%);
  599. color: black;
  600. // font-size: 70px;
  601. text-align: center;
  602. line-height: 100px;
  603. margin: 0 auto;
  604. z-index: 10;
  605. }
  606. /* .active-img {
  607. position: absolute;
  608. width: 450px;
  609. height: 450px;
  610. top: 50%;
  611. left: 50%;
  612. transform: translate(-50%, -50%);
  613. z-index: 10;
  614. } */
  615. .btn-content {
  616. position: absolute;
  617. width: 60%;
  618. left: 50%;
  619. bottom: 150px;
  620. transform: translate(-50%, 0);
  621. text-align: center;
  622. z-index: 1000;
  623. }
  624. .scaleName {
  625. margin-top: 70px;
  626. background-size: cover;
  627. }
  628. .scaleButton {
  629. margin-top: 20px;
  630. margin-bottom: 20px;
  631. background-size: cover;
  632. background: rgb(87, 172, 187);
  633. border: 2px solid rgb(255, 255, 255);
  634. box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
  635. opacity: 1;
  636. border-radius: 39px;
  637. color: #ffffff;
  638. }
  639. .steering {
  640. width: 50%;
  641. position: absolute;
  642. bottom: 20%;
  643. left: 50%;
  644. transform: translateX(-50%);
  645. display: flex;
  646. justify-content: space-between;
  647. }
  648. .steering .left {
  649. width: 60px;
  650. height: 60px;
  651. background: url(../../assets/left.png) no-repeat center;
  652. }
  653. .steering .right {
  654. width: 60px;
  655. height: 60px;
  656. background: url(../../assets/right.png) no-repeat center;
  657. margin-left: 15px;
  658. }
  659. .guider {
  660. position: absolute;
  661. top: 0;
  662. bottom: 0;
  663. left: 0;
  664. right: 0;
  665. z-index: 999;
  666. background: rgba(0, 0, 0, 0.75);
  667. }
  668. .addImg {
  669. width: 50%;
  670. height: auto;
  671. z-index: 1000;
  672. }
  673. .shape_glass {
  674. display: flex;
  675. justify-content: center;
  676. align-items: center;
  677. width: 50%;
  678. height: auto;
  679. margin: 5vh auto 0;
  680. }
  681. .active {
  682. position: relative;
  683. }
  684. .active:after {
  685. background-color: #2ea598;
  686. }
  687. /* 设置动画后颜色 */
  688. .active:before {
  689. background-color: rgba(0, 168, 253, 0.2);
  690. }
  691. /* 设置动画 */
  692. .active:before,
  693. .active:after {
  694. content: "";
  695. width: 40px;
  696. height: 40px;
  697. position: absolute;
  698. left: 50%;
  699. top: 50%;
  700. margin-left: -20px;
  701. margin-top: -20px;
  702. border-radius: 10%;
  703. animation: warn 1.5s ease-out 0s infinite;
  704. }
  705. @keyframes warn {
  706. 0% {
  707. transform: scale(0.5);
  708. opacity: 1;
  709. }
  710. 30% {
  711. opacity: 1;
  712. }
  713. 100% {
  714. transform: scale(1.4);
  715. opacity: 0;
  716. }
  717. }
  718. .txt {
  719. width: 300px;
  720. font-weight: PingFang-SC-Medium;
  721. margin: 0 auto;
  722. font-size: 16px;
  723. color: #ffffff;
  724. position: absolute;
  725. left: 50%;
  726. top: 70%;
  727. transform: translateX(-50%);
  728. z-index: 1000;
  729. }
  730. .explain {
  731. padding: 6px 8px;
  732. border: 2px solid #0abdc4;
  733. border-radius: 5px;
  734. }
  735. .main_progress {
  736. padding-top: 40px;
  737. padding-left: 40px;
  738. color: linear-gradient(to right, #ebb19b, #99ebee);
  739. }
  740. .activeTask {
  741. width: 100%;
  742. height: 100%;
  743. background: url("../assets/cognize/Stroop.png") no-repeat center;
  744. background-size: cover;
  745. position: fixed;
  746. top: 0;
  747. left: 0;
  748. right: 0;
  749. bottom: 0;
  750. }
  751. .activeTaskTest {
  752. width: 100%;
  753. height: 100%;
  754. background-size: cover;
  755. position: fixed;
  756. top: 0;
  757. left: 0;
  758. right: 0;
  759. bottom: 0;
  760. background-color: #000000;
  761. opacity: 0.4;
  762. z-index: 200;
  763. }
  764. .correct_txt {
  765. position: absolute;
  766. left: 50%;
  767. transform: translateX(-50%);
  768. top: 100px;
  769. text-align: center;
  770. }
  771. .tip_cla {
  772. width: 200px;
  773. letter-spacing: 3px;
  774. position: absolute;
  775. left: 50%;
  776. transform: translateX(-50%);
  777. bottom: 200px;
  778. text-align: center;
  779. z-index: 1000;
  780. color: #ffffff;
  781. border: 2px solid rgb(47, 197, 165);
  782. overflow-y: hidden;
  783. }
  784. // .tip_claFun {
  785. // letter-spacing: 3px;
  786. // position: absolute;
  787. // left: 50%;
  788. // transform: translateX(-50%);
  789. // bottom: 150px;
  790. // text-align: center;
  791. // }</style>