Skip to content

Commit acfbb30

Browse files
committed
色々調整してみた(ナビバーと相性が悪い...)
1 parent ea3e8b6 commit acfbb30

File tree

2 files changed

+17
-58
lines changed

2 files changed

+17
-58
lines changed

_pages/time-table.html

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,15 @@
1616
{% assign slots_count = total_minutes | divided_by: slot %}
1717
{% assign last_row = slots_count | minus: 1 %}
1818

19-
<section class="max-w-[1200px] mx-auto px-4 sm:px-8 mt-30 xl:mt-15">
19+
<section class="w-[calc(100dvw-40px)] max-w-7xl mx-auto mt-25 xl:mt-5">
2020
<h2 class="text-4xl text-center mb-8">
2121
Time table
2222
<span class="block mt-3 text-2xl">タイムテーブル</span>
2323
</h2>
24-
25-
<div class="ttable-wrap" aria-label="タイムテーブル(横スクロール可)">
24+
<div class="overflow-x-auto overflow-y-auto h-[500px] border-[1px] border-[#e6e6e9]" aria-label="タイムテーブル(横スクロール可)">
2625
<table class="ttable" style="--room-count: {{ room_count }};">
27-
<caption>
28-
{{ tt.date | default: site.date_event }} のタイムテーブル
29-
</caption>
30-
3126
<thead>
32-
<tr>
27+
<tr class="sticky z-5">
3328
<th scope="col" class="ttable__th ttable__th--start">時間</th>
3429
{% for r in rooms %}
3530
{% assign rstyle = tt.room_styles[r] %}
@@ -100,11 +95,13 @@ <h2 class="text-4xl text-center mb-8">
10095
{%- assign accent = active_event.accent | default: rstyle.color -%}
10196
<td class="ttable__cell ttable__cell--event" rowspan="{{ span_slots }}" style="--span: {{ span_slots }};">
10297
<div class="ttable__event" style="--accent: {{ accent | default: '#c43b3b' }};">
103-
<div class="ttable__event-time">{{ active_event.start }}–{{ active_event.end }}</div>
104-
<div class="ttable__event-title">{{ active_event.title }}</div>
105-
{% if active_event.subtitle %}
106-
<div class="ttable__event-subtitle">{{ active_event.subtitle }}</div>
107-
{% endif %}
98+
<div class="sticky top-[50px]">
99+
<div class="ttable__event-time">{{ active_event.start }}–{{ active_event.end }}</div>
100+
<div class="ttable__event-title">{{ active_event.title }}</div>
101+
{% if active_event.subtitle %}
102+
<div class="ttable__event-subtitle">{{ active_event.subtitle }}</div>
103+
{% endif %}
104+
</div>
108105
{% if active_event.badge %}
109106
<span class="ttable__badge">{{ active_event.badge }}</span>
110107
{% endif %}

_sass/pages/time-table.scss

Lines changed: 7 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,25 @@
1-
@use '../global/variables' as *;
2-
3-
@media (max-width: 640px) {
4-
:root, body { max-width: 100%; overflow-x: clip; }
5-
}
6-
@supports not (overflow-x: clip) {
7-
@media (max-width: 640px) { :root, body { overflow-x: hidden; } }
8-
}
9-
101
/* ====== スクロール容器 ====== */
112
.ttable-wrap{
123
position: relative;
134
width: 100%;
145
max-width: 100%;
156
overflow-x: auto;
16-
overflow-y: visible;
7+
overflow-y: auto;
178
-webkit-overflow-scrolling: touch;
18-
overscroll-behavior-x: contain;
199
contain: content;
20-
scrollbar-gutter: stable both-edges;
2110
}
2211

2312
/* ====== テーブル ======
2413
PCでも「時間は4桁」「会場は全文表示」できるように
2514
table-layout: auto と最小幅制約を組み合わせる
2615
*/
2716
.ttable{
28-
--w-start: 8ch;
29-
--room-min: 20rem;
17+
table-layout: fixed;
18+
--w-start: 5rem;
19+
--room-min: clamp(235px, calc((100dvw - var(--w-start) - 10rem)), 20rem);
3020
--row-h: 56px;
3121

3222
width: calc(var(--w-start) + var(--room-min) * var(--room-count));
33-
min-width: 100%;
34-
border-collapse: separate;
35-
border-spacing: 0;
36-
table-layout: auto;
37-
background: #fff;
38-
border: 1px solid #e6e6e9;
3923
}
4024

4125
/* ヘッダー */
@@ -59,9 +43,9 @@
5943
/* 会場ヘッダーと本文セルの最小幅をそろえる(PCで潰れない) */
6044
.ttable__th--room{ border-left: 1px solid #ececf1; color:#111; background:
6145
linear-gradient(0deg, rgba(255,255,255,0.88), rgba(255,255,255,0.88)), var(--room-color, #c43b3b);
62-
min-width: var(--room-min);
46+
width: var(--room-min);
6347
}
64-
.ttable tbody td{ min-width: var(--room-min); }
48+
.ttable tbody td{ width: var(--room-min); }
6549

6650
/* 行ストライプ & グリッド線 */
6751
.ttable tbody tr{ height: var(--row-h); }
@@ -111,35 +95,13 @@
11195
box-shadow: 0 2px 8px rgba(0,0,0,0.06);
11296
padding: 10px 12px 12px;
11397
background: #fff;
114-
overflow: hidden;
11598
height: 100%;
11699
display: flex;
117100
flex-direction: column;
101+
overflow: clip;
118102
}
119103
.ttable__event::before{ content:""; position:absolute; inset:0 0 auto 0; height: 6px; background: var(--accent, #c43b3b); }
120104
.ttable__event-time{ font-weight: 800; font-size: 1.05rem; letter-spacing: .3px; margin: 8px 0 4px; color: #c43b3b; }
121105
.ttable__event-title{ font-weight: 800; line-height: 1.35; margin-bottom: 4px; color: #121212; }
122106
.ttable__event-subtitle{ color: #ee7d05; font-weight: 700; font-size: .92rem; line-height: 1.3; }
123107
.ttable__badge{ position: absolute; top: 8px; right: 10px; padding: 2px 8px; border-radius: 999px; font-size: .85rem; font-weight: 800; color: #fff; background: var(--accent,#c43b3b); box-shadow: 0 1px 4px rgba(0,0,0,.1); }
124-
125-
/* スマホ微調整 */
126-
@media (max-width: 640px){
127-
.ttable{ --row-h: 54px; --room-min: 16rem; --w-start: 7ch; }
128-
.ttable thead th, .ttable__cell{ padding: 8px; font-size: .95rem; }
129-
.ttable thead th{ white-space: normal; }
130-
.ttable__room-cap{ overflow-wrap: anywhere; word-break: keep-all; }
131-
.ttable tbody tr:nth-child(6n){
132-
box-shadow: inset 0 -1.5px 0 rgba(0,0,0,0.18);
133-
}
134-
.ttable-wrap::before, .ttable-wrap::after{
135-
content: ""; position: absolute; top: 0; bottom: 0; width: 18px;
136-
pointer-events: none; z-index: 6;
137-
}
138-
.ttable-wrap::before{ left: 0; background: linear-gradient(to right, #fff, rgba(255,255,255,0)); }
139-
.ttable-wrap::after{ right: 0; background: linear-gradient(to left, #fff, rgba(255,255,255,0)); }
140-
.ttable tbody tr{ background-image: linear-gradient(to right, rgba(0,0,0,0.08) 50%, rgba(0,0,0,0) 0); }
141-
.ttable__event-time{ font-size: 1rem; margin-top: 6px; }
142-
.ttable__event-title{ font-size: .98rem; }
143-
.ttable__event-subtitle{ font-size: .86rem; }
144-
}
145-

0 commit comments

Comments
 (0)