illustrations.html 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. ---
  2. title: SVG Illustrations
  3. page-header: SVG Illustrations
  4. page-menu: illustrations
  5. layout: default
  6. permalink: illustrations.html
  7. ---
  8. {% assign first-illustration = '' %}
  9. {% for illustration in free-illustrations.autodark %}
  10. {% assign first-illustration = illustration[1] %}
  11. {% endfor %}
  12. {% assign skinColor = site.skinColors | first %}
  13. {% assign color = site.colors | first %}
  14. <div class="mb-7" style="--tblr-illustrations-primary: {{ color.hex }}; --tblr-illustrations-skin: {{ skinColor.hex }};" id="current-illustration-style">
  15. <div class="row row-cards">
  16. <div class="col-12">
  17. <div class="row row-cards row-deck g-4">
  18. <div class="col-md-7">
  19. <div class="card">
  20. <div class="card-body d-flex align-items-center">
  21. <div id="current-illustration">{{ first-illustration | replace: '<svg ', '<svg class="w-100 h-auto" ' }}</div>
  22. </div>
  23. </div>
  24. </div>
  25. <div class="col-md-5">
  26. <div class="row">
  27. <div class="col-12">
  28. <div class="card">
  29. <div class="card-body">
  30. <div>
  31. <div class="form-label">Primary color</div>
  32. <div class="row g-2">
  33. {% for color in site.colors %}
  34. <div class="col-auto">
  35. <label class="form-colorinput">
  36. <input name="color" type="radio" value="{{ color[1].hex }}" class="form-colorinput-input js-select-color" {% if forloop.first %} checked{% endif %} />
  37. <span class="form-colorinput-color bg-{{ color[1].class }}"></span>
  38. </label>
  39. </div>
  40. {% endfor %}
  41. </div>
  42. <div class="form-label mt-4">Skin color</div>
  43. <div class="row g-2">
  44. {% for color in site.skinColors %}
  45. <div class="col-auto">
  46. <label class="form-colorinput">
  47. <input name="skin-color" type="radio" value="{{ color[1].hex }}" class="form-colorinput-input js-select-skin-color" {% if forloop.first %} checked{% endif %} />
  48. <span class="form-colorinput-color" style="background-color: {{ color[1].hex }}"></span>
  49. </label>
  50. </div>
  51. {% endfor %}
  52. </div>
  53. <div class="form-label mt-4">Select SVG illustration</div>
  54. <div class="row">
  55. {% for illustration in free-illustrations.autodark %}
  56. <div class="col-3">
  57. <label class="form-imagecheck mb-2">
  58. <input name="form-imagecheck" type="radio" value="{{ illustration[0] }}" class="form-imagecheck-input js-select-illustration" {% if forloop.last %} checked{% endif %}>
  59. <span class="form-imagecheck-figure">
  60. {{ illustration[1] | replace: '<svg ', '<svg class="w-100 h-auto" ' }}
  61. </span>
  62. </label>
  63. </div>
  64. {% endfor %}
  65. </div>
  66. </div>
  67. </div>
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. <h2 class="page-title my-5">
  77. {{ illustrations | size | minus: 4 }} more SVG Illustrations
  78. </h2>
  79. <div class="row row-cards">
  80. <div class="col-lg-4">
  81. <div class="card card-md sticky-top">
  82. <div class="card-stamp card-stamp-lg">
  83. <div class="card-stamp-icon bg-primary">
  84. {% include "ui/icon.html" icon="brand-figma" %}
  85. </div>
  86. </div>
  87. <div class="card-body">
  88. <div class="row align-items-center">
  89. <div class="col-10">
  90. <h3 class="h1">Tabler Illustrations</h3>
  91. <div class="markdown text-secondary">
  92. Access a wide range of SVG illustrations for various projects. Effortlessly customize any illustration to align perfectly with your chosen color scheme!
  93. </div>
  94. <div class="mt-3">
  95. <a href="{{ site.illustrations.buy_link }}" class="btn btn-primary" target="_blank" rel="noopener">
  96. {% include "ui/icon.html" icon="download" %}
  97. Get lifetime access
  98. </a>
  99. </div>
  100. </div>
  101. </div>
  102. </div>
  103. </div>
  104. </div>
  105. <div class="col-lg-8">
  106. <div class="row row-cards">
  107. {% for illustration in illustrations %}
  108. <div class="col-6 col-md-3">
  109. <div class="card">
  110. <div class="card-body">
  111. <a href="{{ site.illustrations.buy_link }}" target="_blank">
  112. <img src="{{ page | relative }}/static/illustrations/light/{{ illustration }}.png" alt="{{ illustration }}" class="img-light" />
  113. <img src="{{ page | relative }}/static/illustrations/dark/{{ illustration }}.png" alt="{{ illustration }}" class="img-dark" />
  114. </a>
  115. </div>
  116. </div>
  117. </div>
  118. {% endfor %}
  119. </div>
  120. </div>
  121. </div>
  122. {% capture_global scripts %}
  123. <script>
  124. let skinColor = "{{ skin_color[1].hex }}",
  125. primaryColor = "{{ color[1].hex }}";
  126. const illustrations = {
  127. {% for illustration in free-illustrations.autodark %}
  128. "{{ illustration[0] }}": {
  129. svg: '{{ illustration[1] | replace: '<svg ', '<svg class="w-100 h-auto" ' | replace_regex: "\n", "\n" }}',
  130. },
  131. {% endfor %}
  132. }
  133. const selectIllustrations = document.querySelectorAll(".js-select-illustration"),
  134. currentIllustration = document.getElementById("current-illustration"),
  135. currentIllustrationCode = document.getElementById("current-illustration-code");
  136. document.querySelectorAll(".js-select-illustration").forEach((elem) => {
  137. elem.addEventListener("change", (e) => {
  138. const selectedId = e.target.value,
  139. selectedIllustration = illustrations[selectedId]
  140. currentIllustration.innerHTML = selectedIllustration.svg
  141. })
  142. })
  143. document.querySelectorAll(".js-select-color").forEach((elem) => {
  144. elem.addEventListener("change", (e) => {
  145. primaryColor = e.target.value
  146. document.getElementById("current-illustration-style").style.setProperty("--tblr-illustrations-primary", primaryColor)
  147. })
  148. })
  149. document.querySelectorAll(".js-select-skin-color").forEach((elem) => {
  150. elem.addEventListener("change", (e) => {
  151. skinColor = e.target.value
  152. document.getElementById("current-illustration-style").style.setProperty("--tblr-illustrations-skin", skinColor)
  153. })
  154. })
  155. </script>
  156. {% endcapture_global %}