Something went wrong. Try again.
An all-affirming social network based on the AT Protocol. nagi.suibari.com
Something went wrong. Try again.
2.0 kB · 80 lines
Svelte
at main
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081<script lang="ts"> import { m } from '$lib/i18n/i18n.svelte'; import Icon from './shell/Icon.svelte';
/** * スマホ専用の投稿ボタン。この幅では左サイドバーごと消えるので、 * 親指の届く右下に浮かせる。PC・タブレットはサイドバー内の PostButton が担当する * (浮かせたままだとサイドバーの幅・余白を推測することになり、揃わない)。 * カードFAB はこの幅でだけ左へ逃がしてあるので重ならない。 */ let { onclick }: { onclick: () => void } = $props();</script>
<button class="post-fab" type="button" aria-label={m.postFabLabel()} title={m.postFabLabel()} {onclick}> <Icon name="send" size={22} /></button>
<style> .post-fab { /* サイドバーが出ている幅では、列の中の PostButton に任せる。 */ display: none; }
@media (max-width: 767px) { .post-fab { position: fixed; /* .mobile-nav(20)・.feed-tabs(15) より上、絵文字ピッカー(29/30)・一時通知(40)・ 各種モーダル(100〜120) より下。カードFAB と同じ層。 */ z-index: 25; display: grid; place-items: center; /* .mobile-nav(fixed, 68px + safe-area)を avoid する。基準値はカードFABと揃える。 */ bottom: calc(82px + env(safe-area-inset-bottom)); right: 16px; width: 56px; height: 56px; padding: 0; border: 0; border-radius: 50%; background: var(--accent); box-shadow: var(--shadow-card); color: var(--text-on-accent); cursor: pointer; transition: transform 0.14s ease; } }
@media (max-width: 380px) { .post-fab { right: 12px; } }
.post-fab:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) { .post-fab:active { transform: scale(0.94); } }
@media (prefers-reduced-motion: reduce) { .post-fab { transition: none; }
.post-fab:active { transform: none; } }</style>