asymmetric.html 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <!DOCTYPE html>
  2. <html lang="it">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Balotta cartacea</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <link rel="stylesheet" href="{{ url_for('static', filename='flyers/asymmetric/style.css') }}">
  8. <link rel="stylesheet" href="{{ url_for('static', filename='flyers/asymmetric/paper.css') }} ">
  9. </head>
  10. <body class="A3 center">
  11. <header class="intestazione">
  12. <div class="logo">
  13. <img src="https://balotta.org/logo.png" alt="">
  14. </div>
  15. <div class="titolo center">
  16. <h1>Balotta</h1>
  17. <div class="subtitle">Agenda condivisa per Bologna</div>
  18. </div>
  19. <div class="qrcode">
  20. <img src="{{ url_for('static', filename='qr-code.png') }}" alt="">
  21. </div>
  22. </header>
  23. <main id="events">
  24. {% for column in (0, 1, 2, 3) %}
  25. <div class="eventcol">
  26. {% for row in (0, 1, 2, 3, 4, 5) %}
  27. {% set event = events[column+(3*row)] %}
  28. <div class="event">
  29. <div class="center flyer-container">
  30. <img class="flyer" src="https://balotta.org/{{"media/thumb/" + event.media[0].url if event.media else "fallbackimage.png"}}" style="object-position: {{ event.media[0].thumbnailPosition if event.media else "50%"}}"></img>
  31. </div>
  32. <div class="event_info">
  33. <h3 class="title">{{ event.title }}</h3>
  34. <div class="flex"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" role="img" aria-hidden="true" class="v-icon__svg"><path d="M19,19H5V8H19M16,1V3H8V1H6V3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3H18V1M17,12H12V17H17V12Z"></path></svg><span class="time">{{ event.when }}</span></div>
  35. <div class="location">
  36. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" role="img" aria-hidden="true" class="v-icon__svg"><path d="M12,11.5A2.5,2.5 0 0,1 9.5,9A2.5,2.5 0 0,1 12,6.5A2.5,2.5 0 0,1 14.5,9A2.5,2.5 0 0,1 12,11.5M12,2A7,7 0 0,0 5,9C5,14.25 12,22 12,22C12,22 19,14.25 19,9A7,7 0 0,0 12,2Z"></path>
  37. <div class="">
  38. <span class="place_name">{{ event.place.name }}</span>
  39. </div>
  40. </div>
  41. </div>
  42. </div>
  43. {% endfor %}
  44. </div>
  45. {% endfor %}
  46. </main>
  47. <footer>
  48. <div class="contacts flex">
  49. <div class="flex">
  50. <div>
  51. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><!--! Font Awesome Pro 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M575.8 255.5c0 18-15 32.1-32 32.1h-32l.7 160.2c0 2.7-.2 5.4-.5 8.1V472c0 22.1-17.9 40-40 40H456c-1.1 0-2.2 0-3.3-.1c-1.4 .1-2.8 .1-4.2 .1H416 392c-22.1 0-40-17.9-40-40V448 384c0-17.7-14.3-32-32-32H256c-17.7 0-32 14.3-32 32v64 24c0 22.1-17.9 40-40 40H160 128.1c-1.5 0-3-.1-4.5-.2c-1.2 .1-2.4 .2-3.6 .2H104c-22.1 0-40-17.9-40-40V360c0-.9 0-1.9 .1-2.8V287.6H32c-18 0-32-14-32-32.1c0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7L564.8 231.5c8 7 12 15 11 24z"/></svg>
  52. </div>
  53. <div>
  54. <span>https://balotta.org</span>
  55. </div>
  56. </div>
  57. <div class="flex">
  58. <div>
  59. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M48 64C21.5 64 0 85.5 0 112c0 15.1 7.1 29.3 19.2 38.4L236.8 313.6c11.4 8.5 27 8.5 38.4 0L492.8 150.4c12.1-9.1 19.2-23.3 19.2-38.4c0-26.5-21.5-48-48-48H48zM0 176V384c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V176L294.4 339.2c-22.8 17.1-54 17.1-76.8 0L0 176z"/></svg>
  60. </div>
  61. <div>
  62. <span>info@balotta.org</span>
  63. </div>
  64. </div>
  65. </div>
  66. <div class="published">
  67. stampato il <span id="publish_time"></span>
  68. </div>
  69. <script>
  70. let today = new Date();
  71. let publish_time = today.toLocaleDateString('it-IT');
  72. document.getElementById("publish_time").innerHTML = publish_time;
  73. </script>
  74. </footer>
  75. <script>
  76. const container = document.querySelector('#events');
  77. const content = container.querySelectorAll('.eventcol');
  78. const containerHeight = parseInt(window.getComputedStyle(container).height);
  79. const resizeObserver = new ResizeObserver(event => {
  80. resizeObserver.disconnect();
  81. event.forEach((el) => {
  82. if(el.contentRect.height < containerHeight) {
  83. el.target.querySelectorAll(".event > .flyer-container > .flyer").forEach((e) => {
  84. if(e.height >= parseInt(window.getComputedStyle(e).maxHeight)) {
  85. e.style.maxHeight = parseInt(window.getComputedStyle(e).maxHeight)+1 + "px"
  86. }
  87. })
  88. }
  89. })
  90. content.forEach(el => { requestAnimationFrame(() => resizeObserver.observe(el)) });
  91. });
  92. content.forEach(el => resizeObserver.observe(el))
  93. </script>
  94. </body>
  95. </html>