templates.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. function countryItem(obj,i) {
  2. return `
  3. <article id="item-${i}" class="item-box">
  4. <div class="item-country country-item">
  5. <a class="thumbnail-box" href="javascript: void(0)" title="País: ${obj.name}">
  6. <div class="thumbnail">
  7. <img class="thumbnail-img" alt="${obj.name}" src="${obj.flag}">
  8. <p class="length">Capital: ${obj.capital}</p>
  9. </div>
  10. </a>
  11. <h4 class="title"><a href="#" title="${obj.name}">${obj.name}</a></h4>
  12. <address title="${obj.name}"><b><a href="#">Ver más</a></b></address>
  13. <div class="stats horizontal-stats">
  14. <span>Continente: ${obj.subregion}</span>
  15. <div class="views">Nombre Nativo: ${obj.nativeName}</div>
  16. </div>
  17. </div>
  18. </article>`;
  19. }
  20. function countryModal(obj,basics,content,i) {
  21. return `
  22. <div id="modal-item-${i}" class="container" style="display: none;">
  23. <div class="simple-modal" tabindex="0">
  24. <div class="simple-modal__content">
  25. <header>
  26. <h4>${obj.name}</h4>
  27. <span id="close-${i}" class="close">Cerrar</span>
  28. </header>
  29. <div class="modal-main">
  30. ${basics}
  31. ${content}
  32. </div>
  33. </div>
  34. </div>
  35. </div>`;
  36. }