app/template/default/Block/index.twig line 1

Open in your IDE?
  1. {% block main %}
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <style>
  6. /* これが無いとモーダルウィンドウ表示の際に余白が出る */
  7. *{
  8.   margin: 0;
  9.   padding: 0;
  10. }
  11. /* モーダル全体(背景+本体) */
  12. .modal{
  13.   display: none;
  14.   position: fixed;
  15.   top: 0;
  16.   height: 100vh;
  17.   width: 100%;
  18. }
  19. /* モーダル背景 */
  20. .modal-bg{
  21.   position: absolute;
  22.   height: 100vh;
  23.   width: 100%;
  24.   background: rgba(0, 0, 0, 0.8);
  25. }
  26. /* モーダル本体 */
  27. .modal-content{
  28.   position: absolute;
  29.   top: 50%;
  30.   left: 50%;
  31.   transform: translate(-50%, -50%);
  32.   overflow: scroll; /* はみ出た部分はスクロールさせる */
  33.   height: 86%;/* これが無いと「overflow:scroll」が利かない */
  34.   width: 96%;/* これが無いと「overflow:scroll」が利かない */
  35.   background: white;
  36.   padding: 14px;
  37. }
  38. /* モーダルウィンドウ表示中に記事本体を固定 */
  39. body.fixed {
  40.   position: fixed;
  41.   width: 100%;
  42.   height: 100%;
  43.   left: 0;
  44. }
  45. .botton5{
  46.   display: inline-block;
  47.   justify-content: space-around;
  48.   background-color:  #fff;
  49.   border: 1px solid #dddddd;
  50.   color:#1c315d;
  51.   width: 230px;
  52.   line-height:20px;
  53.   border-radius:10px;
  54.   text-align:left;
  55.   margin :0px;
  56.   padding :6px;
  57. }
  58. .container10 {
  59.  display: flex;
  60.  flex-wrap: wrap;
  61. }
  62. .item99 {
  63.   margin: 8px;
  64.   padding: 8px;
  65. }
  66. </style>
  67. <div class="botton5">
  68.     <div class="item99">
  69.         <a href="#" class="js-modal-open" data-target="modal01">
  70.             <center><img src="{{ url('homepage') }}/html/user_data/assets/img/userguide/SPOPtitle.png" width="180px"></a></center>
  71.                 <div id="modal01" class="modal js-modal">
  72.                     <div class="modal-bg js-modal-close"></div>
  73.                         <div class="modal-content">
  74.                         <!--<img src="/html/user_data/assets/img/userguide/SPOP2022_.png" height="1280px" >
  75.                             <a href="/html/user_data/assets/img/userguide/SPOP2022_.png" target="_blank"><center><h3>画像で見る</h3></center></a>-->
  76.                             <img src="{{ url('homepage') }}/html/user_data/assets/img/userguide/SPOP_2023_4.1.png" height="1010px" >
  77.                             <a href="{{ url('homepage') }}/html/user_data/assets/img/userguide/SPOP_2023_4.1.png" target="_blank"><center><h3>画像で見る</h3></center></a>
  78.                         <center><a href="#" class="js-modal-close">閉じる</a></center>
  79.                     <br>
  80.                 <br>
  81.             <br>
  82.         </div>
  83.     </div>
  84. </div>
  85.     <a href="https://www.nakatomi-sangyo.com/manual/index.html" target="_self">
  86.         <center><img src="{{ url('homepage') }}/html/user_data/assets/img/userguide/取扱説明書title.png" width="180px"></a></center>
  87.         <br>
  88.         <a href="https://www.nakatomishop.com/user_data/glossaly" target="_self">
  89.         <center><img src="{{ url('homepage') }}/html/user_data/assets/img/userguide/用語集title.png" width="180px" ></a></center>
  90.         <br>
  91.     </div>
  92. <br>
  93. <script>
  94. // モーダルウィンドウを開く
  95. $('.js-modal-open').on('click', function(){
  96.   var target = $(this).data('target');
  97.   var modal = document.getElementById(target);
  98.   scrollPosition = $(window).scrollTop();
  99.   $('body').addClass('fixed').css({'top': -scrollPosition});
  100.   $(modal).fadeIn();
  101.   return false;
  102. });
  103. // モーダルウィンドウを閉じる
  104. $('.js-modal-close').on('click', function(){
  105.   $('body').removeClass('fixed');
  106.   window.scrollTo( 0 , scrollPosition );
  107.   $('.js-modal').fadeOut();
  108.   return false;
  109. });
  110. </script>
  111. {% endblock %}