{% extends 'default_frame.twig' %}
{% block stylesheet %}
<link rel="stylesheet" href="/html/template/default/assets/css/content.css">
<link rel="stylesheet" href="/html/template/default/assets/css/frame03.css">
{% endblock %}
{% set categories = [
'essay',
'interview',
'report',
'guide',
'philosophy'
]
%}
{% block javascript %}
<script>
$(function(){
$('.slide-img:not(".slide-img-slow")').slick({
autoplay: true,
autoplaySpeed: 3000,
arrows: false,
dots: false,
infinite: true,
speed: 800,
slidesToShow: 1,
variableWidth: true,
centerMode: true,
responsive: [
{
breakpoint: 750,
settings: {
variableWidth: true,
centerMode: true,
}
}
]
});
$('.slide-img-slow > li:last-child > img').on('load',function(){
setTimeout(function(){
$('.slide-img-slow').not('.slick-initialized').slick({
autoplay: true,
autoplaySpeed: 0,
arrows: false,
dots: false,
speed: 18000,
infinite: true,
cssEase: 'linear',
slidesToShow: 1,
variableWidth: true,
centerMode: true,
draggable: false,
touchMove: false,
pauseOnFocus: false,
pauseOnHover: false,
});
$('.slide-img-slow').css('opacity',1);
},1000);
});
$('.slide-img-slow > li > img').each(function(){
var ctrl = $(this);
ctrl.attr('src',ctrl.data('src'));
});
});
</script>
{% if Post.category[0].slug in categories %}
<script>
$(document).ready(function () {
const postSlug = '{{ Post.category[0].slug }}';
console.log(postSlug);
$('#page_special_detail').addClass('bg-' + postSlug);
});
</script>
{% endif %}
<script>
$(function () {
$("#share-menu-button").on('click', function () {
$("#share-menu").fadeToggle();
copyLinkText('リンクをコピー');
});
});
function copyUrl() {
const url = location.href;
navigator.clipboard.writeText(url);
copyLinkText('コピーしました');
setTimeout(function () {
copyLinkText('リンクをコピー');
}, 2000);
}
function openLineShare() {
const lineUrl = 'https://social-plugins.line.me/lineit/share?url=';
const url = location.href;
window.open(`${lineUrl}${url}`)
}
function openMail() {
const url = location.href;
const mailto = `mailto:?body=${url}`;
window.open(mailto);
}
function copyLinkText(text) {
$("#copy-link > span").text(text);
}
</script>
{% endblock %}
{% block main %}
<div
class="second-wrap white-wrap w-full flex flex-col items-center justify-center font-extralight mx-auto animate-slideIn">
<!-- KV -->
<div id="section-kv" class="w-full z-10">
<div class="flex flex-col items-center w-full">
<img src="{{ Post.special_kv_pc.url }}" alt="{{ Post.special_kv_pc.alt }}" class="sm:hidden object-cover h-[450px] w-full overflow-hidden">
<img src="{{ Post.special_kv_sp.url }}" alt="{{ Post.special_kv_sp.alt }}" class="hidden sm:block w-full object-cover h-[640px]">
<div class="max-w-[880px] w-full lg:w-[86.6vw] md:mx-6 bg-black bg-opacity-80 text-white px-12 py-14 md:py-8 md:px-6 flex-col flex mt-[-24px] relative">
<p class="text-end text-[#B0B0B0] text-sm md:text-xs absolute top-[4px] right-[8px]">{{ Post.post_date|date('Y/m/d') }}</p>
<div class="flex items-center border border-white w-fit mb-3 text-sm sm:text-xs px-3 py-[2px]">
<p class="{% if Post.sub_category is not empty %} after:content-['|'] {% endif %}">{{ Post.category[0].name }}
</p>
{% if Post.sub_category is not empty %}
<span class="{% if Post.sub_category is not empty %} ml-1 {% endif %}">{{ Post.sub_category.name }}</span>
{% endif %}
</div>
<h1 class="text-3xl md:text-xl leading-loose tracking-[5px]">{{ Post.post_title|raw }}</h1>
</div>
</div>
</div>
<div id="page_special_detail" class="w-[100vw] mx-[-50vw] h-fit relative flex flex-col items-center bg-top mt-[-180px] lg:px-6 md:pt-[100px]">
<div class="section-inner">
<div class="section-cont text-[10px]">
{{ Post.filter_content|raw }}
</div>
</div>
</div>
<div class="max-w-[880px] w-full mx-auto md:px-3">
<div class="w-full flex justify-between text-sm py-28 items-center">
{% if PrevPost is not empty %}
<a href="{{ path('special_post',{'id':PrevPost}) }}" class="flex items-center gap-4 md:gap-2">
<img src="{{asset('/html/template/default/assets/img/special/arrow-prev.svg')}}" alt="" class="mt-1 md:w-10">
<p class="whitespace-nowrap text-xs">前の記事へ</p>
</a>
{% else %}
<div class="w-[134px] opacity-0"></div>
{% endif %}
<div class="md:mt-16 whitespace-nowrap">
<a href="{{ path('special_posts') }}" class="border border-[#DFDFDF] px-3 py-1 md:text-xs md:px-1 text-center">記事一覧へ</a>
</div>
{% if NextPost is not empty %}
<a href="{{ path('special_post',{'id':NextPost}) }}" class="flex items-center gap-4 md:gap-2">
<p class="whitespace-nowrap text-xs">次の記事へ</p>
<img src="{{asset('/html/template/default/assets/img/special/arrow-next.svg')}}" alt="" class="mt-1 md:w-10">
</a>
{% else %}
<div class="w-[134px] opacity-0"></div>
{% endif %}
</div>
<hr class="bg-[#DFDFDF] w-[100vw] mx-[calc(50%-50vw)] px-[calc(50%-50vw)]">
<div class="w-full mt-24 md:mt-8 flex flex-col items-center">
<h2 class="text-xl mb-10 md:mb-6 md:text-sm">SHARE</h2>
{# TODO:シェアボタン #}
<ul id="share-menu" class="flex mb-8 items-center">
<li class="hover cursor-pointer p-3 " onclick="openLineShare()">
<img class="h-8 w-8" src="{{ asset('assets/icon/LINE_LOGO.svg') }}">
</li>
<li class="hover cursor-pointer p-3" onclick="openMail()">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewbox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-8">
<path stroke-linecap="round" stroke-linejoin="round" d="M21.75 6.75v10.5a2.25 2.25 0 0 1-2.25 2.25h-15a2.25 2.25 0 0 1-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0 0 19.5 4.5h-15a2.25 2.25 0 0 0-2.25 2.25m19.5 0v.243a2.25 2.25 0 0 1-1.07 1.916l-7.5 4.615a2.25 2.25 0 0 1-2.36 0L3.32 8.91a2.25 2.25 0 0 1-1.07-1.916V6.75"/>
</svg>
</li>
<li id="copy-link" class="hover cursor-pointer p-3" onclick="copyUrl()">
<svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 24 24" fill="currentColor" class="size-7">
<path fill-rule="evenodd" d="M19.902 4.098a3.75 3.75 0 0 0-5.304 0l-4.5 4.5a3.75 3.75 0 0 0 1.035 6.037.75.75 0 0 1-.646 1.353 5.25 5.25 0 0 1-1.449-8.45l4.5-4.5a5.25 5.25 0 1 1 7.424 7.424l-1.757 1.757a.75.75 0 1 1-1.06-1.06l1.757-1.757a3.75 3.75 0 0 0 0-5.304Zm-7.389 4.267a.75.75 0 0 1 1-.353 5.25 5.25 0 0 1 1.449 8.45l-4.5 4.5a5.25 5.25 0 1 1-7.424-7.424l1.757-1.757a.75.75 0 1 1 1.06 1.06l-1.757 1.757a3.75 3.75 0 1 0 5.304 5.304l4.5-4.5a3.75 3.75 0 0 0-1.035-6.037.75.75 0 0 1-.354-1Z" clip-rule="evenodd"/>
</svg>
</li>
</ul>
</div>
</div>
<div class="w-full max-w-[1120px] lg:px-12 mt-[130px] md:mt-10 mb-8 md:mb-0">
<ul id="breadcrumbs" class="border-t border-[#EFEFEF] py-5 md:py-4 w-full md:text-xs text-sm tracking-widest flex items-center gap-x-1">
<li>
<a href="{{ url('homepage') }}" class="hover">
<span>HOME</span>
</a>
</li>
<span>/</span>
<li>
<a href={{url('special_posts')}} class="hover">
<span>特集</span>
</a>
</li>
<span>/</span>
<li>
<span>{{ Post.post_title|raw }}</span>
</li>
</ul>
</div>
</div>
{% endblock %}