# -*- coding: utf-8 -*-
"""SNSが固い（ショート専用・舞台型・2026-11-07）
エイイチの言葉: SNS の投稿文が固いので、一言ユーモアを加える投稿を増やしてほしい（全部の投稿でなくてよい）（2026-10-25）／重すぎる想いはウザい（2026-10-24）"""
from butai_parts import *
OUTRO_K = 5

NAME, VER = "SNSが固い", 1
HEAD = "SNSの文<br>固い？"
T_ON = (0, 0.6)

def post(x, y, w, hh, t0, lines=3, accent=False):
    ln = "".join(f'<div class="line" style="left:{x + 24}px;top:{y + 60 + k * 30}px;width:{w - 48 - (k % 2) * 40}px;height:12px"></div>' for k in range(lines))
    dot = f'<div style="position:absolute;left:{x + w - 64}px;top:{y + 14}px;width:40px;height:40px;border-radius:50%;background:{ORANGE}"></div>' if accent else ""
    return f'<div style="position:absolute;inset:0;opacity:0;animation:{a("up", t0)}"><div class="card" style="left:{x}px;top:{y}px;width:{w}px;height:{hh}px"></div>{ln}{dot}</div>'


def scene(T, S):
    h = CSS
    t0 = T(*T_ON)
    h += win(t0, T(1, 0), kick("SNS の投稿文") + post(48, 120, 804, 300, t0 + 0.2, 6)
             + f'<div class="stamp" style="left:48px;top:440px;font-size:64px;animation:{a("slam", t0 + 1.4, .3)}">固い</div>')
    t1 = T(1, 0)
    h += win(t1, T(2, 0), kick("きっちり書くと")
             + '<div class="card" style="left:48px;top:120px;width:804px;height:330px;justify-content:flex-start;padding-top:30px;font-size:40px;line-height:1.6">本日、〇〇を実施しました。<br>詳細は記事をご覧ください。</div>')
    t2 = T(2, 0)
    h += win(t2, T(3, 0), kick("エイイチの声") + f'<div class="msg" style="top:200px;text-align:center;font-size:76px;opacity:0;animation:{a("pop", t2 + 0.2, .35)}">一言、ユーモア</div>')
    t3, s3 = T(3, 0), S(3)
    h += win(t3, T(4, 0), kick("ときどき") + "".join(post(48 + k * 165, 170, 150, 260, t3 + 0.2 + k * 0.2, 4, k in (1, 3)) for k in range(5)))
    t4, s4 = T(4, 0), S(4)
    h += win(t4, None, kick("想いは")
             + '<div style="position:absolute;left:48px;top:150px;font-size:36px;font-weight:900;color:#F5F3EE">少しだけ</div>'
             + f'<div class="card or" style="left:260px;top:138px;width:200px;height:70px;padding:0;transform-origin:left;transform:scaleX(0);animation:{a("grow", t4 + 0.3, .4)}"></div>'
             + '<div style="position:absolute;left:48px;top:300px;font-size:36px;font-weight:900;color:#8A93A3">重すぎ</div>'
             + f'<div class="card" style="left:260px;top:288px;width:592px;height:70px;padding:0;background:#4A566B;transform-origin:left;transform:scaleX(0);animation:{a("grow", t4 + 0.8, .5)}"></div>'
             + f'<div class="strike" style="left:240px;width:630px;top:318px;animation:{a("strike", t4 + s4 - 1.2, .3)}"></div>')
    h += outro(T, OUTRO_K)
    return h


def OVER(T):
    return stage_fx(T, shakes=[(T(0, 1.4), 0.4)], fx=[dict(kind="rays", t=T(2, 0.2), d=2.0), dict(kind="speed", t=T(4, 2.0), d=0.9)])


FACE = [(-1, 0.0, 1.0, "smile"), (1, 0.0, 2.5, "trouble"), (2, 0.0, 2.2, "think"), (3, 0.0, 3.0, "joy"), (4, 0.0, 3.2, "wink"), ("end", 0.0, 3.0, "smile")]
POSE = [(-1, 0.0, 1), (0, 0.0, 2), (1, 0.0, 1), (2, 0.0, 4), (3, 0.0, 1), (4, 2.0, 3)]
LEAN = []
INTRO = "dash"
MOVES = [(1, 0.2, "bow", 1.2), (2, 0.2, "hop", 1.0), (3, 0.3, "tilt", 1.0), (4, 0.4, "spin", 1.2)]
SE = [(-1, 0.0, "se_whoosh", -9), (0, 0.6, "se_boot", -12), (0, 1.4, "se_pechin", -10), (2, 0.2, "se_ding", -10)] \
     + [(3, 0.2 + 0.2 * k, "se_pop", -14) for k in range(5)] + [(4, 2.0, "se_pechin", -11)]
ENDING = dict(kind="none")
