@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.
- package/dist/commonjs/features/celebrations/components/Celebrations.js +51 -0
- package/dist/commonjs/features/celebrations/components/Celebrations.js.map +1 -0
- package/dist/commonjs/features/celebrations/components/Particle.js +84 -0
- package/dist/commonjs/features/celebrations/components/Particle.js.map +1 -0
- package/dist/commonjs/features/celebrations/components/ParticleBatch.js +45 -0
- package/dist/commonjs/features/celebrations/components/ParticleBatch.js.map +1 -0
- package/dist/commonjs/features/celebrations/components/Spark.js +23 -0
- package/dist/commonjs/features/celebrations/components/Spark.js.map +1 -0
- package/dist/commonjs/features/celebrations/config.js +199 -0
- package/dist/commonjs/features/celebrations/config.js.map +1 -0
- package/dist/commonjs/features/celebrations/helpers.js +94 -0
- package/dist/commonjs/features/celebrations/helpers.js.map +1 -0
- package/dist/commonjs/features/celebrations/index.js +28 -0
- package/dist/commonjs/features/celebrations/index.js.map +1 -0
- package/dist/commonjs/features/celebrations/types.js +15 -0
- package/dist/commonjs/features/celebrations/types.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/components/CheatDetected/CheatDetected.js +58 -0
- package/dist/commonjs/features/endOfAssignment/components/CheatDetected/CheatDetected.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.js +247 -0
- package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js +131 -0
- package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswerSparks.js +56 -0
- package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswerSparks.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/GoodDrawingSparks.js +68 -0
- package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/GoodDrawingSparks.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/Spark.js +53 -0
- package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/Spark.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/components/EOAModal.js +47 -0
- package/dist/commonjs/features/endOfAssignment/components/EOAModal.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/components/ExamLeave/ExamLeave.js +69 -0
- package/dist/commonjs/features/endOfAssignment/components/ExamLeave/ExamLeave.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/components/ExamPaused/ExamPaused.js +55 -0
- package/dist/commonjs/features/endOfAssignment/components/ExamPaused/ExamPaused.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmit.js +102 -0
- package/dist/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmit.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmitContent.js +83 -0
- package/dist/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmitContent.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/components/ExamSubmit/blurred-card.png +0 -0
- package/dist/commonjs/features/endOfAssignment/components/Modal/Modal.js +96 -0
- package/dist/commonjs/features/endOfAssignment/components/Modal/Modal.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/components/Modal/ModalBackground.js +44 -0
- package/dist/commonjs/features/endOfAssignment/components/Modal/ModalBackground.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/components/Modal/assets/SunrisingIcon.js +233 -0
- package/dist/commonjs/features/endOfAssignment/components/Modal/assets/SunrisingIcon.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/components/Modal/assets/TrophyIcon.js +63 -0
- package/dist/commonjs/features/endOfAssignment/components/Modal/assets/TrophyIcon.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/components/Modal/model.js +34 -0
- package/dist/commonjs/features/endOfAssignment/components/Modal/model.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswer.js +91 -0
- package/dist/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswer.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswerContent.js +107 -0
- package/dist/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswerContent.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/constants.js +55 -0
- package/dist/commonjs/features/endOfAssignment/constants.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/helpers.js +64 -0
- package/dist/commonjs/features/endOfAssignment/helpers.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/hooks/useSparkAnimation.js +51 -0
- package/dist/commonjs/features/endOfAssignment/hooks/useSparkAnimation.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/index.js +40 -0
- package/dist/commonjs/features/endOfAssignment/index.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/model/model.js +53 -0
- package/dist/commonjs/features/endOfAssignment/model/model.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/types.js +33 -0
- package/dist/commonjs/features/endOfAssignment/types.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/ui/EOABadge.js +43 -0
- package/dist/commonjs/features/endOfAssignment/ui/EOABadge.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/ui/PracticeButton.js +30 -0
- package/dist/commonjs/features/endOfAssignment/ui/PracticeButton.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/ui/PracticeButtonGroup.js +65 -0
- package/dist/commonjs/features/endOfAssignment/ui/PracticeButtonGroup.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/ui/SparkIcon.js +29 -0
- package/dist/commonjs/features/endOfAssignment/ui/SparkIcon.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/ui/ThumbUpIcon.js +32 -0
- package/dist/commonjs/features/endOfAssignment/ui/ThumbUpIcon.js.map +1 -0
- package/dist/commonjs/index.js +24 -0
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/shared/icons/Halloween.js +54 -0
- package/dist/commonjs/shared/icons/Halloween.js.map +1 -0
- package/dist/commonjs/shared/icons/Pi.js +30 -0
- package/dist/commonjs/shared/icons/Pi.js.map +1 -0
- package/dist/commonjs/shared/icons/Star.js +30 -0
- package/dist/commonjs/shared/icons/Star.js.map +1 -0
- package/dist/commonjs/shared/icons/Valentine.js +30 -0
- package/dist/commonjs/shared/icons/Valentine.js.map +1 -0
- package/dist/commonjs/shared/icons/Winter.js +32 -0
- package/dist/commonjs/shared/icons/Winter.js.map +1 -0
- package/dist/module/features/celebrations/components/Celebrations.js +45 -0
- package/dist/module/features/celebrations/components/Celebrations.js.map +1 -0
- package/dist/module/features/celebrations/components/Particle.js +76 -0
- package/dist/module/features/celebrations/components/Particle.js.map +1 -0
- package/dist/module/features/celebrations/components/ParticleBatch.js +38 -0
- package/dist/module/features/celebrations/components/ParticleBatch.js.map +1 -0
- package/dist/module/features/celebrations/components/Spark.js +17 -0
- package/dist/module/features/celebrations/components/Spark.js.map +1 -0
- package/dist/module/features/celebrations/config.js +194 -0
- package/dist/module/features/celebrations/config.js.map +1 -0
- package/dist/module/features/celebrations/helpers.js +87 -0
- package/dist/module/features/celebrations/helpers.js.map +1 -0
- package/dist/module/features/celebrations/index.js +5 -0
- package/dist/module/features/celebrations/index.js.map +1 -0
- package/dist/module/features/celebrations/types.js +11 -0
- package/dist/module/features/celebrations/types.js.map +1 -0
- package/dist/module/features/endOfAssignment/components/CheatDetected/CheatDetected.js +52 -0
- package/dist/module/features/endOfAssignment/components/CheatDetected/CheatDetected.js.map +1 -0
- package/dist/module/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.js +241 -0
- package/dist/module/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.js.map +1 -0
- package/dist/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js +124 -0
- package/dist/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js.map +1 -0
- package/dist/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswerSparks.js +50 -0
- package/dist/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswerSparks.js.map +1 -0
- package/dist/module/features/endOfAssignment/components/CorrectAnswer/GoodDrawingSparks.js +62 -0
- package/dist/module/features/endOfAssignment/components/CorrectAnswer/GoodDrawingSparks.js.map +1 -0
- package/dist/module/features/endOfAssignment/components/CorrectAnswer/Spark.js +47 -0
- package/dist/module/features/endOfAssignment/components/CorrectAnswer/Spark.js.map +1 -0
- package/dist/module/features/endOfAssignment/components/EOAModal.js +41 -0
- package/dist/module/features/endOfAssignment/components/EOAModal.js.map +1 -0
- package/dist/module/features/endOfAssignment/components/ExamLeave/ExamLeave.js +63 -0
- package/dist/module/features/endOfAssignment/components/ExamLeave/ExamLeave.js.map +1 -0
- package/dist/module/features/endOfAssignment/components/ExamPaused/ExamPaused.js +49 -0
- package/dist/module/features/endOfAssignment/components/ExamPaused/ExamPaused.js.map +1 -0
- package/dist/module/features/endOfAssignment/components/ExamSubmit/ExamSubmit.js +96 -0
- package/dist/module/features/endOfAssignment/components/ExamSubmit/ExamSubmit.js.map +1 -0
- package/dist/module/features/endOfAssignment/components/ExamSubmit/ExamSubmitContent.js +77 -0
- package/dist/module/features/endOfAssignment/components/ExamSubmit/ExamSubmitContent.js.map +1 -0
- package/dist/module/features/endOfAssignment/components/ExamSubmit/blurred-card.png +0 -0
- package/dist/module/features/endOfAssignment/components/Modal/Modal.js +89 -0
- package/dist/module/features/endOfAssignment/components/Modal/Modal.js.map +1 -0
- package/dist/module/features/endOfAssignment/components/Modal/ModalBackground.js +38 -0
- package/dist/module/features/endOfAssignment/components/Modal/ModalBackground.js.map +1 -0
- package/dist/module/features/endOfAssignment/components/Modal/assets/SunrisingIcon.js +226 -0
- package/dist/module/features/endOfAssignment/components/Modal/assets/SunrisingIcon.js.map +1 -0
- package/dist/module/features/endOfAssignment/components/Modal/assets/TrophyIcon.js +56 -0
- package/dist/module/features/endOfAssignment/components/Modal/assets/TrophyIcon.js.map +1 -0
- package/dist/module/features/endOfAssignment/components/Modal/model.js +29 -0
- package/dist/module/features/endOfAssignment/components/Modal/model.js.map +1 -0
- package/dist/module/features/endOfAssignment/components/NoAnswer/NoAnswer.js +85 -0
- package/dist/module/features/endOfAssignment/components/NoAnswer/NoAnswer.js.map +1 -0
- package/dist/module/features/endOfAssignment/components/NoAnswer/NoAnswerContent.js +100 -0
- package/dist/module/features/endOfAssignment/components/NoAnswer/NoAnswerContent.js.map +1 -0
- package/dist/module/features/endOfAssignment/constants.js +51 -0
- package/dist/module/features/endOfAssignment/constants.js.map +1 -0
- package/dist/module/features/endOfAssignment/helpers.js +58 -0
- package/dist/module/features/endOfAssignment/helpers.js.map +1 -0
- package/dist/module/features/endOfAssignment/hooks/useSparkAnimation.js +46 -0
- package/dist/module/features/endOfAssignment/hooks/useSparkAnimation.js.map +1 -0
- package/dist/module/features/endOfAssignment/index.js +6 -0
- package/dist/module/features/endOfAssignment/index.js.map +1 -0
- package/dist/module/features/endOfAssignment/model/model.js +48 -0
- package/dist/module/features/endOfAssignment/model/model.js.map +1 -0
- package/dist/module/features/endOfAssignment/types.js +29 -0
- package/dist/module/features/endOfAssignment/types.js.map +1 -0
- package/dist/module/features/endOfAssignment/ui/EOABadge.js +37 -0
- package/dist/module/features/endOfAssignment/ui/EOABadge.js.map +1 -0
- package/dist/module/features/endOfAssignment/ui/PracticeButton.js +24 -0
- package/dist/module/features/endOfAssignment/ui/PracticeButton.js.map +1 -0
- package/dist/module/features/endOfAssignment/ui/PracticeButtonGroup.js +58 -0
- package/dist/module/features/endOfAssignment/ui/PracticeButtonGroup.js.map +1 -0
- package/dist/module/features/endOfAssignment/ui/SparkIcon.js +21 -0
- package/dist/module/features/endOfAssignment/ui/SparkIcon.js.map +1 -0
- package/dist/module/features/endOfAssignment/ui/ThumbUpIcon.js +24 -0
- package/dist/module/features/endOfAssignment/ui/ThumbUpIcon.js.map +1 -0
- package/dist/module/index.js +2 -0
- package/dist/module/index.js.map +1 -1
- package/dist/module/shared/icons/Halloween.js +47 -0
- package/dist/module/shared/icons/Halloween.js.map +1 -0
- package/dist/module/shared/icons/Pi.js +23 -0
- package/dist/module/shared/icons/Pi.js.map +1 -0
- package/dist/module/shared/icons/Star.js +23 -0
- package/dist/module/shared/icons/Star.js.map +1 -0
- package/dist/module/shared/icons/Valentine.js +23 -0
- package/dist/module/shared/icons/Valentine.js.map +1 -0
- package/dist/module/shared/icons/Winter.js +25 -0
- package/dist/module/shared/icons/Winter.js.map +1 -0
- package/dist/typescript/commonjs/features/celebrations/components/Celebrations.d.ts +10 -0
- package/dist/typescript/commonjs/features/celebrations/components/Celebrations.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/celebrations/components/Particle.d.ts +19 -0
- package/dist/typescript/commonjs/features/celebrations/components/Particle.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/celebrations/components/ParticleBatch.d.ts +26 -0
- package/dist/typescript/commonjs/features/celebrations/components/ParticleBatch.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/celebrations/components/Spark.d.ts +4 -0
- package/dist/typescript/commonjs/features/celebrations/components/Spark.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/celebrations/config.d.ts +167 -0
- package/dist/typescript/commonjs/features/celebrations/config.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/celebrations/helpers.d.ts +6 -0
- package/dist/typescript/commonjs/features/celebrations/helpers.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/celebrations/index.d.ts +3 -0
- package/dist/typescript/commonjs/features/celebrations/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/celebrations/types.d.ts +11 -0
- package/dist/typescript/commonjs/features/celebrations/types.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/CheatDetected/CheatDetected.d.ts +4 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/CheatDetected/CheatDetected.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.d.ts +15 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.d.ts +4 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswerSparks.d.ts +8 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswerSparks.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/GoodDrawingSparks.d.ts +8 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/GoodDrawingSparks.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/Spark.d.ts +12 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/Spark.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/EOAModal.d.ts +11 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/EOAModal.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/ExamLeave/ExamLeave.d.ts +4 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/ExamLeave/ExamLeave.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/ExamPaused/ExamPaused.d.ts +4 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/ExamPaused/ExamPaused.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmit.d.ts +4 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmit.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmitContent.d.ts +8 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmitContent.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/Modal.d.ts +20 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/Modal.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/ModalBackground.d.ts +3 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/ModalBackground.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/assets/SunrisingIcon.d.ts +4 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/assets/SunrisingIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/assets/TrophyIcon.d.ts +4 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/assets/TrophyIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/model.d.ts +14 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/model.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswer.d.ts +4 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswer.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswerContent.d.ts +8 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswerContent.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/constants.d.ts +41 -0
- package/dist/typescript/commonjs/features/endOfAssignment/constants.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/helpers.d.ts +9 -0
- package/dist/typescript/commonjs/features/endOfAssignment/helpers.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/hooks/useSparkAnimation.d.ts +27 -0
- package/dist/typescript/commonjs/features/endOfAssignment/hooks/useSparkAnimation.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/index.d.ts +4 -0
- package/dist/typescript/commonjs/features/endOfAssignment/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/model/model.d.ts +14 -0
- package/dist/typescript/commonjs/features/endOfAssignment/model/model.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/types.d.ts +60 -0
- package/dist/typescript/commonjs/features/endOfAssignment/types.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/ui/EOABadge.d.ts +11 -0
- package/dist/typescript/commonjs/features/endOfAssignment/ui/EOABadge.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/ui/PracticeButton.d.ts +10 -0
- package/dist/typescript/commonjs/features/endOfAssignment/ui/PracticeButton.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/ui/PracticeButtonGroup.d.ts +14 -0
- package/dist/typescript/commonjs/features/endOfAssignment/ui/PracticeButtonGroup.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/ui/SparkIcon.d.ts +4 -0
- package/dist/typescript/commonjs/features/endOfAssignment/ui/SparkIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/ui/ThumbUpIcon.d.ts +4 -0
- package/dist/typescript/commonjs/features/endOfAssignment/ui/ThumbUpIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/index.d.ts +2 -0
- package/dist/typescript/commonjs/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/icons/Halloween.d.ts +5 -0
- package/dist/typescript/commonjs/shared/icons/Halloween.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/Pi.d.ts +5 -0
- package/dist/typescript/commonjs/shared/icons/Pi.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/Star.d.ts +5 -0
- package/dist/typescript/commonjs/shared/icons/Star.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/Valentine.d.ts +5 -0
- package/dist/typescript/commonjs/shared/icons/Valentine.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/Winter.d.ts +5 -0
- package/dist/typescript/commonjs/shared/icons/Winter.d.ts.map +1 -0
- package/dist/typescript/module/features/celebrations/components/Celebrations.d.ts +10 -0
- package/dist/typescript/module/features/celebrations/components/Celebrations.d.ts.map +1 -0
- package/dist/typescript/module/features/celebrations/components/Particle.d.ts +19 -0
- package/dist/typescript/module/features/celebrations/components/Particle.d.ts.map +1 -0
- package/dist/typescript/module/features/celebrations/components/ParticleBatch.d.ts +26 -0
- package/dist/typescript/module/features/celebrations/components/ParticleBatch.d.ts.map +1 -0
- package/dist/typescript/module/features/celebrations/components/Spark.d.ts +4 -0
- package/dist/typescript/module/features/celebrations/components/Spark.d.ts.map +1 -0
- package/dist/typescript/module/features/celebrations/config.d.ts +167 -0
- package/dist/typescript/module/features/celebrations/config.d.ts.map +1 -0
- package/dist/typescript/module/features/celebrations/helpers.d.ts +6 -0
- package/dist/typescript/module/features/celebrations/helpers.d.ts.map +1 -0
- package/dist/typescript/module/features/celebrations/index.d.ts +3 -0
- package/dist/typescript/module/features/celebrations/index.d.ts.map +1 -0
- package/dist/typescript/module/features/celebrations/types.d.ts +11 -0
- package/dist/typescript/module/features/celebrations/types.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/components/CheatDetected/CheatDetected.d.ts +4 -0
- package/dist/typescript/module/features/endOfAssignment/components/CheatDetected/CheatDetected.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.d.ts +15 -0
- package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.d.ts +4 -0
- package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswerSparks.d.ts +8 -0
- package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswerSparks.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/GoodDrawingSparks.d.ts +8 -0
- package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/GoodDrawingSparks.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/Spark.d.ts +12 -0
- package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/Spark.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/components/EOAModal.d.ts +11 -0
- package/dist/typescript/module/features/endOfAssignment/components/EOAModal.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/components/ExamLeave/ExamLeave.d.ts +4 -0
- package/dist/typescript/module/features/endOfAssignment/components/ExamLeave/ExamLeave.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/components/ExamPaused/ExamPaused.d.ts +4 -0
- package/dist/typescript/module/features/endOfAssignment/components/ExamPaused/ExamPaused.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/components/ExamSubmit/ExamSubmit.d.ts +4 -0
- package/dist/typescript/module/features/endOfAssignment/components/ExamSubmit/ExamSubmit.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/components/ExamSubmit/ExamSubmitContent.d.ts +8 -0
- package/dist/typescript/module/features/endOfAssignment/components/ExamSubmit/ExamSubmitContent.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/components/Modal/Modal.d.ts +20 -0
- package/dist/typescript/module/features/endOfAssignment/components/Modal/Modal.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/components/Modal/ModalBackground.d.ts +3 -0
- package/dist/typescript/module/features/endOfAssignment/components/Modal/ModalBackground.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/components/Modal/assets/SunrisingIcon.d.ts +4 -0
- package/dist/typescript/module/features/endOfAssignment/components/Modal/assets/SunrisingIcon.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/components/Modal/assets/TrophyIcon.d.ts +4 -0
- package/dist/typescript/module/features/endOfAssignment/components/Modal/assets/TrophyIcon.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/components/Modal/model.d.ts +14 -0
- package/dist/typescript/module/features/endOfAssignment/components/Modal/model.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/components/NoAnswer/NoAnswer.d.ts +4 -0
- package/dist/typescript/module/features/endOfAssignment/components/NoAnswer/NoAnswer.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/components/NoAnswer/NoAnswerContent.d.ts +8 -0
- package/dist/typescript/module/features/endOfAssignment/components/NoAnswer/NoAnswerContent.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/constants.d.ts +41 -0
- package/dist/typescript/module/features/endOfAssignment/constants.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/helpers.d.ts +9 -0
- package/dist/typescript/module/features/endOfAssignment/helpers.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/hooks/useSparkAnimation.d.ts +27 -0
- package/dist/typescript/module/features/endOfAssignment/hooks/useSparkAnimation.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/index.d.ts +4 -0
- package/dist/typescript/module/features/endOfAssignment/index.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/model/model.d.ts +14 -0
- package/dist/typescript/module/features/endOfAssignment/model/model.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/types.d.ts +60 -0
- package/dist/typescript/module/features/endOfAssignment/types.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/ui/EOABadge.d.ts +11 -0
- package/dist/typescript/module/features/endOfAssignment/ui/EOABadge.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/ui/PracticeButton.d.ts +10 -0
- package/dist/typescript/module/features/endOfAssignment/ui/PracticeButton.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/ui/PracticeButtonGroup.d.ts +14 -0
- package/dist/typescript/module/features/endOfAssignment/ui/PracticeButtonGroup.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/ui/SparkIcon.d.ts +4 -0
- package/dist/typescript/module/features/endOfAssignment/ui/SparkIcon.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/ui/ThumbUpIcon.d.ts +4 -0
- package/dist/typescript/module/features/endOfAssignment/ui/ThumbUpIcon.d.ts.map +1 -0
- package/dist/typescript/module/index.d.ts +2 -0
- package/dist/typescript/module/index.d.ts.map +1 -1
- package/dist/typescript/module/shared/icons/Halloween.d.ts +5 -0
- package/dist/typescript/module/shared/icons/Halloween.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/Pi.d.ts +5 -0
- package/dist/typescript/module/shared/icons/Pi.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/Star.d.ts +5 -0
- package/dist/typescript/module/shared/icons/Star.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/Valentine.d.ts +5 -0
- package/dist/typescript/module/shared/icons/Valentine.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/Winter.d.ts +5 -0
- package/dist/typescript/module/shared/icons/Winter.d.ts.map +1 -0
- package/package.json +3 -1
- package/src/features/celebrations/components/Celebrations.tsx +62 -0
- package/src/features/celebrations/components/Particle.tsx +99 -0
- package/src/features/celebrations/components/ParticleBatch.tsx +56 -0
- package/src/features/celebrations/components/Spark.tsx +14 -0
- package/src/features/celebrations/config.ts +199 -0
- package/src/features/celebrations/helpers.ts +96 -0
- package/src/features/celebrations/index.ts +2 -0
- package/src/features/celebrations/types.ts +11 -0
- package/src/features/endOfAssignment/components/CheatDetected/CheatDetected.tsx +48 -0
- package/src/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.tsx +293 -0
- package/src/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.tsx +128 -0
- package/src/features/endOfAssignment/components/CorrectAnswer/CorrectAnswerSparks.tsx +39 -0
- package/src/features/endOfAssignment/components/CorrectAnswer/GoodDrawingSparks.tsx +40 -0
- package/src/features/endOfAssignment/components/CorrectAnswer/Spark.tsx +45 -0
- package/src/features/endOfAssignment/components/EOAModal.tsx +64 -0
- package/src/features/endOfAssignment/components/ExamLeave/ExamLeave.tsx +56 -0
- package/src/features/endOfAssignment/components/ExamPaused/ExamPaused.tsx +46 -0
- package/src/features/endOfAssignment/components/ExamSubmit/ExamSubmit.tsx +102 -0
- package/src/features/endOfAssignment/components/ExamSubmit/ExamSubmitContent.tsx +69 -0
- package/src/features/endOfAssignment/components/ExamSubmit/blurred-card.png +0 -0
- package/src/features/endOfAssignment/components/Modal/Modal.tsx +105 -0
- package/src/features/endOfAssignment/components/Modal/ModalBackground.tsx +33 -0
- package/src/features/endOfAssignment/components/Modal/assets/SunrisingIcon.tsx +196 -0
- package/src/features/endOfAssignment/components/Modal/assets/TrophyIcon.tsx +62 -0
- package/src/features/endOfAssignment/components/Modal/model.ts +34 -0
- package/src/features/endOfAssignment/components/NoAnswer/NoAnswer.tsx +85 -0
- package/src/features/endOfAssignment/components/NoAnswer/NoAnswerContent.tsx +107 -0
- package/src/features/endOfAssignment/constants.ts +53 -0
- package/src/features/endOfAssignment/helpers.ts +28 -0
- package/src/features/endOfAssignment/hooks/useSparkAnimation.tsx +78 -0
- package/src/features/endOfAssignment/index.ts +3 -0
- package/src/features/endOfAssignment/model/model.ts +57 -0
- package/src/features/endOfAssignment/types.ts +65 -0
- package/src/features/endOfAssignment/ui/EOABadge.tsx +47 -0
- package/src/features/endOfAssignment/ui/PracticeButton.tsx +27 -0
- package/src/features/endOfAssignment/ui/PracticeButtonGroup.tsx +75 -0
- package/src/features/endOfAssignment/ui/SparkIcon.tsx +15 -0
- package/src/features/endOfAssignment/ui/ThumbUpIcon.tsx +17 -0
- package/src/index.ts +2 -0
- package/src/shared/icons/Halloween.tsx +33 -0
- package/src/shared/icons/Pi.tsx +16 -0
- package/src/shared/icons/Star.tsx +16 -0
- package/src/shared/icons/Valentine.tsx +16 -0
- 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
|
+
})
|