modal-share.html 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. {% load fullurl %}
  2. {% load tags %}
  3. {% load static %}
  4. <style>
  5. .modal {
  6. display: none;
  7. position: fixed;
  8. z-index: 1;
  9. padding-top: 100px;
  10. left: 0;
  11. top: 0;
  12. width: 100%;
  13. height: 100%;
  14. overflow: auto;
  15. background-color: rgb(0,0,0);
  16. background-color: rgba(0,0,0,0.4);
  17. }
  18. .modal-content {
  19. background-color: #fefefe;
  20. margin: auto;
  21. padding: 20px;
  22. border: 1px solid #888;
  23. width: 80%;
  24. }
  25. .close {
  26. color: #aaaaaa;
  27. float: right;
  28. font-size: 28px;
  29. font-weight: bold;
  30. }
  31. .close:hover,
  32. .close:focus {
  33. color: #000;
  34. text-decoration: none;
  35. cursor: pointer;
  36. }
  37. </style>
  38. <!-- Trigger/Open The Modal -->
  39. <span id="ShareButton" class="cursor-pointer" ><i class="fas fa-share"></i> Teilen </span>
  40. <!-- The Modal -->
  41. <div id="ShareModal" class="modal" onclick="function hide(e){ e.style.display='None'; } hide(this);" >
  42. <!-- Modal content -->
  43. <div class="modal-content">
  44. <span id="ShareClose" class="close">&times;</span>
  45. <div class=""> &nbsp; </div>
  46. <i class="fas fa-share"></i>
  47. <h3>Teilen</h3>
  48. <div class=""> &nbsp; </div>
  49. <div class=""> &nbsp; </div>
  50. <div class="row">
  51. <div class="col-sm-4">
  52. <div class="cursor-pointer" onclick="myFunction()">
  53. <i class="fas fa-code"></i> <br>
  54. <span>Text Kopieren</span>
  55. </div>
  56. </div>
  57. <div class="col-sm-4">
  58. <div class="cursor-pointer" onclick="myFunction()">
  59. <a href="mailto:?subject={{ product.wohnprojekt }}&body=Guten%20Tag!%0D%0A%0D%0AIch%20finde%20das%20folgende%20Projekt%20sehr%20interesant!%0D%0A%0D%0A{% fullurl 'product-detail-embed' pk=product.wohnprojekt.pk %}"><i class="fas fa-envelope"></i> <br>Send mail</a>
  60. </div>
  61. </div>
  62. <div class="col-sm-4"></div>
  63. </div>
  64. <div class=""> &nbsp; </div>
  65. <div class=""> &nbsp; </div>
  66. <input type="text" value="&lt;iframe src=&quot;{% fullurl 'product-detail-embed' pk=product.wohnprojekt.pk %}&quot; style=&quot;border:0px #ffffff none;&quot; name=&quot;myiFrame&quot; scrolling=&quot;yes&quot; frameborder=&quot;0&quot; marginheight=&quot;0px&quot; marginwidth=&quot;0px&quot; height=&quot;400px&quot; width=&quot;600px&quot; allowfullscreen&gt;&lt;/iframe&gt;" id="myInput">
  67. <div class=""> &nbsp; </div>
  68. <div class=""> <span>Link</span> </div>
  69. <input type="text" value="{% fullurl 'product-detail-embed' pk=product.wohnprojekt.pk %}" id="myLink">
  70. <div class=""> &nbsp; </div><div class=""> &nbsp; </div>
  71. </div>
  72. </div>
  73. <script>
  74. var ShareModal = document.getElementById("ShareModal");
  75. var ShareBtn = document.getElementById("ShareButton");
  76. var ShareSpan = document.getElementById("ShareClose");
  77. ShareBtn.onclick = function() {
  78. ShareModal.style.display = "block";
  79. }
  80. ShareSpan.onclick = function() {
  81. ShareModal.style.display = "none";
  82. }
  83. function myFunction() {
  84. var copyText = document.getElementById("myInput");
  85. copyText.select();
  86. copyText.setSelectionRange(0, 99999)
  87. document.execCommand("copy");
  88. alert("Copied the text: " + copyText.value);
  89. }
  90. </script>