@magmamath/students-features 0.3.3 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (391) hide show
  1. package/dist/commonjs/features/celebrations/components/Celebrations.js +51 -0
  2. package/dist/commonjs/features/celebrations/components/Celebrations.js.map +1 -0
  3. package/dist/commonjs/features/celebrations/components/Particle.js +84 -0
  4. package/dist/commonjs/features/celebrations/components/Particle.js.map +1 -0
  5. package/dist/commonjs/features/celebrations/components/ParticleBatch.js +45 -0
  6. package/dist/commonjs/features/celebrations/components/ParticleBatch.js.map +1 -0
  7. package/dist/commonjs/features/celebrations/components/Spark.js +23 -0
  8. package/dist/commonjs/features/celebrations/components/Spark.js.map +1 -0
  9. package/dist/commonjs/features/celebrations/config.js +199 -0
  10. package/dist/commonjs/features/celebrations/config.js.map +1 -0
  11. package/dist/commonjs/features/celebrations/helpers.js +94 -0
  12. package/dist/commonjs/features/celebrations/helpers.js.map +1 -0
  13. package/dist/commonjs/features/celebrations/index.js +28 -0
  14. package/dist/commonjs/features/celebrations/index.js.map +1 -0
  15. package/dist/commonjs/features/celebrations/types.js +15 -0
  16. package/dist/commonjs/features/celebrations/types.js.map +1 -0
  17. package/dist/commonjs/features/endOfAssignment/components/CheatDetected/CheatDetected.js +58 -0
  18. package/dist/commonjs/features/endOfAssignment/components/CheatDetected/CheatDetected.js.map +1 -0
  19. package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.js +247 -0
  20. package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.js.map +1 -0
  21. package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js +131 -0
  22. package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js.map +1 -0
  23. package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswerSparks.js +56 -0
  24. package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswerSparks.js.map +1 -0
  25. package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/GoodDrawingSparks.js +68 -0
  26. package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/GoodDrawingSparks.js.map +1 -0
  27. package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/Spark.js +53 -0
  28. package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/Spark.js.map +1 -0
  29. package/dist/commonjs/features/endOfAssignment/components/EOAModal.js +47 -0
  30. package/dist/commonjs/features/endOfAssignment/components/EOAModal.js.map +1 -0
  31. package/dist/commonjs/features/endOfAssignment/components/ExamLeave/ExamLeave.js +69 -0
  32. package/dist/commonjs/features/endOfAssignment/components/ExamLeave/ExamLeave.js.map +1 -0
  33. package/dist/commonjs/features/endOfAssignment/components/ExamPaused/ExamPaused.js +55 -0
  34. package/dist/commonjs/features/endOfAssignment/components/ExamPaused/ExamPaused.js.map +1 -0
  35. package/dist/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmit.js +102 -0
  36. package/dist/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmit.js.map +1 -0
  37. package/dist/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmitContent.js +83 -0
  38. package/dist/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmitContent.js.map +1 -0
  39. package/dist/commonjs/features/endOfAssignment/components/ExamSubmit/blurred-card.png +0 -0
  40. package/dist/commonjs/features/endOfAssignment/components/Modal/Modal.js +96 -0
  41. package/dist/commonjs/features/endOfAssignment/components/Modal/Modal.js.map +1 -0
  42. package/dist/commonjs/features/endOfAssignment/components/Modal/ModalBackground.js +44 -0
  43. package/dist/commonjs/features/endOfAssignment/components/Modal/ModalBackground.js.map +1 -0
  44. package/dist/commonjs/features/endOfAssignment/components/Modal/assets/SunrisingIcon.js +233 -0
  45. package/dist/commonjs/features/endOfAssignment/components/Modal/assets/SunrisingIcon.js.map +1 -0
  46. package/dist/commonjs/features/endOfAssignment/components/Modal/assets/TrophyIcon.js +63 -0
  47. package/dist/commonjs/features/endOfAssignment/components/Modal/assets/TrophyIcon.js.map +1 -0
  48. package/dist/commonjs/features/endOfAssignment/components/Modal/model.js +34 -0
  49. package/dist/commonjs/features/endOfAssignment/components/Modal/model.js.map +1 -0
  50. package/dist/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswer.js +91 -0
  51. package/dist/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswer.js.map +1 -0
  52. package/dist/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswerContent.js +107 -0
  53. package/dist/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswerContent.js.map +1 -0
  54. package/dist/commonjs/features/endOfAssignment/constants.js +55 -0
  55. package/dist/commonjs/features/endOfAssignment/constants.js.map +1 -0
  56. package/dist/commonjs/features/endOfAssignment/helpers.js +64 -0
  57. package/dist/commonjs/features/endOfAssignment/helpers.js.map +1 -0
  58. package/dist/commonjs/features/endOfAssignment/hooks/useSparkAnimation.js +51 -0
  59. package/dist/commonjs/features/endOfAssignment/hooks/useSparkAnimation.js.map +1 -0
  60. package/dist/commonjs/features/endOfAssignment/index.js +40 -0
  61. package/dist/commonjs/features/endOfAssignment/index.js.map +1 -0
  62. package/dist/commonjs/features/endOfAssignment/model/model.js +53 -0
  63. package/dist/commonjs/features/endOfAssignment/model/model.js.map +1 -0
  64. package/dist/commonjs/features/endOfAssignment/types.js +33 -0
  65. package/dist/commonjs/features/endOfAssignment/types.js.map +1 -0
  66. package/dist/commonjs/features/endOfAssignment/ui/EOABadge.js +43 -0
  67. package/dist/commonjs/features/endOfAssignment/ui/EOABadge.js.map +1 -0
  68. package/dist/commonjs/features/endOfAssignment/ui/PracticeButton.js +30 -0
  69. package/dist/commonjs/features/endOfAssignment/ui/PracticeButton.js.map +1 -0
  70. package/dist/commonjs/features/endOfAssignment/ui/PracticeButtonGroup.js +65 -0
  71. package/dist/commonjs/features/endOfAssignment/ui/PracticeButtonGroup.js.map +1 -0
  72. package/dist/commonjs/features/endOfAssignment/ui/SparkIcon.js +29 -0
  73. package/dist/commonjs/features/endOfAssignment/ui/SparkIcon.js.map +1 -0
  74. package/dist/commonjs/features/endOfAssignment/ui/ThumbUpIcon.js +32 -0
  75. package/dist/commonjs/features/endOfAssignment/ui/ThumbUpIcon.js.map +1 -0
  76. package/dist/commonjs/index.js +24 -0
  77. package/dist/commonjs/index.js.map +1 -1
  78. package/dist/commonjs/shared/icons/Halloween.js +54 -0
  79. package/dist/commonjs/shared/icons/Halloween.js.map +1 -0
  80. package/dist/commonjs/shared/icons/Pi.js +30 -0
  81. package/dist/commonjs/shared/icons/Pi.js.map +1 -0
  82. package/dist/commonjs/shared/icons/Star.js +30 -0
  83. package/dist/commonjs/shared/icons/Star.js.map +1 -0
  84. package/dist/commonjs/shared/icons/Valentine.js +30 -0
  85. package/dist/commonjs/shared/icons/Valentine.js.map +1 -0
  86. package/dist/commonjs/shared/icons/Winter.js +32 -0
  87. package/dist/commonjs/shared/icons/Winter.js.map +1 -0
  88. package/dist/module/features/celebrations/components/Celebrations.js +45 -0
  89. package/dist/module/features/celebrations/components/Celebrations.js.map +1 -0
  90. package/dist/module/features/celebrations/components/Particle.js +76 -0
  91. package/dist/module/features/celebrations/components/Particle.js.map +1 -0
  92. package/dist/module/features/celebrations/components/ParticleBatch.js +38 -0
  93. package/dist/module/features/celebrations/components/ParticleBatch.js.map +1 -0
  94. package/dist/module/features/celebrations/components/Spark.js +17 -0
  95. package/dist/module/features/celebrations/components/Spark.js.map +1 -0
  96. package/dist/module/features/celebrations/config.js +194 -0
  97. package/dist/module/features/celebrations/config.js.map +1 -0
  98. package/dist/module/features/celebrations/helpers.js +87 -0
  99. package/dist/module/features/celebrations/helpers.js.map +1 -0
  100. package/dist/module/features/celebrations/index.js +5 -0
  101. package/dist/module/features/celebrations/index.js.map +1 -0
  102. package/dist/module/features/celebrations/types.js +11 -0
  103. package/dist/module/features/celebrations/types.js.map +1 -0
  104. package/dist/module/features/endOfAssignment/components/CheatDetected/CheatDetected.js +52 -0
  105. package/dist/module/features/endOfAssignment/components/CheatDetected/CheatDetected.js.map +1 -0
  106. package/dist/module/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.js +241 -0
  107. package/dist/module/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.js.map +1 -0
  108. package/dist/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js +124 -0
  109. package/dist/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js.map +1 -0
  110. package/dist/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswerSparks.js +50 -0
  111. package/dist/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswerSparks.js.map +1 -0
  112. package/dist/module/features/endOfAssignment/components/CorrectAnswer/GoodDrawingSparks.js +62 -0
  113. package/dist/module/features/endOfAssignment/components/CorrectAnswer/GoodDrawingSparks.js.map +1 -0
  114. package/dist/module/features/endOfAssignment/components/CorrectAnswer/Spark.js +47 -0
  115. package/dist/module/features/endOfAssignment/components/CorrectAnswer/Spark.js.map +1 -0
  116. package/dist/module/features/endOfAssignment/components/EOAModal.js +41 -0
  117. package/dist/module/features/endOfAssignment/components/EOAModal.js.map +1 -0
  118. package/dist/module/features/endOfAssignment/components/ExamLeave/ExamLeave.js +63 -0
  119. package/dist/module/features/endOfAssignment/components/ExamLeave/ExamLeave.js.map +1 -0
  120. package/dist/module/features/endOfAssignment/components/ExamPaused/ExamPaused.js +49 -0
  121. package/dist/module/features/endOfAssignment/components/ExamPaused/ExamPaused.js.map +1 -0
  122. package/dist/module/features/endOfAssignment/components/ExamSubmit/ExamSubmit.js +96 -0
  123. package/dist/module/features/endOfAssignment/components/ExamSubmit/ExamSubmit.js.map +1 -0
  124. package/dist/module/features/endOfAssignment/components/ExamSubmit/ExamSubmitContent.js +77 -0
  125. package/dist/module/features/endOfAssignment/components/ExamSubmit/ExamSubmitContent.js.map +1 -0
  126. package/dist/module/features/endOfAssignment/components/ExamSubmit/blurred-card.png +0 -0
  127. package/dist/module/features/endOfAssignment/components/Modal/Modal.js +89 -0
  128. package/dist/module/features/endOfAssignment/components/Modal/Modal.js.map +1 -0
  129. package/dist/module/features/endOfAssignment/components/Modal/ModalBackground.js +38 -0
  130. package/dist/module/features/endOfAssignment/components/Modal/ModalBackground.js.map +1 -0
  131. package/dist/module/features/endOfAssignment/components/Modal/assets/SunrisingIcon.js +226 -0
  132. package/dist/module/features/endOfAssignment/components/Modal/assets/SunrisingIcon.js.map +1 -0
  133. package/dist/module/features/endOfAssignment/components/Modal/assets/TrophyIcon.js +56 -0
  134. package/dist/module/features/endOfAssignment/components/Modal/assets/TrophyIcon.js.map +1 -0
  135. package/dist/module/features/endOfAssignment/components/Modal/model.js +29 -0
  136. package/dist/module/features/endOfAssignment/components/Modal/model.js.map +1 -0
  137. package/dist/module/features/endOfAssignment/components/NoAnswer/NoAnswer.js +85 -0
  138. package/dist/module/features/endOfAssignment/components/NoAnswer/NoAnswer.js.map +1 -0
  139. package/dist/module/features/endOfAssignment/components/NoAnswer/NoAnswerContent.js +100 -0
  140. package/dist/module/features/endOfAssignment/components/NoAnswer/NoAnswerContent.js.map +1 -0
  141. package/dist/module/features/endOfAssignment/constants.js +51 -0
  142. package/dist/module/features/endOfAssignment/constants.js.map +1 -0
  143. package/dist/module/features/endOfAssignment/helpers.js +58 -0
  144. package/dist/module/features/endOfAssignment/helpers.js.map +1 -0
  145. package/dist/module/features/endOfAssignment/hooks/useSparkAnimation.js +46 -0
  146. package/dist/module/features/endOfAssignment/hooks/useSparkAnimation.js.map +1 -0
  147. package/dist/module/features/endOfAssignment/index.js +6 -0
  148. package/dist/module/features/endOfAssignment/index.js.map +1 -0
  149. package/dist/module/features/endOfAssignment/model/model.js +48 -0
  150. package/dist/module/features/endOfAssignment/model/model.js.map +1 -0
  151. package/dist/module/features/endOfAssignment/types.js +29 -0
  152. package/dist/module/features/endOfAssignment/types.js.map +1 -0
  153. package/dist/module/features/endOfAssignment/ui/EOABadge.js +37 -0
  154. package/dist/module/features/endOfAssignment/ui/EOABadge.js.map +1 -0
  155. package/dist/module/features/endOfAssignment/ui/PracticeButton.js +24 -0
  156. package/dist/module/features/endOfAssignment/ui/PracticeButton.js.map +1 -0
  157. package/dist/module/features/endOfAssignment/ui/PracticeButtonGroup.js +58 -0
  158. package/dist/module/features/endOfAssignment/ui/PracticeButtonGroup.js.map +1 -0
  159. package/dist/module/features/endOfAssignment/ui/SparkIcon.js +21 -0
  160. package/dist/module/features/endOfAssignment/ui/SparkIcon.js.map +1 -0
  161. package/dist/module/features/endOfAssignment/ui/ThumbUpIcon.js +24 -0
  162. package/dist/module/features/endOfAssignment/ui/ThumbUpIcon.js.map +1 -0
  163. package/dist/module/index.js +2 -0
  164. package/dist/module/index.js.map +1 -1
  165. package/dist/module/shared/icons/Halloween.js +47 -0
  166. package/dist/module/shared/icons/Halloween.js.map +1 -0
  167. package/dist/module/shared/icons/Pi.js +23 -0
  168. package/dist/module/shared/icons/Pi.js.map +1 -0
  169. package/dist/module/shared/icons/Star.js +23 -0
  170. package/dist/module/shared/icons/Star.js.map +1 -0
  171. package/dist/module/shared/icons/Valentine.js +23 -0
  172. package/dist/module/shared/icons/Valentine.js.map +1 -0
  173. package/dist/module/shared/icons/Winter.js +25 -0
  174. package/dist/module/shared/icons/Winter.js.map +1 -0
  175. package/dist/typescript/commonjs/features/celebrations/components/Celebrations.d.ts +10 -0
  176. package/dist/typescript/commonjs/features/celebrations/components/Celebrations.d.ts.map +1 -0
  177. package/dist/typescript/commonjs/features/celebrations/components/Particle.d.ts +19 -0
  178. package/dist/typescript/commonjs/features/celebrations/components/Particle.d.ts.map +1 -0
  179. package/dist/typescript/commonjs/features/celebrations/components/ParticleBatch.d.ts +26 -0
  180. package/dist/typescript/commonjs/features/celebrations/components/ParticleBatch.d.ts.map +1 -0
  181. package/dist/typescript/commonjs/features/celebrations/components/Spark.d.ts +4 -0
  182. package/dist/typescript/commonjs/features/celebrations/components/Spark.d.ts.map +1 -0
  183. package/dist/typescript/commonjs/features/celebrations/config.d.ts +167 -0
  184. package/dist/typescript/commonjs/features/celebrations/config.d.ts.map +1 -0
  185. package/dist/typescript/commonjs/features/celebrations/helpers.d.ts +6 -0
  186. package/dist/typescript/commonjs/features/celebrations/helpers.d.ts.map +1 -0
  187. package/dist/typescript/commonjs/features/celebrations/index.d.ts +3 -0
  188. package/dist/typescript/commonjs/features/celebrations/index.d.ts.map +1 -0
  189. package/dist/typescript/commonjs/features/celebrations/types.d.ts +11 -0
  190. package/dist/typescript/commonjs/features/celebrations/types.d.ts.map +1 -0
  191. package/dist/typescript/commonjs/features/endOfAssignment/components/CheatDetected/CheatDetected.d.ts +4 -0
  192. package/dist/typescript/commonjs/features/endOfAssignment/components/CheatDetected/CheatDetected.d.ts.map +1 -0
  193. package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.d.ts +15 -0
  194. package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.d.ts.map +1 -0
  195. package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.d.ts +4 -0
  196. package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.d.ts.map +1 -0
  197. package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswerSparks.d.ts +8 -0
  198. package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswerSparks.d.ts.map +1 -0
  199. package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/GoodDrawingSparks.d.ts +8 -0
  200. package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/GoodDrawingSparks.d.ts.map +1 -0
  201. package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/Spark.d.ts +12 -0
  202. package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/Spark.d.ts.map +1 -0
  203. package/dist/typescript/commonjs/features/endOfAssignment/components/EOAModal.d.ts +11 -0
  204. package/dist/typescript/commonjs/features/endOfAssignment/components/EOAModal.d.ts.map +1 -0
  205. package/dist/typescript/commonjs/features/endOfAssignment/components/ExamLeave/ExamLeave.d.ts +4 -0
  206. package/dist/typescript/commonjs/features/endOfAssignment/components/ExamLeave/ExamLeave.d.ts.map +1 -0
  207. package/dist/typescript/commonjs/features/endOfAssignment/components/ExamPaused/ExamPaused.d.ts +4 -0
  208. package/dist/typescript/commonjs/features/endOfAssignment/components/ExamPaused/ExamPaused.d.ts.map +1 -0
  209. package/dist/typescript/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmit.d.ts +4 -0
  210. package/dist/typescript/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmit.d.ts.map +1 -0
  211. package/dist/typescript/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmitContent.d.ts +8 -0
  212. package/dist/typescript/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmitContent.d.ts.map +1 -0
  213. package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/Modal.d.ts +20 -0
  214. package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/Modal.d.ts.map +1 -0
  215. package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/ModalBackground.d.ts +3 -0
  216. package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/ModalBackground.d.ts.map +1 -0
  217. package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/assets/SunrisingIcon.d.ts +4 -0
  218. package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/assets/SunrisingIcon.d.ts.map +1 -0
  219. package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/assets/TrophyIcon.d.ts +4 -0
  220. package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/assets/TrophyIcon.d.ts.map +1 -0
  221. package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/model.d.ts +14 -0
  222. package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/model.d.ts.map +1 -0
  223. package/dist/typescript/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswer.d.ts +4 -0
  224. package/dist/typescript/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswer.d.ts.map +1 -0
  225. package/dist/typescript/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswerContent.d.ts +8 -0
  226. package/dist/typescript/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswerContent.d.ts.map +1 -0
  227. package/dist/typescript/commonjs/features/endOfAssignment/constants.d.ts +41 -0
  228. package/dist/typescript/commonjs/features/endOfAssignment/constants.d.ts.map +1 -0
  229. package/dist/typescript/commonjs/features/endOfAssignment/helpers.d.ts +9 -0
  230. package/dist/typescript/commonjs/features/endOfAssignment/helpers.d.ts.map +1 -0
  231. package/dist/typescript/commonjs/features/endOfAssignment/hooks/useSparkAnimation.d.ts +27 -0
  232. package/dist/typescript/commonjs/features/endOfAssignment/hooks/useSparkAnimation.d.ts.map +1 -0
  233. package/dist/typescript/commonjs/features/endOfAssignment/index.d.ts +4 -0
  234. package/dist/typescript/commonjs/features/endOfAssignment/index.d.ts.map +1 -0
  235. package/dist/typescript/commonjs/features/endOfAssignment/model/model.d.ts +14 -0
  236. package/dist/typescript/commonjs/features/endOfAssignment/model/model.d.ts.map +1 -0
  237. package/dist/typescript/commonjs/features/endOfAssignment/types.d.ts +60 -0
  238. package/dist/typescript/commonjs/features/endOfAssignment/types.d.ts.map +1 -0
  239. package/dist/typescript/commonjs/features/endOfAssignment/ui/EOABadge.d.ts +11 -0
  240. package/dist/typescript/commonjs/features/endOfAssignment/ui/EOABadge.d.ts.map +1 -0
  241. package/dist/typescript/commonjs/features/endOfAssignment/ui/PracticeButton.d.ts +10 -0
  242. package/dist/typescript/commonjs/features/endOfAssignment/ui/PracticeButton.d.ts.map +1 -0
  243. package/dist/typescript/commonjs/features/endOfAssignment/ui/PracticeButtonGroup.d.ts +14 -0
  244. package/dist/typescript/commonjs/features/endOfAssignment/ui/PracticeButtonGroup.d.ts.map +1 -0
  245. package/dist/typescript/commonjs/features/endOfAssignment/ui/SparkIcon.d.ts +4 -0
  246. package/dist/typescript/commonjs/features/endOfAssignment/ui/SparkIcon.d.ts.map +1 -0
  247. package/dist/typescript/commonjs/features/endOfAssignment/ui/ThumbUpIcon.d.ts +4 -0
  248. package/dist/typescript/commonjs/features/endOfAssignment/ui/ThumbUpIcon.d.ts.map +1 -0
  249. package/dist/typescript/commonjs/index.d.ts +2 -0
  250. package/dist/typescript/commonjs/index.d.ts.map +1 -1
  251. package/dist/typescript/commonjs/shared/icons/Halloween.d.ts +5 -0
  252. package/dist/typescript/commonjs/shared/icons/Halloween.d.ts.map +1 -0
  253. package/dist/typescript/commonjs/shared/icons/Pi.d.ts +5 -0
  254. package/dist/typescript/commonjs/shared/icons/Pi.d.ts.map +1 -0
  255. package/dist/typescript/commonjs/shared/icons/Star.d.ts +5 -0
  256. package/dist/typescript/commonjs/shared/icons/Star.d.ts.map +1 -0
  257. package/dist/typescript/commonjs/shared/icons/Valentine.d.ts +5 -0
  258. package/dist/typescript/commonjs/shared/icons/Valentine.d.ts.map +1 -0
  259. package/dist/typescript/commonjs/shared/icons/Winter.d.ts +5 -0
  260. package/dist/typescript/commonjs/shared/icons/Winter.d.ts.map +1 -0
  261. package/dist/typescript/module/features/celebrations/components/Celebrations.d.ts +10 -0
  262. package/dist/typescript/module/features/celebrations/components/Celebrations.d.ts.map +1 -0
  263. package/dist/typescript/module/features/celebrations/components/Particle.d.ts +19 -0
  264. package/dist/typescript/module/features/celebrations/components/Particle.d.ts.map +1 -0
  265. package/dist/typescript/module/features/celebrations/components/ParticleBatch.d.ts +26 -0
  266. package/dist/typescript/module/features/celebrations/components/ParticleBatch.d.ts.map +1 -0
  267. package/dist/typescript/module/features/celebrations/components/Spark.d.ts +4 -0
  268. package/dist/typescript/module/features/celebrations/components/Spark.d.ts.map +1 -0
  269. package/dist/typescript/module/features/celebrations/config.d.ts +167 -0
  270. package/dist/typescript/module/features/celebrations/config.d.ts.map +1 -0
  271. package/dist/typescript/module/features/celebrations/helpers.d.ts +6 -0
  272. package/dist/typescript/module/features/celebrations/helpers.d.ts.map +1 -0
  273. package/dist/typescript/module/features/celebrations/index.d.ts +3 -0
  274. package/dist/typescript/module/features/celebrations/index.d.ts.map +1 -0
  275. package/dist/typescript/module/features/celebrations/types.d.ts +11 -0
  276. package/dist/typescript/module/features/celebrations/types.d.ts.map +1 -0
  277. package/dist/typescript/module/features/endOfAssignment/components/CheatDetected/CheatDetected.d.ts +4 -0
  278. package/dist/typescript/module/features/endOfAssignment/components/CheatDetected/CheatDetected.d.ts.map +1 -0
  279. package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.d.ts +15 -0
  280. package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.d.ts.map +1 -0
  281. package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.d.ts +4 -0
  282. package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.d.ts.map +1 -0
  283. package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswerSparks.d.ts +8 -0
  284. package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswerSparks.d.ts.map +1 -0
  285. package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/GoodDrawingSparks.d.ts +8 -0
  286. package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/GoodDrawingSparks.d.ts.map +1 -0
  287. package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/Spark.d.ts +12 -0
  288. package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/Spark.d.ts.map +1 -0
  289. package/dist/typescript/module/features/endOfAssignment/components/EOAModal.d.ts +11 -0
  290. package/dist/typescript/module/features/endOfAssignment/components/EOAModal.d.ts.map +1 -0
  291. package/dist/typescript/module/features/endOfAssignment/components/ExamLeave/ExamLeave.d.ts +4 -0
  292. package/dist/typescript/module/features/endOfAssignment/components/ExamLeave/ExamLeave.d.ts.map +1 -0
  293. package/dist/typescript/module/features/endOfAssignment/components/ExamPaused/ExamPaused.d.ts +4 -0
  294. package/dist/typescript/module/features/endOfAssignment/components/ExamPaused/ExamPaused.d.ts.map +1 -0
  295. package/dist/typescript/module/features/endOfAssignment/components/ExamSubmit/ExamSubmit.d.ts +4 -0
  296. package/dist/typescript/module/features/endOfAssignment/components/ExamSubmit/ExamSubmit.d.ts.map +1 -0
  297. package/dist/typescript/module/features/endOfAssignment/components/ExamSubmit/ExamSubmitContent.d.ts +8 -0
  298. package/dist/typescript/module/features/endOfAssignment/components/ExamSubmit/ExamSubmitContent.d.ts.map +1 -0
  299. package/dist/typescript/module/features/endOfAssignment/components/Modal/Modal.d.ts +20 -0
  300. package/dist/typescript/module/features/endOfAssignment/components/Modal/Modal.d.ts.map +1 -0
  301. package/dist/typescript/module/features/endOfAssignment/components/Modal/ModalBackground.d.ts +3 -0
  302. package/dist/typescript/module/features/endOfAssignment/components/Modal/ModalBackground.d.ts.map +1 -0
  303. package/dist/typescript/module/features/endOfAssignment/components/Modal/assets/SunrisingIcon.d.ts +4 -0
  304. package/dist/typescript/module/features/endOfAssignment/components/Modal/assets/SunrisingIcon.d.ts.map +1 -0
  305. package/dist/typescript/module/features/endOfAssignment/components/Modal/assets/TrophyIcon.d.ts +4 -0
  306. package/dist/typescript/module/features/endOfAssignment/components/Modal/assets/TrophyIcon.d.ts.map +1 -0
  307. package/dist/typescript/module/features/endOfAssignment/components/Modal/model.d.ts +14 -0
  308. package/dist/typescript/module/features/endOfAssignment/components/Modal/model.d.ts.map +1 -0
  309. package/dist/typescript/module/features/endOfAssignment/components/NoAnswer/NoAnswer.d.ts +4 -0
  310. package/dist/typescript/module/features/endOfAssignment/components/NoAnswer/NoAnswer.d.ts.map +1 -0
  311. package/dist/typescript/module/features/endOfAssignment/components/NoAnswer/NoAnswerContent.d.ts +8 -0
  312. package/dist/typescript/module/features/endOfAssignment/components/NoAnswer/NoAnswerContent.d.ts.map +1 -0
  313. package/dist/typescript/module/features/endOfAssignment/constants.d.ts +41 -0
  314. package/dist/typescript/module/features/endOfAssignment/constants.d.ts.map +1 -0
  315. package/dist/typescript/module/features/endOfAssignment/helpers.d.ts +9 -0
  316. package/dist/typescript/module/features/endOfAssignment/helpers.d.ts.map +1 -0
  317. package/dist/typescript/module/features/endOfAssignment/hooks/useSparkAnimation.d.ts +27 -0
  318. package/dist/typescript/module/features/endOfAssignment/hooks/useSparkAnimation.d.ts.map +1 -0
  319. package/dist/typescript/module/features/endOfAssignment/index.d.ts +4 -0
  320. package/dist/typescript/module/features/endOfAssignment/index.d.ts.map +1 -0
  321. package/dist/typescript/module/features/endOfAssignment/model/model.d.ts +14 -0
  322. package/dist/typescript/module/features/endOfAssignment/model/model.d.ts.map +1 -0
  323. package/dist/typescript/module/features/endOfAssignment/types.d.ts +60 -0
  324. package/dist/typescript/module/features/endOfAssignment/types.d.ts.map +1 -0
  325. package/dist/typescript/module/features/endOfAssignment/ui/EOABadge.d.ts +11 -0
  326. package/dist/typescript/module/features/endOfAssignment/ui/EOABadge.d.ts.map +1 -0
  327. package/dist/typescript/module/features/endOfAssignment/ui/PracticeButton.d.ts +10 -0
  328. package/dist/typescript/module/features/endOfAssignment/ui/PracticeButton.d.ts.map +1 -0
  329. package/dist/typescript/module/features/endOfAssignment/ui/PracticeButtonGroup.d.ts +14 -0
  330. package/dist/typescript/module/features/endOfAssignment/ui/PracticeButtonGroup.d.ts.map +1 -0
  331. package/dist/typescript/module/features/endOfAssignment/ui/SparkIcon.d.ts +4 -0
  332. package/dist/typescript/module/features/endOfAssignment/ui/SparkIcon.d.ts.map +1 -0
  333. package/dist/typescript/module/features/endOfAssignment/ui/ThumbUpIcon.d.ts +4 -0
  334. package/dist/typescript/module/features/endOfAssignment/ui/ThumbUpIcon.d.ts.map +1 -0
  335. package/dist/typescript/module/index.d.ts +2 -0
  336. package/dist/typescript/module/index.d.ts.map +1 -1
  337. package/dist/typescript/module/shared/icons/Halloween.d.ts +5 -0
  338. package/dist/typescript/module/shared/icons/Halloween.d.ts.map +1 -0
  339. package/dist/typescript/module/shared/icons/Pi.d.ts +5 -0
  340. package/dist/typescript/module/shared/icons/Pi.d.ts.map +1 -0
  341. package/dist/typescript/module/shared/icons/Star.d.ts +5 -0
  342. package/dist/typescript/module/shared/icons/Star.d.ts.map +1 -0
  343. package/dist/typescript/module/shared/icons/Valentine.d.ts +5 -0
  344. package/dist/typescript/module/shared/icons/Valentine.d.ts.map +1 -0
  345. package/dist/typescript/module/shared/icons/Winter.d.ts +5 -0
  346. package/dist/typescript/module/shared/icons/Winter.d.ts.map +1 -0
  347. package/package.json +3 -1
  348. package/src/features/celebrations/components/Celebrations.tsx +62 -0
  349. package/src/features/celebrations/components/Particle.tsx +99 -0
  350. package/src/features/celebrations/components/ParticleBatch.tsx +56 -0
  351. package/src/features/celebrations/components/Spark.tsx +14 -0
  352. package/src/features/celebrations/config.ts +199 -0
  353. package/src/features/celebrations/helpers.ts +96 -0
  354. package/src/features/celebrations/index.ts +2 -0
  355. package/src/features/celebrations/types.ts +11 -0
  356. package/src/features/endOfAssignment/components/CheatDetected/CheatDetected.tsx +48 -0
  357. package/src/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.tsx +293 -0
  358. package/src/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.tsx +128 -0
  359. package/src/features/endOfAssignment/components/CorrectAnswer/CorrectAnswerSparks.tsx +39 -0
  360. package/src/features/endOfAssignment/components/CorrectAnswer/GoodDrawingSparks.tsx +40 -0
  361. package/src/features/endOfAssignment/components/CorrectAnswer/Spark.tsx +45 -0
  362. package/src/features/endOfAssignment/components/EOAModal.tsx +64 -0
  363. package/src/features/endOfAssignment/components/ExamLeave/ExamLeave.tsx +56 -0
  364. package/src/features/endOfAssignment/components/ExamPaused/ExamPaused.tsx +46 -0
  365. package/src/features/endOfAssignment/components/ExamSubmit/ExamSubmit.tsx +102 -0
  366. package/src/features/endOfAssignment/components/ExamSubmit/ExamSubmitContent.tsx +69 -0
  367. package/src/features/endOfAssignment/components/ExamSubmit/blurred-card.png +0 -0
  368. package/src/features/endOfAssignment/components/Modal/Modal.tsx +105 -0
  369. package/src/features/endOfAssignment/components/Modal/ModalBackground.tsx +33 -0
  370. package/src/features/endOfAssignment/components/Modal/assets/SunrisingIcon.tsx +196 -0
  371. package/src/features/endOfAssignment/components/Modal/assets/TrophyIcon.tsx +62 -0
  372. package/src/features/endOfAssignment/components/Modal/model.ts +34 -0
  373. package/src/features/endOfAssignment/components/NoAnswer/NoAnswer.tsx +85 -0
  374. package/src/features/endOfAssignment/components/NoAnswer/NoAnswerContent.tsx +107 -0
  375. package/src/features/endOfAssignment/constants.ts +53 -0
  376. package/src/features/endOfAssignment/helpers.ts +28 -0
  377. package/src/features/endOfAssignment/hooks/useSparkAnimation.tsx +78 -0
  378. package/src/features/endOfAssignment/index.ts +3 -0
  379. package/src/features/endOfAssignment/model/model.ts +57 -0
  380. package/src/features/endOfAssignment/types.ts +65 -0
  381. package/src/features/endOfAssignment/ui/EOABadge.tsx +47 -0
  382. package/src/features/endOfAssignment/ui/PracticeButton.tsx +27 -0
  383. package/src/features/endOfAssignment/ui/PracticeButtonGroup.tsx +75 -0
  384. package/src/features/endOfAssignment/ui/SparkIcon.tsx +15 -0
  385. package/src/features/endOfAssignment/ui/ThumbUpIcon.tsx +17 -0
  386. package/src/index.ts +2 -0
  387. package/src/shared/icons/Halloween.tsx +33 -0
  388. package/src/shared/icons/Pi.tsx +16 -0
  389. package/src/shared/icons/Star.tsx +16 -0
  390. package/src/shared/icons/Valentine.tsx +16 -0
  391. package/src/shared/icons/Winter.tsx +19 -0
@@ -0,0 +1,293 @@
1
+ import React, { memo, useEffect, useRef } from 'react'
2
+ import { View, StyleSheet } from 'react-native'
3
+
4
+ import Animated, {
5
+ useSharedValue,
6
+ useAnimatedStyle,
7
+ withSpring,
8
+ withTiming,
9
+ withDelay,
10
+ interpolate,
11
+ interpolateColor,
12
+ runOnUI,
13
+ runOnJS,
14
+ } from 'react-native-reanimated'
15
+ import { SPACING, Typography, COLORS, BORDER_RADIUS, IS_MOBILE } from '@magmamath/react-native-ui'
16
+
17
+ import { GoodDrawingSparks } from './GoodDrawingSparks'
18
+ import { CorrectAnswerSparks } from './CorrectAnswerSparks'
19
+ import { EOABadge } from '../../ui/EOABadge'
20
+ import { SparkIcon } from '../../ui/SparkIcon'
21
+
22
+ import { AnimatedCardVariant, EOAModalText } from '../../types'
23
+ import {
24
+ ANIMATION_DELAYS,
25
+ BADGE_PARAMS,
26
+ CARD_DIMENSIONS,
27
+ OPACITY,
28
+ SPRING_CONFIG,
29
+ SPRING_CONFIG_STEP_3,
30
+ VARIANT_COLORS,
31
+ } from '../../constants'
32
+ import { CelebrationsRef, CelebrationVariant } from '../../../celebrations/types'
33
+ import { Celebrations } from '../../../celebrations/components/Celebrations'
34
+
35
+ type AnimatedCardProps = {
36
+ variant: AnimatedCardVariant
37
+ textContent: EOAModalText
38
+ shouldTriggerSparkles: boolean
39
+ solvedAmount?: number
40
+ problemsAmount?: number
41
+ gbdAmount?: number
42
+ delay?: number
43
+ onAnimationEnd?: () => void
44
+ }
45
+
46
+ export const AnimatedCard = memo(
47
+ ({
48
+ variant,
49
+ textContent,
50
+ shouldTriggerSparkles,
51
+ solvedAmount = 0,
52
+ problemsAmount = 0,
53
+ gbdAmount = 0,
54
+ delay = 0,
55
+ onAnimationEnd,
56
+ }: AnimatedCardProps) => {
57
+ const celebrationsRef = useRef<CelebrationsRef>(null)
58
+
59
+ const cardOpacity = useSharedValue(OPACITY.initial)
60
+ const cardWidth = useSharedValue(CARD_DIMENSIONS.initialWidth)
61
+ const badgeTranslateX = useSharedValue(BADGE_PARAMS.initialTranslateX)
62
+ const badgeRotation = useSharedValue(BADGE_PARAMS.initialRotation)
63
+ const badgeScale = useSharedValue(BADGE_PARAMS.initialScale)
64
+ const statsOpacity = useSharedValue(OPACITY.initial)
65
+ const delaySv = useSharedValue(0)
66
+
67
+ const animatedCardStyle = useAnimatedStyle(() => {
68
+ const progress = interpolate(
69
+ statsOpacity.value,
70
+ [OPACITY.initial, OPACITY.final],
71
+ [OPACITY.initial, OPACITY.final],
72
+ )
73
+ const backgroundColor = interpolateColor(
74
+ progress,
75
+ [OPACITY.initial, OPACITY.final],
76
+ [VARIANT_COLORS[variant].initial, VARIANT_COLORS[variant].final],
77
+ )
78
+ const height = interpolate(
79
+ cardWidth.value,
80
+ [CARD_DIMENSIONS.initialWidth, CARD_DIMENSIONS.finalWidth],
81
+ [CARD_DIMENSIONS.initialHeight, CARD_DIMENSIONS.finalHeight],
82
+ )
83
+ return {
84
+ opacity: cardOpacity.value,
85
+ width: cardWidth.value,
86
+ height,
87
+ backgroundColor,
88
+ }
89
+ }, [statsOpacity, cardOpacity, cardWidth])
90
+
91
+ const animatedBadgeStyle = useAnimatedStyle(
92
+ () => ({
93
+ transform: [
94
+ { translateX: badgeTranslateX.value },
95
+ { rotate: `${badgeRotation.value}deg` },
96
+ { scale: badgeScale.value },
97
+ ],
98
+ }),
99
+ [badgeTranslateX, badgeRotation, badgeScale],
100
+ )
101
+
102
+ const animatedStatsStyle = useAnimatedStyle(() => {
103
+ return {
104
+ opacity: statsOpacity.value,
105
+ }
106
+ }, [statsOpacity])
107
+
108
+ const statsSubtitle = (() => {
109
+ if (variant === AnimatedCardVariant.CORRECT_ANSWER) {
110
+ if (solvedAmount > 1) {
111
+ return textContent.stats?.correctAnswersPlural
112
+ }
113
+ return textContent.stats?.correctAnswers
114
+ } else {
115
+ if (gbdAmount > 1) {
116
+ return textContent.stats?.goodCalculationsPlural
117
+ }
118
+ return textContent.stats?.goodCalculations
119
+ }
120
+ })()
121
+
122
+ const runCelebration = () => {
123
+ if (variant === AnimatedCardVariant.CORRECT_ANSWER) {
124
+ celebrationsRef.current?.play(CelebrationVariant.CORRECT_FINISH_ASSIGNMENT)
125
+ } else {
126
+ celebrationsRef.current?.play(CelebrationVariant.GBD_FINISH_ASSIGNMENT)
127
+ }
128
+
129
+ onAnimationEnd?.()
130
+ }
131
+
132
+ useEffect(() => {
133
+ runOnUI(() => {
134
+ 'worklet'
135
+ const step3 = () => {
136
+ badgeTranslateX.value = withSpring(BADGE_PARAMS.finalTranslateX, SPRING_CONFIG_STEP_3)
137
+ statsOpacity.value = withDelay(80, withSpring(OPACITY.final, SPRING_CONFIG_STEP_3))
138
+ }
139
+
140
+ const step2 = () => {
141
+ badgeTranslateX.value = withSpring(BADGE_PARAMS.intermediateTranslateX, SPRING_CONFIG)
142
+ cardWidth.value = withSpring(CARD_DIMENSIONS.finalWidth, SPRING_CONFIG)
143
+ badgeRotation.value = withSpring(0, SPRING_CONFIG)
144
+ badgeScale.value = withSpring(1, SPRING_CONFIG, () => {
145
+ delaySv.value = withTiming(1, { duration: ANIMATION_DELAYS.step3 }, () => {
146
+ step3()
147
+
148
+ delaySv.value = withTiming(0, { duration: 100 }, (finished) => {
149
+ if (finished) {
150
+ runOnJS(runCelebration)()
151
+ }
152
+ })
153
+ })
154
+ })
155
+ }
156
+
157
+ const step1 = () => {
158
+ cardOpacity.value = withDelay(
159
+ delay,
160
+ withSpring(OPACITY.final, SPRING_CONFIG, () => {
161
+ step2()
162
+ }),
163
+ )
164
+ }
165
+
166
+ step1()
167
+ })()
168
+ }, [])
169
+
170
+ return (
171
+ <Animated.View style={styles.cardContainer}>
172
+ {variant === AnimatedCardVariant.CORRECT_ANSWER ? (
173
+ <CorrectAnswerSparks
174
+ color={COLORS.GREEN_3}
175
+ shouldStartAnimation={shouldTriggerSparkles}
176
+ />
177
+ ) : (
178
+ <GoodDrawingSparks color={COLORS.ORANGE_3} shouldStartAnimation={shouldTriggerSparkles} />
179
+ )}
180
+ <Celebrations modelRef={celebrationsRef} style={styles.celebrations} />
181
+
182
+ <Animated.View style={[styles.card, animatedCardStyle]}>
183
+ <Animated.View style={styles.cardContent}>
184
+ <Animated.View style={[styles.badgeContainer, animatedBadgeStyle]}>
185
+ <EOABadge
186
+ variant={variant}
187
+ color={VARIANT_COLORS[variant].primary}
188
+ size={88}
189
+ iconSize={56}
190
+ />
191
+ </Animated.View>
192
+
193
+ <Animated.View style={[styles.statsWrapper, animatedStatsStyle]}>
194
+ {variant === AnimatedCardVariant.GOOD_DRAWING && (
195
+ <View style={styles.starContainer}>
196
+ <SparkIcon size={20} color={VARIANT_COLORS[variant].initial} />
197
+ <View style={styles.starCircle} />
198
+ <SparkIcon size={12} color={VARIANT_COLORS[variant].initial} />
199
+ </View>
200
+ )}
201
+
202
+ <View style={styles.statsValueContainer}>
203
+ <Typography
204
+ variant="h1"
205
+ style={[styles.largeText, { color: VARIANT_COLORS[variant].primary }]}
206
+ >
207
+ {variant === AnimatedCardVariant.CORRECT_ANSWER ? solvedAmount : gbdAmount}
208
+ </Typography>
209
+ {variant === AnimatedCardVariant.CORRECT_ANSWER && (
210
+ <Typography variant="h5" style={styles.smallText}>
211
+ /{problemsAmount}
212
+ </Typography>
213
+ )}
214
+ </View>
215
+
216
+ <Typography variant="h3" style={styles.cardTitle}>
217
+ {statsSubtitle}
218
+ </Typography>
219
+ </Animated.View>
220
+ </Animated.View>
221
+ </Animated.View>
222
+ </Animated.View>
223
+ )
224
+ },
225
+ )
226
+
227
+ const styles = StyleSheet.create({
228
+ cardContainer: {
229
+ height: CARD_DIMENSIONS.finalHeight,
230
+ width: CARD_DIMENSIONS.finalWidth,
231
+ justifyContent: 'center',
232
+ alignItems: 'center',
233
+ },
234
+ card: {
235
+ padding: SPACING[200],
236
+ borderRadius: SPACING[400],
237
+ },
238
+ cardContent: {
239
+ flex: 1,
240
+ gap: SPACING[100],
241
+ borderRadius: BORDER_RADIUS[200],
242
+ flexDirection: 'row',
243
+ alignItems: 'center',
244
+ backgroundColor: COLORS.NEUTRAL_1,
245
+ },
246
+ badgeContainer: {
247
+ borderRadius: BORDER_RADIUS[400],
248
+ marginRight: 50,
249
+ },
250
+ statsWrapper: {
251
+ padding: SPACING[100],
252
+ gap: SPACING[100],
253
+ },
254
+ statsValueContainer: {
255
+ flexDirection: 'row',
256
+ height: IS_MOBILE ? 42 : 'auto',
257
+ paddingHorizontal: SPACING[100],
258
+ marginVertical: SPACING[100],
259
+ },
260
+ largeText: {
261
+ textAlign: 'center',
262
+ textAlignVertical: 'bottom',
263
+ fontSize: IS_MOBILE ? 56 : 60,
264
+ fontWeight: '700',
265
+ lineHeight: IS_MOBILE ? 54 : 46,
266
+ },
267
+ smallText: {
268
+ fontSize: 16,
269
+ fontWeight: '700',
270
+ lineHeight: 16,
271
+ color: COLORS.NEUTRAL_6,
272
+ alignSelf: 'flex-end',
273
+ },
274
+ cardTitle: {
275
+ color: COLORS.NEUTRAL_7,
276
+ padding: SPACING[100],
277
+ },
278
+ starContainer: {
279
+ position: 'absolute',
280
+ left: 55,
281
+ top: 10,
282
+ },
283
+ starCircle: {
284
+ width: 4,
285
+ height: 4,
286
+ borderRadius: 5,
287
+ backgroundColor: COLORS.ORANGE_2,
288
+ },
289
+ celebrations: {
290
+ top: 0,
291
+ zIndex: 100000,
292
+ },
293
+ })
@@ -0,0 +1,128 @@
1
+ import React, { useCallback, useState } from 'react'
2
+ import { View, StyleSheet } from 'react-native'
3
+
4
+ import { useUnit } from 'effector-react'
5
+ import { SPACING, Typography, COLORS, FONT_FAMILY } from '@magmamath/react-native-ui'
6
+
7
+ import { AnimatedCard } from './AnimatedCard'
8
+
9
+ import { PracticeButtonGroup } from '../../ui/PracticeButtonGroup'
10
+ import { GOOD_DRAWING_CARD_APPEARENCE_DELAY } from '../../constants'
11
+ import { AnimatedCardVariant, EOAModalContentProps, EOAModalVariant } from '../../types'
12
+
13
+ export const CorrectAnswer = ({ textContent, model, onPracticePress }: EOAModalContentProps) => {
14
+ const popUpData = useUnit(model.$popUpData)
15
+ const modalVariant = useUnit(model.$modalVariant)
16
+ const [cardsAnimationCompleted, setCardsAnimationCompleted] = useState(false)
17
+
18
+ const { user, stats, hasRecommendations, isExam, newerAssignmentAvailable } = popUpData ?? {}
19
+ const { solvedAmount, problemsAmount, goodDrawingAmount } = stats ?? {}
20
+
21
+ const isPracticeButtonVisible = !!(
22
+ user?.practiceMode &&
23
+ !newerAssignmentAvailable &&
24
+ (isExam || hasRecommendations)
25
+ )
26
+
27
+ const handlePracticePress = () => {
28
+ onPracticePress?.()
29
+ model.hidePopUp()
30
+ }
31
+
32
+ const onCorrectAnswerAnimationEnd = useCallback(() => {
33
+ if (goodDrawingAmount === 0) {
34
+ setCardsAnimationCompleted(true)
35
+ }
36
+ }, [])
37
+
38
+ const onGBDAnimationEnd = useCallback(() => {
39
+ setCardsAnimationCompleted(true)
40
+ }, [])
41
+
42
+ return (
43
+ <View
44
+ style={[
45
+ styles.wrapper,
46
+ modalVariant !== EOAModalVariant.HAS_GOOD_DRAWING && { alignItems: 'center' },
47
+ ]}
48
+ >
49
+ <View style={styles.header}>
50
+ <Typography variant="large" style={styles.title}>
51
+ {textContent?.title}
52
+ </Typography>
53
+ <Typography variant="h4" style={styles.subtitle}>
54
+ {`${textContent?.subtitle} ${user?.firstName}!`}
55
+ </Typography>
56
+ </View>
57
+
58
+ <View style={styles.animationContainer}>
59
+ <AnimatedCard
60
+ variant={AnimatedCardVariant.CORRECT_ANSWER}
61
+ textContent={textContent}
62
+ solvedAmount={solvedAmount}
63
+ problemsAmount={problemsAmount}
64
+ shouldTriggerSparkles={cardsAnimationCompleted}
65
+ onAnimationEnd={onCorrectAnswerAnimationEnd}
66
+ />
67
+
68
+ {modalVariant === EOAModalVariant.HAS_GOOD_DRAWING && (
69
+ <AnimatedCard
70
+ variant={AnimatedCardVariant.GOOD_DRAWING}
71
+ textContent={textContent}
72
+ gbdAmount={goodDrawingAmount}
73
+ shouldTriggerSparkles={cardsAnimationCompleted}
74
+ onAnimationEnd={onGBDAnimationEnd}
75
+ delay={GOOD_DRAWING_CARD_APPEARENCE_DELAY}
76
+ />
77
+ )}
78
+ </View>
79
+
80
+ <PracticeButtonGroup
81
+ textContent={textContent}
82
+ isPracticeButtonVisible={isPracticeButtonVisible}
83
+ isExam={isExam}
84
+ onLeftButtonPress={model.hidePopUpAndLeave}
85
+ onRightButtonPress={handlePracticePress}
86
+ />
87
+ </View>
88
+ )
89
+ }
90
+
91
+ const styles = StyleSheet.create({
92
+ wrapper: {
93
+ flex: 1,
94
+ gap: SPACING[400],
95
+ },
96
+ header: {
97
+ gap: SPACING[100],
98
+ alignItems: 'center',
99
+ },
100
+ title: {
101
+ fontWeight: '900',
102
+ lineHeight: 54,
103
+ fontSize: 36,
104
+ paddingVertical: SPACING[100],
105
+ color: COLORS.NEUTRAL_9,
106
+ fontFamily: FONT_FAMILY.buenosAires,
107
+ },
108
+ subtitle: {
109
+ color: COLORS.NEUTRAL_7,
110
+ paddingVertical: SPACING[100],
111
+ lineHeight: 25,
112
+ },
113
+ animationContainer: {
114
+ flex: 1,
115
+ flexDirection: 'row',
116
+ justifyContent: 'center',
117
+ gap: SPACING[800],
118
+ paddingTop: SPACING[800],
119
+ paddingBottom: SPACING[1600],
120
+ },
121
+ buttonsContainer: {
122
+ height: 62,
123
+ flexDirection: 'row',
124
+ alignItems: 'center',
125
+ gap: SPACING[200],
126
+ paddingVertical: SPACING[300],
127
+ },
128
+ })
@@ -0,0 +1,39 @@
1
+ import React from 'react'
2
+ import { StyleSheet, View } from 'react-native'
3
+
4
+ import { Spark } from './Spark'
5
+ import { SPARKS_ANIMATION_DELAY } from '../../constants'
6
+
7
+ type CorrectAnswerProps = {
8
+ shouldStartAnimation: boolean
9
+ color: string
10
+ }
11
+
12
+ const CA_SPARKS_MAP = [
13
+ { id: '1', x: 22, y: 20, size: 14, initialDelay: SPARKS_ANIMATION_DELAY * 1.3 },
14
+ { id: '2', x: 128, y: 127, size: 21, initialDelay: SPARKS_ANIMATION_DELAY * 1.14 },
15
+ { id: '3', x: 268, y: 44, size: 28, initialDelay: SPARKS_ANIMATION_DELAY * 1.4 },
16
+ ]
17
+
18
+ export const CorrectAnswerSparks = ({ color, shouldStartAnimation }: CorrectAnswerProps) => {
19
+ if (!shouldStartAnimation) {
20
+ return null
21
+ }
22
+
23
+ return (
24
+ <View style={styles.container}>
25
+ {CA_SPARKS_MAP.map((star) => (
26
+ <Spark key={star.id} color={color} {...star} />
27
+ ))}
28
+ </View>
29
+ )
30
+ }
31
+
32
+ const styles = StyleSheet.create({
33
+ container: {
34
+ position: 'absolute',
35
+ zIndex: 110,
36
+ width: '100%',
37
+ height: '100%',
38
+ },
39
+ })
@@ -0,0 +1,40 @@
1
+ import React from 'react'
2
+ import { StyleSheet, View } from 'react-native'
3
+ import { Spark } from './Spark'
4
+ import { SPARKS_ANIMATION_DELAY } from '../../constants'
5
+
6
+ const GD_SPARKS_MAP = [
7
+ { id: '1', x: 20, y: 135.5, size: 14, initialDelay: SPARKS_ANIMATION_DELAY * 1.25 },
8
+ { id: '2', x: 25, y: 19.5, size: 21, initialDelay: SPARKS_ANIMATION_DELAY },
9
+ { id: '3', x: 115, y: 132, size: 28, initialDelay: SPARKS_ANIMATION_DELAY * 1.1 },
10
+ { id: '4', x: 315, y: 42, size: 14, initialDelay: SPARKS_ANIMATION_DELAY * 1.31 },
11
+ { id: '5', x: 326, y: 24.5, size: 21, initialDelay: SPARKS_ANIMATION_DELAY * 1.36 },
12
+ ]
13
+
14
+ type GoodDrawingSparksProps = {
15
+ shouldStartAnimation: boolean
16
+ color: string
17
+ }
18
+
19
+ export const GoodDrawingSparks = ({ color, shouldStartAnimation }: GoodDrawingSparksProps) => {
20
+ if (!shouldStartAnimation) {
21
+ return null
22
+ }
23
+
24
+ return (
25
+ <View style={styles.container}>
26
+ {GD_SPARKS_MAP.map((star) => (
27
+ <Spark key={star.id} color={color} {...star} />
28
+ ))}
29
+ </View>
30
+ )
31
+ }
32
+
33
+ const styles = StyleSheet.create({
34
+ container: {
35
+ position: 'absolute',
36
+ zIndex: 110,
37
+ width: '100%',
38
+ height: '100%',
39
+ },
40
+ })
@@ -0,0 +1,45 @@
1
+ import React from 'react'
2
+ import { COLORS } from '@magmamath/react-native-ui'
3
+ import { SparkIcon } from '../../ui/SparkIcon'
4
+ import { useSparkAnimation } from '../../hooks/useSparkAnimation'
5
+ import Animated from 'react-native-reanimated'
6
+
7
+ type SparkProps = {
8
+ id: string
9
+ x: number
10
+ y: number
11
+ size: number
12
+ color: string
13
+ initialDelay: number
14
+ }
15
+
16
+ const SPARKS_SPRING_CONFIG = {
17
+ mass: 1.8,
18
+ damping: 25,
19
+ stiffness: 293,
20
+ overshootClamping: false,
21
+ restDisplacementThreshold: 0.01,
22
+ restSpeedThreshold: 2,
23
+ }
24
+
25
+ const HOLD_DELAY = 800
26
+ const ROTATION_ANGLE = 90
27
+
28
+ export const Spark = ({ id, x, y, size, initialDelay = 350, color = COLORS.GREEN_3 }: SparkProps) => {
29
+ const { animatedStyle } = useSparkAnimation({
30
+ id,
31
+ initialDelay,
32
+ rotationAngle: ROTATION_ANGLE,
33
+ holdDelay: HOLD_DELAY,
34
+ springConfig: SPARKS_SPRING_CONFIG,
35
+ x,
36
+ y,
37
+ size,
38
+ })
39
+
40
+ return (
41
+ <Animated.View style={animatedStyle}>
42
+ <SparkIcon size={size} color={color} />
43
+ </Animated.View>
44
+ )
45
+ }
@@ -0,0 +1,64 @@
1
+ import React from 'react'
2
+ import { useUnit } from 'effector-react'
3
+
4
+ import { EOAModel } from '../model/model'
5
+ import { EOAEventType, EOAModalText, EOAModalVariant } from '../types'
6
+
7
+ import { Modal } from './Modal/Modal'
8
+
9
+ import { NoAnswer } from './NoAnswer/NoAnswer'
10
+ import { CheatDetected } from './CheatDetected/CheatDetected'
11
+ import { CorrectAnswer } from './CorrectAnswer/CorrectAnswer'
12
+ import { ExamLeave } from './ExamLeave/ExamLeave'
13
+ import { ExamPaused } from './ExamPaused/ExamPaused'
14
+ import { ExamSubmit } from './ExamSubmit/ExamSubmit'
15
+
16
+ import { getModalContainerSize, shouldDisplayModalBackground } from '../helpers'
17
+
18
+ const MODAL_CONTENT_VARIANTS_MAP = new Map([
19
+ [EOAModalVariant.NO_CORRECT_ANSWERS, NoAnswer],
20
+ [EOAModalVariant.HAS_CORRECT_ANSWERS, CorrectAnswer],
21
+ [EOAModalVariant.HAS_GOOD_DRAWING, CorrectAnswer],
22
+ [EOAModalVariant.EXAM_FINISHED_NO_CORRECT_ANSWERS, NoAnswer],
23
+ [EOAModalVariant.EXAM_FINISHED_HAS_CORRECT_ANSWERS, CorrectAnswer],
24
+ [EOAModalVariant.EXAM_SAFE_MODE_SUBMIT, ExamSubmit],
25
+ [EOAModalVariant.EXAM_SUBMIT, ExamSubmit],
26
+ [EOAModalVariant.EXAM_PAUSED, ExamPaused],
27
+ [EOAModalVariant.EXAM_SAFE_MODE_CHEAT_DETECTED, CheatDetected],
28
+ [EOAModalVariant.EXAM_SAFE_MODE_LEAVE, ExamLeave],
29
+ ])
30
+
31
+ type EOAModalProps = {
32
+ model: EOAModel
33
+ textContent: EOAModalText
34
+ onPracticePress: () => void
35
+ }
36
+
37
+ export const EOAModal = ({ model, textContent, onPracticePress }: EOAModalProps) => {
38
+ const popUpData = useUnit(model.$popUpData)
39
+ const modalVariant = useUnit(model.$modalVariant)
40
+
41
+ if (!popUpData || !modalVariant) return null
42
+
43
+ const withBackground = shouldDisplayModalBackground(modalVariant)
44
+ const isDismissable =
45
+ popUpData.eventType !== EOAEventType.CHEAT_DETECTED &&
46
+ popUpData.eventType !== EOAEventType.EXAM_PAUSED
47
+
48
+ const ModalContent = MODAL_CONTENT_VARIANTS_MAP.get(modalVariant)
49
+
50
+ if (!ModalContent) return null
51
+
52
+ return (
53
+ <Modal
54
+ isVisible={true}
55
+ isDismissable={isDismissable}
56
+ style={getModalContainerSize(modalVariant)}
57
+ onClose={model.hidePopUp}
58
+ content={
59
+ <ModalContent model={model} textContent={textContent} onPracticePress={onPracticePress} />
60
+ }
61
+ withBackground={withBackground}
62
+ />
63
+ )
64
+ }
@@ -0,0 +1,56 @@
1
+ import React from 'react'
2
+ import { View, StyleSheet } from 'react-native'
3
+ import { Button, COLORS, SPACING, Typography } from '@magmamath/react-native-ui'
4
+
5
+ import { EOAModalContentProps } from '../../types'
6
+
7
+ export const ExamLeave = ({ textContent, model }: EOAModalContentProps) => {
8
+ const handleDismiss = () => model.hidePopUp()
9
+
10
+ return (
11
+ <View style={styles.container}>
12
+ <Typography variant='h1' style={styles.description}>
13
+ {textContent.description}
14
+ </Typography>
15
+
16
+ <View style={styles.buttonsContainer}>
17
+ <Button variant='tertiary' size='large' style={{ text: styles.buttonText }} onPress={handleDismiss}>
18
+ {textContent.leftButtonText}
19
+ </Button>
20
+
21
+ <Button
22
+ variant='primary'
23
+ colorScheme='red'
24
+ size='large'
25
+ style={{ text: styles.buttonText }}
26
+ onPress={model.hidePopUpAndLeave}
27
+ >
28
+ {textContent.rightButtonText}
29
+ </Button>
30
+ </View>
31
+ </View>
32
+ )
33
+ }
34
+
35
+ const styles = StyleSheet.create({
36
+ container: {
37
+ flex: 1,
38
+ gap: SPACING[800],
39
+ paddingTop: SPACING[800],
40
+ alignItems: 'center',
41
+ justifyContent: 'space-between',
42
+ },
43
+ description: {
44
+ textAlign: 'center',
45
+ fontWeight: '700',
46
+ color: COLORS.NEUTRAL_9,
47
+ },
48
+ buttonsContainer: {
49
+ flexDirection: 'row',
50
+ alignItems: 'center',
51
+ gap: SPACING[200],
52
+ },
53
+ buttonText: {
54
+ textTransform: 'uppercase',
55
+ },
56
+ })