{% extends 'default_frame.twig' %}
{% block javascript %}
<script>
const INVITE_URL = '{{ referralLink }}';
// 反映
const input = document.getElementById('invite-url');
const copyBtn = document.getElementById('copy-btn');
const toast = document.getElementById('copy-toast');
input.value = INVITE_URL;
// コピー動作
if({{ availableCount }} > 0) {
copyBtn.addEventListener('click', async () => {
console.log('copying...');
try {
await navigator.clipboard.writeText(input.value);
toast.textContent = 'リンクをコピーしました';
setTimeout(() => toast.textContent = '', 2000);
} catch (e) {
input.select();
document.execCommand('copy');
toast.textContent = 'コピーしました(互換モード)';
setTimeout(() => toast.textContent = '', 2000);
}
});
// 共有リンク(必要に応じてエンコード)
const shareMessage = `【シコメルストア】
お友達から3,000円の割引クーポンが届きました!
さっそく、有名店の仕込み済みメニューを試してみましょう。
下記URLから登録するだけで、クーポンがもらえます。
` + INVITE_URL;
const shareText = encodeURIComponent(shareMessage);
const shareUrl = encodeURIComponent(INVITE_URL);
const lineShareLink = (isMobile())
?`https://line.me/R/share?text=${shareText}`
: `https://social-plugins.line.me/lineit/share?url=${shareUrl}&text=${shareText}`
// LINE (line.me)
document.getElementById('share-line').href = lineShareLink;
// Facebook (シェアダイアログ。ドメインが公開到達可能である必要あり)
document.getElementById('share-fb').href =
// `https://www.facebook.com/sharer/sharer.php?u=${shareUrl}`;
`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(getFaceBookShareLink())}`;
// メール(mailto)
document.getElementById('share-mail').href =
`mailto:?subject=${encodeURIComponent('招待リンクの共有')}&body=${shareText}`;
} else {
// リンクを無効化
document.getElementById('share-line').style.pointerEvents = "none";
document.getElementById('share-fb').style.pointerEvents = "none";
document.getElementById('share-mail').style.pointerEvents = "none";
}
function getFaceBookShareLink() {
const url = new URL(INVITE_URL);
const params = url.searchParams;
const origin = url.origin;
return url.origin + "/user_data/share-entry-before?rc=" + params.get('rc');
}
function isMobile() {
return /Mobi|Android|iPhone|iPad|iPod/i.test(navigator.userAgent);
}
</script>
{% endblock javascript %}
{% block stylesheet %}
<style>
.ec-layoutRole {
background: #ffffffff;
}
.main_content {
width: 375px;
margin: auto;
}
.main_content h1 {
font-size: 22px;
font-weight: bold;
margin: 0px;
}
.section1 {
--bg: #fff7d6; /* パネル背景(薄いきいろ) */
--ink: #2b2b2b; /* 文字色 */
--muted: #6b7280; /* 補助文字色 */
--pill: #f3f4f6; /* 入力背景 */
--copy: #e5e7eb; /* コピーボタン背景 */
--danger: #ef4444; /* 残回数の赤 */
--border: #e5e7eb; /* 枠線 */
}
/* カード本体 */
.section1 .invite-card {
margin: 0 auto;
background: var(--bg);
padding: 20px 20px 16px;
box-shadow: 0 1px 0 rgba(0,0,0,.03), 0 6px 20px rgba(0,0,0,.06);
}
/* タイトル */
.section1 .invite-title {
text-align: center;
font-weight: 700;
font-size: 18px;
margin: 2px 0 16px;
letter-spacing: .02em;
color: var(--ink);
}
/* 入力 + コピー */
.section1 .copy-row {
display: grid;
grid-template-columns: 1fr auto;
align-items: center;
width: 327px;
}
@media screen and (max-width: 767px) {
.main_content {
width: 100%
}
.section1 .copy-row {
width: 100%;
}
}
.section1 .copy-input {
width: 100%;
background: #ffffff;
border: 1px solid #d1d5db;
border-right-color: #ffff;
height: 48px;
padding: 0 12px;
font-size: 14px;
color: var(--ink);
outline: none;
}
.section1 .copy-btn {
background: #ffffff;
border: 1px solid #d1d5db;
border-left-color: #ffff;
padding: 0 12px;
height: 48px;
font-size: 14px;
cursor: pointer;
color: #1F9FCB;
font-weight: bold;
white-space: nowrap;
}
.section1 span {
font-weight: bold;
}
.section1 .copy-btn:hover { filter: brightness(0.98); }
.section1 .copy-toast {
font-size: 12px;
color: var(--muted);
min-height: 16px;
text-align: left;
}
/* 共有ボタン群 */
.section1 .share-row {
display: flex;
justify-content: space-between;
gap: 10px;
padding: 0 0 16px;
}
.section1 .share-row span {
font-size: 12px;
}
.section1 .share-btn {
flex: 1 1 0;
display: flex;
flex-direction: column;
align-items: center;
gap: 6px;
text-decoration: none;
color: var(--ink);
font-size: 12px;
text-align: center;
transition: background-color .12s ease;
}
/* アイコンサイズ(SVG) */
.section1 .icon {
width: 28px;
height: 28px;
display: inline-block;
}
/* 残回数テキスト */
.section1 .note {
text-align: center;
font-size: 16px;
color: var(--muted);
margin-top: 16px;
font-weight: bold;
}
.section1 .note .count {
color: var(--danger);
font-weight: 700;
font-size: 28px;
margin: 0 2px;
}
/* スマホ最適化(狭い端末での余白最適化) */
@media (max-width: 380px) {
.section1 .invite-card { padding: 16px 14px; }
.section1 .share-row { gap: 8px; }
.section1 .invite-title { font-size: 17px; }
}
/* ===== ダークセクション(section2専用) ===== */
.section2 {
--bg: #ffffffff; /* 背景(黒) */
--ink: #000000ff; /* 文字(明) */
--muted: #cbd5e1; /* 補助文字 */
--line: #1f2937; /* 区切り線 */
--primary: #22d3ee; /* アクセント(シアン) */
--primary-ink: #0b0b0b; /* ボタン文字(濃) */
background: var(--bg);
color: var(--ink);
padding: 48px 20px;
}
.section2 ul {
list-style: disc;
}
.section2__inner{
max-width: 960px;
margin: 0 auto;
text-align: left;
}
.section2__title h2{
text-align: center;
}
.section2__title h2{
font-size: 24px;
line-height: 1.2;
font-weight: 800;
letter-spacing: .01em;
margin: 0 0 10px;
}
.section2__subtitle{
font-size: 15px;
line-height: 1.9;
font-weight: bold;
max-width: 680px;
}
.section2__btn{
display: inline-flex;
align-items: center;
justify-content: center;
padding: 12px 18px;
border-radius: 999px;
font-weight: 700;
text-decoration: none;
border: 1px solid var(--line);
transition: transform .08s ease, filter .12s ease, background-color .12s ease;
}
.section2__btn:active{ transform: translateY(1px); }
.section2__btn--primary{
background: var(--primary);
color: var(--primary-ink);
border-color: transparent;
}
.section2__btn--primary:hover{ filter: brightness(0.96); }
.section2__btn--ghost{
background: transparent;
color: var(--ink);
}
.section2__btn--ghost:hover{ background: rgba(255,255,255,.06); }
/* アイコン付き特徴 */
.section2__features{
grid-template-columns: repeat(3, minmax(0,1fr));
gap: 12px;
padding: 0;
margin: 0 auto 0;
max-width: 780px;
}
.feature{
align-items: center;
gap: 10px;
background: rgba(255,255,255,.04);
padding: 4px 0px 4px 0;
margin-left: 18px;
}
.feature__icon{
width: 28px; height: 28px; border-radius: 8px;
background: rgba(255,255,255,.08);
display: grid; place-items: center;
font-size: 14px;
}
.feature__text{ font-size: 13px; color: var(--muted); }
.share_line,
.share_facebook,
.share_mail {
width: 100px;
text-align: center;
}
.share_line .share-btn,
.share_facebook .share-btn,
.share_mail .share-btn
{
margin-bottom: 4px;
}
/* SP */
@media (max-width: 640px){
.section2{ padding: 36px 16px; }
.section2__title{ font-size: 22px; }
.section2__lead{ font-size: 14px; }
.section2__features{ grid-template-columns: 1fr; }
}
</style>
{% endblock stylesheet %}
{% block main %}
<div class="main_content">
<header id="header_content" style="position: relative;">
<h1><img src="{{ asset('assets/img/refer_friend/top.webp', 'user_data') }}" alt="友達紹介でクーポンがもらえる" style="max-width: 100%;"></h1>
</header>
<section class="section1" style="">
<div class="invite-card" role="region" aria-labelledby="invite-title">
<h2 id="invite-title" class="invite-title">招待リンク</h2>
<div class="copy-row" style="{% if availableCount is same as (0) %} opacity: 0.4; {% endif %}">
<input id="invite-url" class="copy-input" type="text"
value="" aria-label="招待リンクURL" readonly />
<button id="copy-btn" class="copy-btn" type="button" aria-label="リンクをコピー">コピー</button>
</div>
<div id="copy-toast" class="copy-toast" aria-live="polite"></div>
<div class="share-row" style="{% if availableCount is same as (0) %} opacity: 0.4; {% endif %}">
<!-- LINE -->
<div class="share_line">
<a class="share-btn" id="share-line" href="#" target="_blank" rel="noopener">
<img src="{{ asset('assets/img/refer_friend/line_logo.png', 'user_data') }}" style="max-width: 50px;">
</a>
<span>LINEで共有</span>
</div>
<!-- Facebook -->
<div class="share_facebook">
<a class="share-btn" id="share-fb" href="#" target="_blank" rel="noopener">
<img src="{{ asset('assets/img/refer_friend/facebook_logo.png', 'user_data') }}" style="max-width: 50px;">
</a>
<span>Facebookで共有</span>
</div>
<!-- Mail -->
<div class="share_mail">
<a class="share-btn" id="share-mail" href="#" target="_blank" rel="noopener">
<img src="{{ asset('assets/img/refer_friend/mail_icon.png', 'user_data') }}" style="max-width: 50px;">
</a>
<span>メールで共有</span>
</div>
</div>
{% if app.user %}
<p class="note">あと <span id="remain-count" class="count">{{ availableCount }} 回</span> 招待できます</p>
{% else %}
<p class="note"><a href="{{ path('mypage_login', {'_target_path': app.request.uri }) }}">ログインする</a>と共有できます</p>
{% endif %}
</div>
</section>
<section class="section2">
<div class="section2__title">
<h2>注意事項</h2>
</div>
<div class="section2__inner">
<p class="section2__subtitle">1.クーポンの進呈・利用条件について</p>
<ul class="section2__features">
<li class="feature">本紹介システムを通じて紹介される方(新規会員)は、必ず紹介専用URLから遷移し、新規会員登録を完了してください。専用URL以外からの登録は特典の対象外となります。</li>
<li class="feature">特典の3,000円クーポン(紹介された方)は、新規会員登録完了後にその場で自動で付与されます。</li>
<li class="feature">特典の1,000円クーポン(紹介した方)は、紹介された方が初回購入を完了し、その商品が発送された時点で自動で付与されます。クーポン獲得はLINEまたはメールで通知いたします。</li>
<li class="feature">特典の1,000円クーポン(紹介した方)は、最大5枚まで獲得が可能です。</li>
<li class="feature">クーポンはシコメルストア内でのみ利用可能です。 </li>
<li class="feature">3,000円クーポンは3,000円以上のご購入で、1,000円クーポンは1,000円以上のご購入で利用が可能です。クーポンの併用はできません。</li>
<li class="feature">過去にシコメルストアに会員登録されていた方の再登録は、紹介特典の対象外となります。</li>
<li class="feature">アプリでの会員登録はクーポン付与の対象外です。Webからのご登録をお願いいたします。</li>
</ul>
<p class="section2__subtitle">2. 禁止事項について</p>
<ul class="section2__features">
<li class="feature">紹介する人・される人が同一と見なされる場合、特典を剥奪させていただく場合がございます。</li>
<li class="feature">不特定多数への営利目的での紹介、またはスパム行為と見なされるような紹介活動は固く禁止いたします。</li>
<li class="feature">紹介システムを悪用した不正行為が確認された場合、特典の無効化、クーポンの失効、または強制退会の措置をとる場合があります。</li>
</ul>
<p class="section2__subtitle">3. その他</p>
<ul class="section2__features">
<li class="feature">本紹介システムの内容は、予告なく変更または終了する場合があります。その際、取得したクーポンを破棄させていただく場合がございます。</li>
<li class="feature">クーポンの換金・返金はできません。</li>
<li class="feature">本システムについてご不明な点がある場合は、シコメルストアのお問い合わせ窓口までご連絡ください。</li>
</ul>
</div>
</section>
</div>
{% endblock %}