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']);
$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 "
";
}
?>
- Outer Right Brow Corner
- Right Brow Center
- Inner Right Brow Corner
- Inner Left Brow Corner
- Left Brow Center
- 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: {$currentHit->getTarget()->getScore()}% ".$currentHit->getTarget()->getEmotion()->getName()."
";
echo "
";
$expressions = array_keys($currentHit->getExpressions()::$EXPRESSIONS_2ND_PERSON);
sort($expressions);
foreach($expressions as $expression) {
$currentScore = $currentHit->getExpressions()->getExpressionScore($expression);
$betterScore = $betterHit->getExpressions()->getExpressionScore($expression);
$diff = $betterScore - $currentScore;
if($diff > 0) {
$diffclass = "positive";
}elseif($diff < 0) {
$diffclass = "negative";
}
echo "- ";
echo "$expression";
echo "". sprintf("%.5f", $currentScore)." %";
echo "". sprintf("%+.5f", $diff)." %";
echo "
";
}
echo "
";
$circles = "";
foreach($betterHit->getPoints()->getNormalisedPoints() as $i => $point) {
/* $circles .= '
';*/
$circles .= '
'.$i.'';
}
foreach($currentHit->getPoints()->getNormalisedPoints() as $i => $point) {
$circles .= '
'.$i.'';
}
echo <<< EOSVG
EOSVG;
echo "
"; // .currentHit
?>