const parseSplash = (splash, running) => {
  const { title, image, data } = splash;
  if (running) {
    return buildSplashTemplate(title, image, data);
  } else {
    return buildSplashTemplate(title, image, data) + addStartButton();
  }
};

const buildSplashTemplate = (title, image, data) => `
    <div class="jumbotron card bg-dark text-white text-center">
      <img class="card-img" src="${image}" style="max-height: 250px" />
      <div class="card-img-overlay">
        <h1 class="my-5 display-4">${title}</h1>
      </div>
    </div>

    <div class="border rounded p-3 pb-0 my-4 mx-2">${data}</div>
`;

const addStartButton = () => `
    <div class="text-center">
      <button onclick="startSim()" class="btn btn-warning">Start simulation</button>
    </div>
`;