Make all face images dynamic

This commit is contained in:
Ruben 2016-09-19 17:25:59 +01:00
parent d525c4938e
commit ff82dce6f8

View file

@ -14,15 +14,15 @@ $printEmoBlocks = function($emotion, $feature, $steps = 6) use($em) {
foreach(range(0, 100, 100/($steps-1)) as $i) { foreach(range(0, 100, 100/($steps-1)) as $i) {
/* @var $hitRepo EmotionHero\Models\HitRepository */ /* @var $hitRepo EmotionHero\Models\HitRepository */
$hitRepo = $em->getRepository(EmotionHero\Models\Hit::class); $hitRepo = $em->getRepository(EmotionHero\Models\Hit::class);
if($feature == 'nose'){ // if($feature == 'nose'){
$items = [992, 1035, 701, 888, 671, 906, 693, 725, 762, 666, 751,992,728]; // $items = [992, 1035, 701, 888, 671, 906, 693, 725, 762, 666, 751,992,728];
$hit = $hitRepo->find($items[array_rand($items)]); // $hit = $hitRepo->find($items[array_rand($items)]);
} elseif($feature == 'mouth_left') { // } elseif($feature == 'mouth_left') {
$items = [992, 1035, 1034, 888]; // $items = [992, 1035, 1034, 888];
$hit = $hitRepo->find($items[array_rand($items)]); // $hit = $hitRepo->find($items[array_rand($items)]);
} else{ // } else{
$hit = $hitRepo->getClosestHitWithImage($emotion, $i); $hit = $hitRepo->getClosestHitWithImage($emotion, $i);
} // }
$img = $hit->getFeatureImgAsString($feature); $img = $hit->getFeatureImgAsString($feature);
$score = $hit->getEmotions()->getEmotionScore($emotion); $score = $hit->getEmotions()->getEmotionScore($emotion);
@ -72,7 +72,7 @@ font-size:80%;
.mouth .emo-block{ .mouth .emo-block{
width:50%; width:50%;
float:left; float:left;
height:12%; height:3.6em;
} }
.mouth .emotitle{ .mouth .emotitle{
display:block; display:block;