aboutsummaryrefslogtreecommitdiff
path: root/client/src/view/index/Index.scala
blob: 29cb6ca247126585874f24fb4735f799b9584c36 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package yoga.view.index

import scala.xml.Node

import yoga.model.Pose
import yoga.router.Router
import yoga.service.Poses

object Index {

  def apply(): Node =
    <div class="index__poses">
      {Poses.values.map(renderPose)}
    </div>

  def renderPose(pose: Pose): Node =
    <a class="index__poseLink" href={Router.Path.licence(pose.image)}>
      <div class="index__poseName">
        {pose.name}
      </div>
      <div class="index__poseImageParent">
        <img class="index__poseImage" src={s"images/${pose.image}"} />
      </div>
    </a>


}