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

Open in your IDE?
  1. {% extends 'default_frame.twig' %}
  2. {% block javascript %}
  3.     <script>
  4.         $(function () {
  5. const sections = [
  6. 'essay',
  7. 'document',
  8. 'report',
  9. 'guide',
  10. 'philosophy'
  11. ];
  12. sections.forEach(section => {
  13. const posts = $ (`.${section}_post`);
  14. const showMoreButton = $ (`#${section}_show_more`);
  15. let visibleCount = 2;
  16. // 初期表示
  17. posts.slice(0, visibleCount).removeClass('hidden');
  18. showMoreButton.on('click', function () {
  19. visibleCount += 6;
  20. posts.slice(0, visibleCount).removeClass('hidden');
  21. // すべて表示したらボタンを隠す
  22. if (visibleCount >= posts.length) {
  23. showMoreButton.addClass('hidden');
  24. }
  25. });
  26. // 初期状態でボタンを非表示にするか確認
  27. if (visibleCount >= posts.length) {
  28. showMoreButton.addClass('hidden');
  29. }
  30. });
  31. });
  32.     </script>
  33. </script>{% endblock %}{% block main %}
  34. <div class="w-full flex flex-col items-center justify-center font-extralight">
  35.     <div class="w-full pb-20 md:pb-10 flex flex-col items-center border-b border-[#DFDFDF] mt-3">
  36.         <img src="{{asset('assets/img/special/special-top01_pc@2x.webp')}}" alt="" class="w-[max(45.83vw,880px)] mb-20 md:hidden">
  37.         <img src="{{asset('assets/img/special/special-top01_sp@2x.webp')}}" alt="" class="w-[325px] h-auto mb-10 hidden md:block">
  38.         <h1 class="text-[40px] tracking-[11px] md:text-lg">祈りに親しむ</h1>
  39.     </div>
  40.     <!-- Essay Section -->
  41.     <div class="w-full h-fit bg-special-essay bg-cover object-cover bg-top bg-no-repeat">
  42.         <div class="h-fit top-[50%] left-[50%] py-16 md:py-12 m-auto sm:m-0 max-w-[1336px] xxl:px-[10px] w-full flex flex-col items-center">
  43.             <img src="{{asset('assets/img/special/essay.png')}}" alt="" class="mb-5 md:mb-2 md:w-[66px] h-auto">
  44.             <h2 class="text-[28px] mb-20 md:mb-8 md:text-xl tracking-[5.6px]">エッセイ</h2>
  45.             <div class="w-full grid grid-cols-2 md:grid-cols-1 gap-6 md:flex-col">
  46.                 {% for Post in essay_posts %}
  47.                     <div class="bg-white shadow-manaka md:w-full essay_post hidden hover">
  48.                         <a href="{{ path('special_post', {id: Post.ID}) }}">
  49.                             <img src="{{ Post.special_kv_pc.url }}" alt="{{ Post.special_kv_pc.alt }}" class="w-full bg-center sm:h-[170px] h-[310px] object-cover">
  50.                             <div class="pt-6 pb-10 px-8 md:px-6 md:pb-9">
  51.                                 <div class="mb-4 flex items-center justify-between">
  52.                                     <div class="w-fit flex py-[2px] px-2 border border-[#B0B0B0] sm:text-[10px]">
  53.                                         <p class="after:content-['|']">
  54.                                             {% if Post.category is not null %}
  55.                                                 {{ Post.category.name }}
  56.                                             {% endif %}
  57.                                         </p>
  58.                                         <p class="ml-1">
  59.                                             {% if Post.sub_category is not null %}
  60.                                                 {{ Post.sub_category.name }}
  61.                                             {% endif %}
  62.                                         </p>
  63.                                     </div>
  64.                                     <p class="text-sm md:text-xs">{{ Post.post_date|date('Y/m/d') }}</p>
  65.                                 </div>
  66.                                 <h3 class="text-xl mb-5 tracking-[4px] leading-8 md:text-sm">{{ Post.post_title|raw }}</h3>
  67.                                 {% set content = Post.filter_content|striptags %}
  68.                                 <p class="bg-white article-read text-sm md:text-xs tracking-widest leading-loose">{{ content|length > 55 ? content|slice(0,55) ~ '...' : content }}</p>
  69.                             </div>
  70.                         </a>
  71.                     </div>
  72.                 {% endfor %}
  73.             </div>
  74.             <button id="essay_show_more" class="mt-16 md:mt-12 hover gap-8 shadow bg-white border-b-[6px] w-[250px] sm:w-[175px] py-10 md:py-4 flex items-center justify-center border-manakaGray">
  75.                 <p class="text-xl md:text-sm">更に見る</p>
  76.                 <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewbox="0 0 24 24" style="color: #7d7d7d;" stroke-width="1.5" stroke="currentColor" class="size-6">
  77.                     <path stroke-linecap="round" stroke-linejoin="round" d="m19.5 8.25-7.5 7.5-7.5-7.5"/>
  78.                 </svg>
  79.             </button>
  80.         </div>
  81.     </div>
  82.     <!-- Document Section -->
  83.     <div class="w-full h-fit bg-special-document bg-cover object-cover bg-top bg-no-repeat">
  84.         <div class="h-fit top-[50%] left-[50%] py-16 md:py-12 m-auto sm:m-0 max-w-[1336px] xxl:px-[10px] w-full xl:px-3 flex flex-col items-center">
  85.             <img src="{{asset('assets/img/special/document.png')}}" alt="" class="mb-5 w-[42px] h-auto">
  86.             <h2 class="text-[28px] mb-20 md:mb-8 md:text-xl tracking-[5.6px]">ドキュメント</h2>
  87.             <div class="w-full grid grid-cols-2 md:grid-cols-1 gap-6 md:flex-col">
  88.                 {% for Post in document_posts %}
  89.                     <div class="bg-white shadow-manaka md:w-full document_post hidden hover">
  90.                         <a href="{{ path('special_post', {id: Post.ID}) }}">
  91.                             <img src="{{ Post.special_kv_pc.url }}" alt="{{ Post.special_kv_pc.alt }}" class="w-full bg-center sm:h-[170px] h-[310px] object-cover">
  92.                             <div class="pt-6 pb-10 px-8 md:px-6">
  93.                                 <div class="mb-4 flex items-center justify-between">
  94.                                     <div class="w-fit flex py-[2px] px-2 border border-[#B0B0B0] sm:text-[10px]">
  95.                                         <p class="after:content-['|']">
  96.                                             {% if Post.category is not null %}
  97.                                                 {{ Post.category.name }}
  98.                                             {% endif %}
  99.                                         </p>
  100.                                         <p class="ml-1">
  101.                                             {% if Post.sub_category is not null %}
  102.                                                 {{ Post.sub_category.name }}
  103.                                             {% endif %}
  104.                                         </p>
  105.                                     </div>
  106.                                     <p class="text-sm md:text-xs">{{ Post.post_date|date('Y/m/d') }}</p>
  107.                                 </div>
  108.                                 <h3 class="text-xl mb-5 tracking-[4px] leading-8 md:text-sm">{{ Post.post_title|raw }}</h3>
  109.                                 {% set content = Post.filter_content|striptags %}
  110.                                 <p class="bg-white article-read text-sm md:text-xs tracking-widest leading-loose">{{ content|length > 55 ? content|slice(0,55) ~ '...' : content }}</p>
  111.                             </div>
  112.                         </a>
  113.                     </div>
  114.                 {% endfor %}
  115.             </div>
  116.             <button id="document_show_more" class="hover mt-16 md:mt-12 gap-8 shadow bg-white border-b-[6px] w-[250px] sm:w-[175px] py-10 md:py-4 flex items-center justify-center border-manakaGray">
  117.                 <p class="text-xl md:text-sm">更に見る</p>
  118.                 <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewbox="0 0 24 24" style="color: #7d7d7d;" stroke-width="1.5" stroke="currentColor" class="size-6">
  119.                     <path stroke-linecap="round" stroke-linejoin="round" d="m19.5 8.25-7.5 7.5-7.5-7.5"/>
  120.                 </svg>
  121.             </button>
  122.         </div>
  123.     </div>
  124.     <!-- Report Section -->
  125.     <div class="w-full h-fit bg-special-report bg-cover object-cover bg-top bg-no-repeat">
  126.         <div class="h-fit top-[50%] left-[50%] py-16 md:py-12 m-auto sm:m-0 max-w-[1336px] xxl:px-[10px] w-full xl:px-3 flex flex-col items-center">
  127.             <img src="{{asset('assets/img/special/report.png')}}" alt="" class="mb-5 md:w-[65px] h-auto">
  128.             <h2 class="text-[28px] mb-20 md:mb-8 md:text-xl tracking-[5.6px]">レポート</h2>
  129.             <div class="w-full grid grid-cols-2 md:grid-cols-1 gap-6 md:flex-col">
  130.                 {% for Post in report_posts %}
  131.                     <div class="bg-white shadow-manaka md:w-full report_post hidden hover">
  132.                         <a href="{{ path('special_post', {id: Post.ID}) }}">
  133.                             <img src="{{ Post.special_kv_pc.url }}" alt="{{ Post.special_kv_pc.alt }}" class="w-full bg-center sm:h-[170px] h-[310px] object-cover">
  134.                             <div class="pt-6 pb-10 px-8 md:px-6">
  135.                                 <div class="mb-4 flex items-center justify-between">
  136.                                     <div class="w-fit flex py-[2px] px-2 border border-[#B0B0B0] sm:text-[10px]">
  137.                                         <p>
  138.                                             {% if Post.category is not null %}
  139.                                                 {{ Post.category.name }}
  140.                                             {% endif %}
  141.                                         </p>
  142.                                         <p class="{% if Post.sub_category is not null %} before::content-['|'] {% endif %}">
  143.                                             {% if Post.sub_category is not null %}
  144.                                                 {{ Post.sub_category.name }}
  145.                                             {% endif %}
  146.                                         </p>
  147.                                     </div>
  148.                                     <p class="text-sm md:text-xs">{{ Post.post_date|date('Y/m/d') }}</p>
  149.                                 </div>
  150.                                 <h3 class="text-xl mb-5 tracking-[4px] leading-8 md:text-sm">{{ Post.post_title|raw }}</h3>
  151.                                 {% set content = Post.filter_content|striptags %}
  152.                                 <p class="bg-white article-read text-sm md:text-xs tracking-widest leading-loose">{{ content|length > 55 ? content|slice(0,55) ~ '...' : content }}</p>
  153.                             </div>
  154.                         </a>
  155.                     </div>
  156.                 {% endfor %}
  157.             </div>
  158.             <button id="report_show_more" class="hover mt-16 gap-8 shadow bg-white border-b-[6px] w-[250px] py-10 md:py-4 flex items-center justify-center border-manakaGray">
  159.                 <p class="text-xl md:text-sm">更に見る</p>
  160.                 <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewbox="0 0 24 24" style="color: #7d7d7d;" stroke-width="1.5" stroke="currentColor" class="size-6">
  161.                     <path stroke-linecap="round" stroke-linejoin="round" d="m19.5 8.25-7.5 7.5-7.5-7.5"/>
  162.                 </svg>
  163.             </button>
  164.         </div>
  165.     </div>
  166.     <!-- Guide Section -->
  167.     <div class="w-full h-fit bg-special-guide bg-cover object-cover bg-top bg-no-repeat">
  168.         <div class="h-fit top-[50%] left-[50%] py-16 md:py-12 m-auto sm:m-0 max-w-[1336px] w-full xxl:px-[10px] xl:px-3 flex flex-col items-center">
  169.             <img src="{{asset('assets/img/special/guid.png')}}" alt="" class="mb-5 w-10 h-auto">
  170.             <h2 class="text-[28px] mb-20 md:mb-8 md:text-xl tracking-[5.6px]">ガイド</h2>
  171.             <div class="w-full grid grid-cols-2 md:grid-cols-1 gap-6 md:flex-col">
  172.                 {% for Post in guide_posts %}
  173.                     <div class="bg-white shadow-manaka md:w-full guide_post hidden hover">
  174.                         <a href="{{ path('special_post', {id: Post.ID}) }}">
  175.                             <img src="{{ Post.special_kv_pc.url }}" alt="{{ Post.special_kv_pc.alt }}" class="w-full bg-center sm:h-[170px] h-[310px] object-cover">
  176.                             <div class="pt-6 pb-10 px-8 md:px-6">
  177.                                 <div class="mb-4 flex items-center justify-between">
  178.                                     <div class="w-fit flex py-[2px] px-2 border border-[#B0B0B0] sm:text-[10px]">
  179.                                         <p>
  180.                                             {% if Post.category is not null %}
  181.                                                 {{ Post.category.name }}
  182.                                             {% endif %}
  183.                                         </p>
  184.                                         <p class="{% if Post.sub_category is not null %} before:content-['|'] {% endif %}">
  185.                                             {% if Post.sub_category is not null %}
  186.                                                 {{ Post.sub_category.name }}
  187.                                             {% endif %}
  188.                                         </p>
  189.                                     </div>
  190.                                     <p class="text-sm md:text-xs">{{ Post.post_date|date('Y/m/d') }}</p>
  191.                                 </div>
  192.                                 <h3 class="text-xl mb-5 tracking-[4px] leading-8 md:text-sm">{{ Post.post_title|raw }}</h3>
  193.                                 {% set content = Post.filter_content|striptags %}
  194.                                 <p class="bg-white article-read text-sm md:text-xs tracking-widest leading-loose">{{ content|length > 55 ? content|slice(0,55) ~ '...' : content }}</p>
  195.                             </div>
  196.                         </a>
  197.                     </div>
  198.                 {% endfor %}
  199.             </div>
  200.             <button id="guide_show_more" class="hover mt-16 md:mt-12 gap-8 shadow bg-white border-b-[6px] w-[250px] sm:w-[175px] py-10 md:py-4 flex items-center justify-center border-manakaGray">
  201.                 <p class="text-xl md:text-sm">更に見る</p>
  202.                 <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewbox="0 0 24 24" style="color: #7d7d7d;" stroke-width="1.5" stroke="currentColor" class="size-6">
  203.                     <path stroke-linecap="round" stroke-linejoin="round" d="m19.5 8.25-7.5 7.5-7.5-7.5"/>
  204.                 </svg>
  205.             </button>
  206.         </div>
  207.     </div>
  208.     <!-- Philosophy Section -->
  209.     <div class="w-full h-fit bg-special-philosophy bg-cover object-cover bg-top bg-no-repeat">
  210.         <div class="h-fit top-[50%] left-[50%] py-16 md:py-12 m-auto sm:m-0 max-w-[1336px] xxl:px-[10px] w-full xl:px-3 flex flex-col items-center">
  211.             <img src="{{asset('assets/img/special/philosophy.png')}}" alt="" class="mb-5 md:w-14 h-auto">
  212.             <h2 class="text-[28px] mb-20 md:mb-8 md:text-xl tracking-[5.6px]">フィロソフィ</h2>
  213.             <div class="w-full grid grid-cols-2 md:grid-cols-1 gap-6 md:flex-col">
  214.                 {% for Post in philosophy_posts %}
  215.                     <div class="bg-white shadow-manaka md:w-full philosophy_post hidden hover">
  216.                         <a href="{{ path('special_post', {id: Post.ID}) }}">
  217.                             <img src="{{ Post.special_kv_pc.url }}" alt="{{ Post.special_kv_pc.alt }}" class="w-full bg-center md:h-[170px] h-[310px] object-cover">
  218.                             <div class="pt-6 pb-10 px-8 md:px-6">
  219.                                 <div class="mb-4 flex items-center justify-between">
  220.                                     <div class="w-fit flex py-[2px] px-2 border border-[#B0B0B0] sm:text-[10px]">
  221.                                         <p>
  222.                                             {% if Post.category is not null %}
  223.                                                 {{ Post.category.name }}
  224.                                             {% endif %}
  225.                                         </p>
  226.                                         <p class="{% if Post.sub_category is not null %} before:content-['|'] {% endif %}">
  227.                                             {% if Post.sub_category is not null %}
  228.                                                 {{ Post.sub_category.name }}
  229.                                             {% endif %}
  230.                                         </p>
  231.                                     </div>
  232.                                     <p class="text-sm md:text-xs">{{ Post.post_date|date('Y/m/d') }}</p>
  233.                                 </div>
  234.                                 <h3 class="text-xl mb-5 tracking-[4px] leading-8 md:text-sm">{{ Post.post_title|raw }}</h3>
  235.                                 {% set content = Post.filter_content|striptags %}
  236.                                 <p class="bg-white article-read text-sm md:text-xs tracking-widest leading-loose">{{ content|length > 55 ? content|slice(0,55) ~ '...' : content }}</p>
  237.                             </div>
  238.                         </a>
  239.                     </div>
  240.                 {% endfor %}
  241.             </div>
  242.             <button id="philosophy_show_more" class="gap-8 mt-16 md:mt-12 shadow hover bg-white border-b-[6px] w-[250px] sm:w-[175px] py-10 md:py-4 flex items-center justify-center border-manakaGray">
  243.                 <p class="text-xl md:text-sm">更に見る</p>
  244.                 <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewbox="0 0 24 24" style="color: #7d7d7d;" stroke-width="1.5" stroke="currentColor" class="size-6">
  245.                     <path stroke-linecap="round" stroke-linejoin="round" d="m19.5 8.25-7.5 7.5-7.5-7.5"/>
  246.                 </svg>
  247.             </button>
  248.         </div>
  249.     </div>
  250.     <div class="max-w-[1120px] w-full px-6 md:px-0">
  251.         {% set breadcrumbs = [{'name': '特集'}] %}
  252.         {% include('Block/breadcrumbs.twig') %}
  253.     </div>
  254. </div>{% endblock %}