tapestry_move_corr.html 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <!DOCTYPE html>
  2. <html>
  3. <!-- all measurements in vw, i.e., fraction of the width of the display on which the HTML will be opened-->
  4. {% set tapestry_width = 100 %}
  5. {% set fontsize2image_container_width = 1 / 30 %}
  6. {% set image_container_width = (98 / ncols) / (1 + 1.2 * fontsize2image_container_width) %}
  7. {% set fontsize = [image_container_width * fontsize2image_container_width, 0.75]|max %}
  8. {% set image_width = image_container_width / (1 - colorbar2width) %}
  9. {% set image_height = image_width / aspect_ratio %}
  10. <!-- 2vw for margin, border and padding -->
  11. {% set tapestry_height = (image_height + 1.4 * fontsize) * nrows + 2 %}
  12. <style>
  13. * {
  14. margin:0;
  15. padding: 0;
  16. font-size: {{ fontsize }}vw;
  17. }
  18. .thumbnail {grid-area: thumbnail;}
  19. .textbelow {grid-area: textbelow;}
  20. .textrighttop {grid-area: textrighttop;}
  21. .textrightbottom {grid-area: textrightbottom;}
  22. .textrighttop > p, .textrightbottom > p, .textbelow > p{
  23. font-weight: bold;
  24. }
  25. .textrighttop > p {
  26. writing-mode: vertical-rl;
  27. transform: rotate(180deg);
  28. }
  29. .textrightbottom > p {
  30. position: relative;
  31. top: {{ (image_height / 2) - 2 * fontsize }}vw;
  32. /* Safari */
  33. -webkit-transform: rotate(-90deg);
  34. /* Firefox */
  35. -moz-transform: rotate(-90deg);
  36. /* IE */
  37. -ms-transform: rotate(-90deg);
  38. /* Opera */
  39. -o-transform: rotate(-90deg);
  40. white-space: nowrap;
  41. }
  42. div > img {
  43. width: {{ image_width }}vw;
  44. height:{{ image_height }}vw;
  45. margin-left: auto;
  46. margin-right: auto;
  47. display: block;
  48. overflow: hidden;}
  49. .grid-container{
  50. display: grid;
  51. grid-template-columns: {{ image_container_width }}vw {{ 1.2 * fontsize }}vw;
  52. grid-template-rows: {{ image_height / 2 }}vw {{ image_height / 2 }}vw {{ 1.4 * fontsize }}vw;
  53. grid-template-areas:
  54. 'thumbnail textrighttop'
  55. 'thumbnail textrightbottom'
  56. 'textbelow textbelow';
  57. }
  58. .grid-container > div, .tapestry-container{
  59. background-color: {{ bg_color }};
  60. }
  61. .grid-container > div > p{
  62. color: {{ fg_color }};
  63. }
  64. .tapestry-container{
  65. width: {{ tapestry_width }}vw;
  66. height: {{ tapestry_height}}vw;
  67. margin: 0.5vw;
  68. padding: 0.5vw;
  69. border: 0.5vw;
  70. }
  71. table{
  72. overflow: hidden;
  73. }
  74. /* Tooltip container */
  75. .tooltip {
  76. position: relative;
  77. display: inline-block;
  78. border: {{ 0.1 * fontsize }}vw dotted {{ fg_color }};
  79. padding: {{ 0.1 * fontsize}}vw;
  80. }
  81. .tooltip > p{
  82. font-weight: bold;
  83. }
  84. /* Tooltip text */
  85. .tooltip .tooltiptext {
  86. visibility: hidden;
  87. width: {{ image_container_width }}vw;
  88. background-color: {{ bg_color }};
  89. color: {{ fg_color }};
  90. text-align: center;
  91. padding: {{ image_container_width * 0.05 }}vw 0;
  92. /* Position the tooltip text - see examples below! */
  93. position: absolute;
  94. z-index: 2;
  95. bottom: 100%;
  96. left: 0%;
  97. }
  98. /* Show the tooltip text when you mouse over the tooltip container */
  99. .tooltip:hover .tooltiptext {
  100. visibility: visible;
  101. }
  102. </style>
  103. <body>
  104. <div class="tapestry-container">
  105. <table>
  106. {% for patches_row in patches_collection:%}
  107. <tr>
  108. {% for patch in patches_row: %}
  109. <td>
  110. <div class="grid-container">
  111. <div class="thumbnail"><img src="{{ patch.image_relative_path }}"
  112. alt="{{ patch.image_relative_path }}"></div>
  113. <div class="textrightbottom"><p>{{ patch.text_right_bottom }}</p></div>
  114. <div class="textrighttop"><p>{{ patch.text_right_top }}</p></div>
  115. <div class="textbelow">
  116. <div class="tooltip">
  117. <p>{{ patch.text_below }}</p>
  118. <span class="tooltiptext">
  119. <b>Pipe Name:</b> {{ patch.pipe_name }}<br><br>
  120. <b>Smoothness:</b> {{ patch.smoothness}}<br><br>
  121. <b>Tif file:</b> {{ patch.tif_file}}<br><br>
  122. <b>Plugin Params:</b><br>{{ patch.plugin_params }}
  123. </span>
  124. </div>
  125. {% if patch.movie_file is not none: %}
  126. <a href="{{patch.movie_file}}">(movie)</a>
  127. {% endif %}
  128. </div>
  129. </div>
  130. </td>
  131. {% endfor %}
  132. </tr>
  133. {% endfor %}
  134. </table>
  135. </div>
  136. </body>
  137. </html>