Skip to content

Commit ea3e8b6

Browse files
committed
add: time-tableのページを追加
1 parent 5bb6f2d commit ea3e8b6

File tree

4 files changed

+422
-0
lines changed

4 files changed

+422
-0
lines changed

_data/time_table.yml

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
slot_minutes: 10
2+
3+
rooms:
4+
- 大会議室(セッション)
5+
- 展示(コンテスト用)
6+
- 展示
7+
- 中会議室(WS1 電子工作)
8+
- 中会議室(WS2)LTブース
9+
- 中会議室(WS3 )
10+
- 中会議室(WS4)
11+
12+
room_styles:
13+
大会議室(セッション): { color: "#c43b3b" }
14+
展示(コンテスト用): { color: "#f5a201" }
15+
展示: { color: "#888888" }
16+
中会議室(WS1 電子工作): { color: "#2e7d32" }
17+
中会議室(WS2)LTブース: { color: "#1976d2" }
18+
中会議室(WS3 ): { color: "#7b1fa2" }
19+
中会議室(WS4): { color: "#ef6c00" }
20+
21+
events:
22+
# ── 大会議室(セッション)
23+
- room: 大会議室(セッション)
24+
start: "10:00"
25+
end: "10:10"
26+
title: "開会式"
27+
- room: 大会議室(セッション)
28+
start: "10:10"
29+
end: "10:20"
30+
title: "基調講演(宮島さん)"
31+
- room: 大会議室(セッション)
32+
start: "11:00"
33+
end: "12:00"
34+
title: "コンテスト作品発表"
35+
- room: 大会議室(セッション)
36+
start: "12:00"
37+
end: "12:40"
38+
title: "ランチタイム"
39+
note: "適宜お昼をお取りください"
40+
- room: 大会議室(セッション)
41+
start: "12:40"
42+
end: "13:00"
43+
title: "みんなのセッション"
44+
- room: 大会議室(セッション)
45+
start: "13:40"
46+
end: "14:00"
47+
title: "九州チャンピオン座談会"
48+
- room: 大会議室(セッション)
49+
start: "14:20"
50+
end: "14:40"
51+
title: "スピーカーセッション_とり子さん(20分)"
52+
- room: 大会議室(セッション)
53+
start: "14:40"
54+
end: "14:50"
55+
title: "伸びるかも予備"
56+
- room: 大会議室(セッション)
57+
start: "14:50"
58+
end: "15:10"
59+
title: "スピーカーセッション_早良区Dojoチャンピオン(20分)"
60+
- room: 大会議室(セッション)
61+
start: "15:10"
62+
end: "15:20"
63+
title: "スポンサーセッション(2件)"
64+
- room: 大会議室(セッション)
65+
start: "15:20"
66+
end: "15:30"
67+
title: "招待講演(小宮山さん)"
68+
- room: 大会議室(セッション)
69+
start: "16:00"
70+
end: "16:10"
71+
title: "コンテスト結果発表"
72+
- room: 大会議室(セッション)
73+
start: "16:10"
74+
end: "16:20"
75+
title: "スポンサーセッション(1件)"
76+
note: "該当なしの場合はCoderDojo Japan活動報告"
77+
- room: 大会議室(セッション)
78+
start: "16:20"
79+
end: "16:30"
80+
title: "閉会式"
81+
82+
# ── 展示
83+
- room: 展示(コンテスト用)
84+
start: "10:00"
85+
end: "16:00"
86+
title: "ファイナリスト作品展示"
87+
note: "14:00 投票締切"
88+
- room: 展示
89+
start: "10:00"
90+
end: "16:00"
91+
title: "展示"
92+
93+
# ── WS1 電子工作(随時受付)
94+
- room: 中会議室(WS1 電子工作)
95+
start: "11:00"
96+
end: "16:00"
97+
title: "電子工作ワークショップ(随時受付)"
98+
99+
# ── WS2 LTブース
100+
- room: 中会議室(WS2)LTブース
101+
start: "11:20"
102+
end: "12:00"
103+
title: "Dojo関係者等大人LT(要申込)"
104+
- room: 中会議室(WS2)LTブース
105+
start: "13:00"
106+
end: "14:00"
107+
title: "DojoニンジャLT(要申込)"
108+
109+
# ── WS3
110+
- room: 中会議室(WS3 )
111+
start: "11:00"
112+
end: "12:00"
113+
title: "ブレンダー(要申込)"
114+
- room: 中会議室(WS3 )
115+
start: "13:00"
116+
end: "14:00"
117+
title: "PLAYRISE"
118+
119+
# ── WS4
120+
- room: 中会議室(WS4)
121+
start: "11:00"
122+
end: "12:00"
123+
title: "PowerPointとプログラミング"
124+
- room: 中会議室(WS4)
125+
start: "14:10"
126+
end: "15:00"
127+
title: "PowerPointとプログラミング"

_pages/time-table.html

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
---
2+
layout: default
3+
permalink: /time-table/
4+
title: タイムテーブル
5+
---
6+
{% include navbar.html %}
7+
8+
{% assign tt = site.data.time_table %}
9+
{% assign slot = tt.slot_minutes | default: 15 %}
10+
{% assign rooms = tt.rooms %}
11+
{% assign room_count = rooms | size %}
12+
13+
{% assign day_start_min = 600 %}
14+
{% assign day_end_min = 960 %}
15+
{% assign total_minutes = day_end_min | minus: day_start_min %}
16+
{% assign slots_count = total_minutes | divided_by: slot %}
17+
{% assign last_row = slots_count | minus: 1 %}
18+
19+
<section class="max-w-[1200px] mx-auto px-4 sm:px-8 mt-30 xl:mt-15">
20+
<h2 class="text-4xl text-center mb-8">
21+
Time table
22+
<span class="block mt-3 text-2xl">タイムテーブル</span>
23+
</h2>
24+
25+
<div class="ttable-wrap" aria-label="タイムテーブル(横スクロール可)">
26+
<table class="ttable" style="--room-count: {{ room_count }};">
27+
<caption>
28+
{{ tt.date | default: site.date_event }} のタイムテーブル
29+
</caption>
30+
31+
<thead>
32+
<tr>
33+
<th scope="col" class="ttable__th ttable__th--start">時間</th>
34+
{% for r in rooms %}
35+
{% assign rstyle = tt.room_styles[r] %}
36+
<th scope="col"
37+
class="ttable__th ttable__th--room"
38+
style="--room-color: {{ rstyle.color | default: '#c43b3b' }};">
39+
<span class="ttable__room-cap">{{ r }}</span>
40+
</th>
41+
{% endfor %}
42+
</tr>
43+
</thead>
44+
45+
<tbody>
46+
{% for i in (0..last_row) %}
47+
{% assign row_min = i | times: slot | plus: day_start_min %}
48+
{% assign h = row_min | divided_by: 60 %}
49+
{% assign mf = row_min | modulo: 60 | plus: 0 | prepend: '0' | slice: -2, 2 %}
50+
51+
<tr>
52+
<!-- 左1列(sticky) -->
53+
<th scope="row" class="ttable__cell ttable__cell--start">{{ h }}:{{ mf }}</th>
54+
55+
{% for r in rooms %}
56+
{% assign rstyle = tt.room_styles[r] %}
57+
{% assign events_in_room = tt.events | where: 'room', r | sort: 'start' %}
58+
59+
{% assign active_event = nil %}
60+
{% assign active_event_start_index = nil %}
61+
62+
{% for ev in events_in_room %}
63+
{% assign s_h = ev.start | split: ':' | first | plus: 0 %}
64+
{% assign s_m = ev.start | split: ':' | last | plus: 0 %}
65+
{% assign e_h = ev.end | split: ':' | first | plus: 0 %}
66+
{% assign e_m = ev.end | split: ':' | last | plus: 0 %}
67+
{% assign s_min = s_h | times: 60 | plus: s_m %}
68+
{% assign e_min = e_h | times: 60 | plus: e_m %}
69+
70+
{% assign s_clamped = s_min %}
71+
{% if s_clamped < day_start_min %}{% assign s_clamped = day_start_min %}{% endif %}
72+
{% assign e_clamped = e_min %}
73+
{% if e_clamped > day_end_min %}{% assign e_clamped = day_end_min %}{% endif %}
74+
75+
{% assign span_minutes = e_clamped | minus: s_clamped %}
76+
{% if span_minutes > 0 %}
77+
{% assign numerator = span_minutes | plus: slot | minus: 1 %}
78+
{% assign span_slots = numerator | divided_by: slot %}
79+
{% assign s_index = s_clamped | minus: day_start_min | divided_by: slot %}
80+
{% assign e_index = s_index | plus: span_slots %}
81+
{% if i >= s_index and i < e_index %}
82+
{% assign active_event = ev %}
83+
{% assign active_event_start_index = s_index %}
84+
{% endif %}
85+
{% endif %}
86+
{% endfor %}
87+
88+
{% if active_event and i == active_event_start_index %}
89+
{%- assign s_h = active_event.start | split: ':' | first | plus: 0 -%}
90+
{%- assign s_m = active_event.start | split: ':' | last | plus: 0 -%}
91+
{%- assign e_h = active_event.end | split: ':' | first | plus: 0 -%}
92+
{%- assign e_m = active_event.end | split: ':' | last | plus: 0 -%}
93+
{%- assign s_min = s_h | times: 60 | plus: s_m -%}
94+
{%- assign e_min = e_h | times: 60 | plus: e_m -%}
95+
{%- if s_min < day_start_min -%}{%- assign s_min = day_start_min -%}{%- endif -%}
96+
{%- if e_min > day_end_min -%}{%- assign e_min = day_end_min -%}{%- endif -%}
97+
{%- assign span_minutes = e_min | minus: s_min -%}
98+
{%- assign numerator = span_minutes | plus: slot | minus: 1 -%}
99+
{%- assign span_slots = numerator | divided_by: slot -%}
100+
{%- assign accent = active_event.accent | default: rstyle.color -%}
101+
<td class="ttable__cell ttable__cell--event" rowspan="{{ span_slots }}" style="--span: {{ span_slots }};">
102+
<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 %}
108+
{% if active_event.badge %}
109+
<span class="ttable__badge">{{ active_event.badge }}</span>
110+
{% endif %}
111+
</div>
112+
</td>
113+
{% elsif active_event == nil %}
114+
<td class="ttable__cell ttable__cell--empty" aria-label="空き時間"></td>
115+
{% endif %}
116+
{% endfor %}
117+
</tr>
118+
{% endfor %}
119+
</tbody>
120+
</table>
121+
</div>
122+
123+
<script>
124+
// 重複検知(後勝ち)
125+
(function () {
126+
const data = {
127+
slot: {{ slot | jsonify }},
128+
dayStart: {{ day_start_min | jsonify }},
129+
dayEnd: {{ day_end_min | jsonify }},
130+
rooms: {{ rooms | jsonify }},
131+
events: {{ tt.events | jsonify }}
132+
};
133+
const map = new Map();
134+
data.rooms.forEach(r => map.set(r, []));
135+
const toMin = t => { const [h,m]=String(t).split(':').map(Number); return h*60+m; };
136+
for (const ev of data.events) (map.get(ev.room)||map.set(ev.room,[]).get(ev.room)).push(ev);
137+
for (const [room, list] of map) {
138+
list.sort((a,b)=>toMin(a.start)-toMin(b.start));
139+
for (let i=0;i<list.length-1;i++){
140+
const a=list[i], b=list[i+1];
141+
const as=Math.max(toMin(a.start), data.dayStart);
142+
const ae=Math.min(toMin(a.end), data.dayEnd);
143+
const bs=Math.max(toMin(b.start), data.dayStart);
144+
if (ae>bs) console.warn(`[time-table] Overlap in "${room}":`, a, b, '→ later wins');
145+
}
146+
}
147+
})();
148+
</script>
149+
</section>

0 commit comments

Comments
 (0)