@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,56 @@
|
|
|
1
|
+
import React, { useState, useEffect, ComponentType } from 'react'
|
|
2
|
+
import { IconProps } from '@magmamath/react-native-ui'
|
|
3
|
+
import { CELEBRATION_VARIANTS } from '../config'
|
|
4
|
+
import { generateParticle } from '../helpers'
|
|
5
|
+
import { Particle } from './Particle'
|
|
6
|
+
import { CelebrationVariant } from '../types'
|
|
7
|
+
|
|
8
|
+
export type ParticlesBatch = {
|
|
9
|
+
id: number
|
|
10
|
+
type: 'main' | 'spark'
|
|
11
|
+
angle: number
|
|
12
|
+
velocity: {
|
|
13
|
+
x: number
|
|
14
|
+
y: number
|
|
15
|
+
}
|
|
16
|
+
angularAcceleration: number
|
|
17
|
+
friction: number
|
|
18
|
+
Component: ComponentType<IconProps>
|
|
19
|
+
rotation: number
|
|
20
|
+
rotationSpeed: number
|
|
21
|
+
size: number
|
|
22
|
+
life: number
|
|
23
|
+
}
|
|
24
|
+
export type ParticleBatchProps = {
|
|
25
|
+
containerWidth: number
|
|
26
|
+
onAnimationEnd: () => void
|
|
27
|
+
variant: CelebrationVariant
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const ParticleBatch = ({ containerWidth, onAnimationEnd, variant }: ParticleBatchProps) => {
|
|
31
|
+
const [particles, setParticles] = useState<ParticlesBatch[]>([])
|
|
32
|
+
const { color } = CELEBRATION_VARIANTS[variant]
|
|
33
|
+
const xOffset = containerWidth ? containerWidth / 2 : 0
|
|
34
|
+
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
setParticles(generateParticle(variant))
|
|
37
|
+
}, [])
|
|
38
|
+
|
|
39
|
+
return particles.map((p, i) => (
|
|
40
|
+
<Particle
|
|
41
|
+
key={p.id}
|
|
42
|
+
onAnimationEnd={i === 0 ? onAnimationEnd : undefined}
|
|
43
|
+
initialPreset={{
|
|
44
|
+
velocity: p.velocity,
|
|
45
|
+
angularAcceleration: p.angularAcceleration,
|
|
46
|
+
friction: p.friction,
|
|
47
|
+
rotationSpeed: p.rotationSpeed,
|
|
48
|
+
rotation: p.rotation,
|
|
49
|
+
life: p.life,
|
|
50
|
+
xOffset,
|
|
51
|
+
}}
|
|
52
|
+
>
|
|
53
|
+
{<p.Component size={p.size} color={color} />}
|
|
54
|
+
</Particle>
|
|
55
|
+
))
|
|
56
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IconProps } from '@magmamath/react-native-ui';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { View } from 'react-native';
|
|
4
|
+
|
|
5
|
+
export const Spark = ({ size = 10, color }: IconProps) => (
|
|
6
|
+
<View
|
|
7
|
+
style={{
|
|
8
|
+
width: size,
|
|
9
|
+
height: size,
|
|
10
|
+
backgroundColor: color,
|
|
11
|
+
borderRadius: size / 2,
|
|
12
|
+
}}
|
|
13
|
+
/>
|
|
14
|
+
);
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import StarIcon from '../../shared/icons/Star';
|
|
2
|
+
import HalloweenIcon from '../../shared/icons/Halloween';
|
|
3
|
+
import PiIcon from '../../shared/icons/Pi';
|
|
4
|
+
import WinterIcon from '../../shared/icons/Winter';
|
|
5
|
+
import ValentineIcon from '../../shared/icons/Valentine';
|
|
6
|
+
import { COLORS } from '@magmamath/react-native-ui';
|
|
7
|
+
import { CelebrationVariant } from './types';
|
|
8
|
+
|
|
9
|
+
export const CELEBRATION_ICON_CONFIG = [
|
|
10
|
+
{
|
|
11
|
+
name: 'default',
|
|
12
|
+
Icon: StarIcon,
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: 'pi-day',
|
|
16
|
+
Icon: PiIcon,
|
|
17
|
+
activePeriod: {
|
|
18
|
+
start: '14-03',
|
|
19
|
+
end: '14-03',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: 'valentine',
|
|
24
|
+
Icon: ValentineIcon,
|
|
25
|
+
activePeriod: {
|
|
26
|
+
start: '07-02',
|
|
27
|
+
end: '15-02',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'halloween',
|
|
32
|
+
Icon: HalloweenIcon,
|
|
33
|
+
activePeriod: {
|
|
34
|
+
start: '20-10',
|
|
35
|
+
end: '01-11',
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'winter',
|
|
40
|
+
Icon: WinterIcon,
|
|
41
|
+
activePeriod: {
|
|
42
|
+
start: '01-12',
|
|
43
|
+
end: '07-01',
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
];
|
|
47
|
+
|
|
48
|
+
export const CELEBRATION_VARIANTS = {
|
|
49
|
+
[CelebrationVariant.FIRST_ATTEMPT]: {
|
|
50
|
+
color: COLORS.PRIMARY_GREEN,
|
|
51
|
+
elementsCount: {
|
|
52
|
+
star: 5,
|
|
53
|
+
spark: 4,
|
|
54
|
+
},
|
|
55
|
+
sparkSize: {
|
|
56
|
+
from: 4,
|
|
57
|
+
to: 9,
|
|
58
|
+
},
|
|
59
|
+
mainSize: {
|
|
60
|
+
from: 14,
|
|
61
|
+
to: 20,
|
|
62
|
+
},
|
|
63
|
+
angle: {
|
|
64
|
+
from: 230,
|
|
65
|
+
to: 280,
|
|
66
|
+
},
|
|
67
|
+
velocityMultiplier: 1,
|
|
68
|
+
rotation: {
|
|
69
|
+
from: 0,
|
|
70
|
+
to: 10,
|
|
71
|
+
},
|
|
72
|
+
friction: 0.907,
|
|
73
|
+
angularAcceleration: {
|
|
74
|
+
from: -0.05,
|
|
75
|
+
to: 0.05,
|
|
76
|
+
},
|
|
77
|
+
life: 65,
|
|
78
|
+
},
|
|
79
|
+
[CelebrationVariant.CORRECT]: {
|
|
80
|
+
color: COLORS.PRIMARY_YELLOW,
|
|
81
|
+
elementsCount: {
|
|
82
|
+
star: 4,
|
|
83
|
+
spark: 3,
|
|
84
|
+
},
|
|
85
|
+
sparkSize: {
|
|
86
|
+
from: 4,
|
|
87
|
+
to: 9,
|
|
88
|
+
},
|
|
89
|
+
mainSize: {
|
|
90
|
+
from: 14,
|
|
91
|
+
to: 20,
|
|
92
|
+
},
|
|
93
|
+
angle: {
|
|
94
|
+
from: 235,
|
|
95
|
+
to: 270,
|
|
96
|
+
},
|
|
97
|
+
velocityMultiplier: 1,
|
|
98
|
+
rotation: {
|
|
99
|
+
from: 0,
|
|
100
|
+
to: 10,
|
|
101
|
+
},
|
|
102
|
+
friction: 0.907,
|
|
103
|
+
angularAcceleration: {
|
|
104
|
+
from: -0.05,
|
|
105
|
+
to: 0.05,
|
|
106
|
+
},
|
|
107
|
+
life: 65,
|
|
108
|
+
},
|
|
109
|
+
[CelebrationVariant.GBD]: {
|
|
110
|
+
color: COLORS.PRIMARY_ORANGE,
|
|
111
|
+
elementsCount: {
|
|
112
|
+
star: 14,
|
|
113
|
+
spark: 12,
|
|
114
|
+
},
|
|
115
|
+
sparkSize: {
|
|
116
|
+
from: 6,
|
|
117
|
+
to: 12,
|
|
118
|
+
},
|
|
119
|
+
mainSize: {
|
|
120
|
+
from: 33,
|
|
121
|
+
to: 44,
|
|
122
|
+
},
|
|
123
|
+
angle: {
|
|
124
|
+
from: 30,
|
|
125
|
+
to: 330,
|
|
126
|
+
},
|
|
127
|
+
velocityMultiplier: 2,
|
|
128
|
+
rotation: {
|
|
129
|
+
from: 5,
|
|
130
|
+
to: 10,
|
|
131
|
+
},
|
|
132
|
+
friction: 0.925,
|
|
133
|
+
angularAcceleration: {
|
|
134
|
+
from: -0.03,
|
|
135
|
+
to: 0.03,
|
|
136
|
+
},
|
|
137
|
+
life: 120,
|
|
138
|
+
},
|
|
139
|
+
[CelebrationVariant.GBD_FINISH_ASSIGNMENT]: {
|
|
140
|
+
color: COLORS.PRIMARY_ORANGE,
|
|
141
|
+
elementsCount: {
|
|
142
|
+
star: 20,
|
|
143
|
+
spark: 16,
|
|
144
|
+
},
|
|
145
|
+
sparkSize: {
|
|
146
|
+
from: 4,
|
|
147
|
+
to: 16,
|
|
148
|
+
},
|
|
149
|
+
mainSize: {
|
|
150
|
+
from: 16,
|
|
151
|
+
to: 32,
|
|
152
|
+
},
|
|
153
|
+
angle: {
|
|
154
|
+
from: 180,
|
|
155
|
+
to: 360,
|
|
156
|
+
},
|
|
157
|
+
velocityMultiplier: 1.8,
|
|
158
|
+
rotation: {
|
|
159
|
+
from: 0,
|
|
160
|
+
to: 10,
|
|
161
|
+
},
|
|
162
|
+
friction: 0.95,
|
|
163
|
+
angularAcceleration: {
|
|
164
|
+
from: -0.05,
|
|
165
|
+
to: 0.05,
|
|
166
|
+
},
|
|
167
|
+
life: 100,
|
|
168
|
+
},
|
|
169
|
+
[CelebrationVariant.CORRECT_FINISH_ASSIGNMENT]: {
|
|
170
|
+
color: COLORS.PRIMARY_GREEN,
|
|
171
|
+
elementsCount: {
|
|
172
|
+
star: 20,
|
|
173
|
+
spark: 16,
|
|
174
|
+
},
|
|
175
|
+
sparkSize: {
|
|
176
|
+
from: 4,
|
|
177
|
+
to: 16,
|
|
178
|
+
},
|
|
179
|
+
mainSize: {
|
|
180
|
+
from: 16,
|
|
181
|
+
to: 32,
|
|
182
|
+
},
|
|
183
|
+
angle: {
|
|
184
|
+
from: 180,
|
|
185
|
+
to: 360,
|
|
186
|
+
},
|
|
187
|
+
velocityMultiplier: 1.8,
|
|
188
|
+
rotation: {
|
|
189
|
+
from: 0,
|
|
190
|
+
to: 10,
|
|
191
|
+
},
|
|
192
|
+
friction: 0.95,
|
|
193
|
+
angularAcceleration: {
|
|
194
|
+
from: -0.05,
|
|
195
|
+
to: 0.05,
|
|
196
|
+
},
|
|
197
|
+
life: 100,
|
|
198
|
+
},
|
|
199
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { ParticlesBatch } from './components/ParticleBatch';
|
|
2
|
+
import { Spark } from './components/Spark';
|
|
3
|
+
import { CELEBRATION_ICON_CONFIG, CELEBRATION_VARIANTS } from './config';
|
|
4
|
+
import { CelebrationVariant } from './types';
|
|
5
|
+
|
|
6
|
+
export const randomRange = (min: number, max: number) => Math.random() * (max - min) + min;
|
|
7
|
+
|
|
8
|
+
const isDateInRange = (currentDate: Date, startDateStr: string, endDateStr: string) => {
|
|
9
|
+
const [startDay, startMonth] = startDateStr.split('-').map(Number);
|
|
10
|
+
const [endDay, endMonth] = endDateStr.split('-').map(Number);
|
|
11
|
+
|
|
12
|
+
const currentYear = currentDate.getFullYear();
|
|
13
|
+
const startDate = new Date(currentYear, startMonth - 1, startDay);
|
|
14
|
+
const endDate = new Date(currentYear, endMonth - 1, endDay + 1);
|
|
15
|
+
|
|
16
|
+
return currentDate >= startDate && currentDate <= endDate;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const getIconForCurrentDate = () => {
|
|
20
|
+
const currentDate = new Date();
|
|
21
|
+
|
|
22
|
+
for (const celebration of CELEBRATION_ICON_CONFIG) {
|
|
23
|
+
if (celebration.activePeriod) {
|
|
24
|
+
const { start, end } = celebration.activePeriod;
|
|
25
|
+
if (isDateInRange(currentDate, start, end)) {
|
|
26
|
+
return celebration.Icon;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return CELEBRATION_ICON_CONFIG[0].Icon;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const MainIcon = getIconForCurrentDate();
|
|
35
|
+
export const generateParticle = (variant: CelebrationVariant) => {
|
|
36
|
+
const {
|
|
37
|
+
elementsCount,
|
|
38
|
+
angle,
|
|
39
|
+
rotation,
|
|
40
|
+
sparkSize,
|
|
41
|
+
mainSize,
|
|
42
|
+
velocityMultiplier,
|
|
43
|
+
friction,
|
|
44
|
+
life,
|
|
45
|
+
angularAcceleration,
|
|
46
|
+
} = CELEBRATION_VARIANTS[variant];
|
|
47
|
+
|
|
48
|
+
const particles: ParticlesBatch[] = [];
|
|
49
|
+
|
|
50
|
+
for (let i = 0; i < elementsCount.spark; i++) {
|
|
51
|
+
const randomAngle = randomRange((angle.from * Math.PI) / 180, (angle.to * Math.PI) / 180);
|
|
52
|
+
const randomSpeed = randomRange(4, 18);
|
|
53
|
+
const randomAngularAcceleration = randomRange(angularAcceleration.from, angularAcceleration.to);
|
|
54
|
+
|
|
55
|
+
particles.push({
|
|
56
|
+
id: Math.random(),
|
|
57
|
+
size: randomRange(sparkSize.from, sparkSize.to),
|
|
58
|
+
type: 'spark',
|
|
59
|
+
angle: randomAngle,
|
|
60
|
+
velocity: {
|
|
61
|
+
x: Math.cos(randomAngle) * randomSpeed * velocityMultiplier,
|
|
62
|
+
y: Math.sin(randomAngle) * randomSpeed,
|
|
63
|
+
},
|
|
64
|
+
rotation: 0,
|
|
65
|
+
rotationSpeed: 0,
|
|
66
|
+
angularAcceleration: randomAngularAcceleration,
|
|
67
|
+
friction,
|
|
68
|
+
Component: Spark,
|
|
69
|
+
life,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
for (let i = 0; i < elementsCount.star; i++) {
|
|
73
|
+
const randomAngle = randomRange((angle.from * Math.PI) / 180, (angle.to * Math.PI) / 180);
|
|
74
|
+
const randomSpeed = randomRange(4, 18);
|
|
75
|
+
const randomAngularAcceleration = randomRange(angularAcceleration.from, angularAcceleration.to);
|
|
76
|
+
|
|
77
|
+
particles.push({
|
|
78
|
+
id: Math.random(),
|
|
79
|
+
size: randomRange(mainSize.from, mainSize.to),
|
|
80
|
+
type: 'main',
|
|
81
|
+
angle: randomAngle,
|
|
82
|
+
velocity: {
|
|
83
|
+
x: Math.cos(randomAngle) * randomSpeed * velocityMultiplier,
|
|
84
|
+
y: Math.sin(randomAngle) * randomSpeed,
|
|
85
|
+
},
|
|
86
|
+
rotation: randomRange(rotation.from, rotation.to),
|
|
87
|
+
rotationSpeed: randomRange(-2, 2),
|
|
88
|
+
angularAcceleration: randomAngularAcceleration,
|
|
89
|
+
friction,
|
|
90
|
+
Component: MainIcon,
|
|
91
|
+
life,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return particles;
|
|
96
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export enum CelebrationVariant {
|
|
2
|
+
FIRST_ATTEMPT = 'firstAttempt',
|
|
3
|
+
CORRECT = 'correct',
|
|
4
|
+
GBD = 'gbd',
|
|
5
|
+
CORRECT_FINISH_ASSIGNMENT = 'correctFinishAssignment',
|
|
6
|
+
GBD_FINISH_ASSIGNMENT = 'gbdFinishAssignment',
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export type CelebrationsRef = {
|
|
10
|
+
play: (variant: CelebrationVariant) => void;
|
|
11
|
+
} | null;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { View, StyleSheet } from 'react-native'
|
|
3
|
+
import { Button, SPACING, COLORS, Typography } from '@magmamath/react-native-ui'
|
|
4
|
+
import { EOAModalContentProps } from '../../types'
|
|
5
|
+
|
|
6
|
+
export const CheatDetected = ({ textContent, model }: EOAModalContentProps) => {
|
|
7
|
+
return (
|
|
8
|
+
<View style={styles.container}>
|
|
9
|
+
<Typography variant='h2' style={styles.title}>
|
|
10
|
+
{textContent.title}
|
|
11
|
+
</Typography>
|
|
12
|
+
|
|
13
|
+
<Typography variant='h1' style={styles.description}>
|
|
14
|
+
{textContent.description}
|
|
15
|
+
</Typography>
|
|
16
|
+
|
|
17
|
+
<Button
|
|
18
|
+
variant='primary'
|
|
19
|
+
colorScheme='red'
|
|
20
|
+
size='large'
|
|
21
|
+
style={{ text: styles.buttonText }}
|
|
22
|
+
onPress={model.hidePopUpAndLeave}
|
|
23
|
+
>
|
|
24
|
+
{textContent.leftButtonText}
|
|
25
|
+
</Button>
|
|
26
|
+
</View>
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const styles = StyleSheet.create({
|
|
31
|
+
container: {
|
|
32
|
+
flex: 1,
|
|
33
|
+
gap: SPACING[800],
|
|
34
|
+
alignItems: 'center',
|
|
35
|
+
justifyContent: 'space-between',
|
|
36
|
+
},
|
|
37
|
+
title: {
|
|
38
|
+
color: COLORS.NEUTRAL_9,
|
|
39
|
+
},
|
|
40
|
+
description: {
|
|
41
|
+
color: COLORS.NEUTRAL_9,
|
|
42
|
+
textAlign: 'center',
|
|
43
|
+
fontWeight: '700',
|
|
44
|
+
},
|
|
45
|
+
buttonText: {
|
|
46
|
+
textTransform: 'uppercase',
|
|
47
|
+
},
|
|
48
|
+
})
|