getEm(); /* @var $hitRepo EmotionHero\Models\HitRepository */ $hitRepo = $em->getRepository(\EmotionHero\Models\Hit::class); /* @var $currentHit \EmotionHero\Models\Hit */ $currentHit = $hitRepo->findOneBy(['hasImage'=>true], ['id'=>'DESC']); $targetSet = $hitRepo->getTargetSetForTarget($currentHit->getTarget()); $betterHit = $hitRepo->getBetterHit($currentHit); $printEmoBlocks = function($emotion, $feature, $steps = 6) use($em) { foreach(range(0, 100, 100/($steps-1)) as $i) { /* @var $hitRepo EmotionHero\Models\HitRepository */ $hitRepo = $em->getRepository(EmotionHero\Models\Hit::class); // if($feature == 'nose'){ // $items = [992, 1035, 701, 888, 671, 906, 693, 725, 762, 666, 751,992,728]; // $hit = $hitRepo->find($items[array_rand($items)]); // } elseif($feature == 'mouth_left') { // $items = [992, 1035, 1034, 888]; // $hit = $hitRepo->find($items[array_rand($items)]); // } else{ $hit = $hitRepo->getClosestHitWithImage($emotion, $i); // } $img = $hit->getFeatureImgAsString($feature); $score = $hit->getEmotions()->getEmotionScore($emotion); $percentage = sprintf("%.0f %%",$score); echo <<< EOSNIPPET
$percentage
EOSNIPPET; } }; ?> Emotion Hero

eye brows

"; foreach(EmotionHero\Models\Emotions::$EMOTIONS as $emotion) { echo "
$emotion
"; $printEmoBlocks($emotion, 'brows'); //echo "getFeatureImgAsString("brows")}\" title=\"{$currentHit->getId()}\" style=\"top:{$currentHit->getEmotions()->getEmotionScore($emotion)}%\">"; echo "
"; } ?>
  1. Outer Right Brow Corner
  2. Right Brow Center
  3. Inner Right Brow Corner
  4. Inner Left Brow Corner
  5. Left Brow Center
  6. Outer Left Brow Corner
"; // .brows echo "

nose

"; foreach(EmotionHero\Models\Emotions::$EMOTIONS as $emotion) { echo "
$emotion
"; $printEmoBlocks($emotion, 'nose'); //echo "getFeatureImgAsString("nose")}\" title=\"{$currentHit->getId()}\" style=\"top:{$currentHit->getEmotions()->getEmotionScore($emotion)}%\">"; echo "
"; } echo "
"; // .nose echo "

mouth

"; foreach(EmotionHero\Models\Emotions::$EMOTIONS as $emotion) { echo "
$emotion
"; $printEmoBlocks($emotion, 'mouth_left'); echo "
"; } echo "
"; // .mouth echo "
"; echo "

lastvsperfect

"; // echo "

".\PrettyDateTime\PrettyDateTime::parse($currentHit->getGame()->getOriginalGameAt())."

"; echo "

aim:"; foreach($targetSet as $target) { echo " {$target->getScore()}% {$target->getEmotion()->getName()}"; } echo "

"; if(empty($betterHit)) { echo "

Best attempt so far

"; } //echo "

aim: {$currentHit->getTarget()->getScore()}% ".$currentHit->getTarget()->getEmotion()->getName()."

"; echo ""; $circles = ""; if(!empty($betterHit)) { foreach($betterHit->getPoints()->getNormalisedPoints() as $i => $point) { /* $circles .= '';*/ $circles .= ''.$i.''; } } foreach($currentHit->getPoints()->getNormalisedPoints() as $i => $point) { $circles .= ''.$i.''; } echo <<< EOSVG $circles EOSVG; echo "
"; // .currentHit ?>