|
25 | 25 | --shadow: 0 18px 50px rgba(24, 49, 43, 0.14); |
26 | 26 | } |
27 | 27 | * { box-sizing: border-box; } |
28 | | - html, body { margin: 0; min-height: 100%; } |
| 28 | + html, body { margin: 0; min-height: 100%; overflow-x: hidden; } |
29 | 29 | body { |
30 | 30 | font-family: -apple-system, BlinkMacSystemFont, "Noto Sans TC", "Microsoft JhengHei", "Segoe UI", sans-serif; |
31 | 31 | background: var(--bg); |
|
51 | 51 | overflow-y: auto; |
52 | 52 | overscroll-behavior: contain; |
53 | 53 | scroll-padding: 72px 0 88px; |
| 54 | + -webkit-overflow-scrolling: touch; |
| 55 | + touch-action: pan-y; |
54 | 56 | } |
55 | 57 | .slide.active { display: flex; animation: in 0.28s ease; } |
56 | 58 | @keyframes in { |
|
59 | 61 | } |
60 | 62 | .slide-inner { |
61 | 63 | width: min(1180px, 100%); |
| 64 | + min-width: 0; |
62 | 65 | margin: auto; |
63 | 66 | } |
64 | 67 | .kicker { |
|
86 | 89 | line-height: 1.08; |
87 | 90 | letter-spacing: 0; |
88 | 91 | font-weight: 850; |
| 92 | + overflow-wrap: anywhere; |
| 93 | + word-break: break-word; |
89 | 94 | } |
90 | 95 | h2 { |
91 | 96 | font-size: clamp(30px, 4.2vw, 54px); |
92 | 97 | line-height: 1.16; |
93 | 98 | letter-spacing: 0; |
94 | 99 | font-weight: 820; |
95 | 100 | margin-bottom: 22px; |
| 101 | + overflow-wrap: anywhere; |
| 102 | + word-break: break-word; |
96 | 103 | } |
97 | 104 | h3 { |
98 | 105 | font-size: clamp(18px, 2vw, 24px); |
|
417 | 424 | @media (max-width: 850px) { |
418 | 425 | body { overflow: auto; } |
419 | 426 | .deck { height: auto; min-height: 100vh; } |
420 | | - .slide { position: relative; min-height: 100vh; padding: 70px 22px 84px; } |
| 427 | + .slide { |
| 428 | + position: relative; |
| 429 | + min-height: 100vh; |
| 430 | + padding: 70px 22px 84px; |
| 431 | + overflow: visible; |
| 432 | + } |
| 433 | + .slide.active { display: block; } |
421 | 434 | .slide:not(.active) { display: none; } |
| 435 | + .slide-inner { width: min(100%, 520px); margin: 0 auto; } |
| 436 | + h1 { width: 100%; font-size: 32px; line-height: 1.18; word-break: break-all; } |
| 437 | + h2 { width: 100%; font-size: 30px; line-height: 1.22; word-break: break-all; } |
422 | 438 | .grid, .grid.two, .timeline, .tool-board, .worksheet { grid-template-columns: 1fr; } |
423 | 439 | .day { border-right: 0; border-bottom: 1px solid var(--line); min-height: auto; } |
424 | 440 | .day:last-child { border-bottom: 0; } |
@@ -732,6 +748,7 @@ <h2>從會使用 AI,到會設計 AI 協作</h2> |
732 | 748 | slides[current].scrollTop = 0; |
733 | 749 | slides[current].scrollLeft = 0; |
734 | 750 | } |
| 751 | + window.scrollTo(0, 0); |
735 | 752 | dots.querySelectorAll(".dot").forEach((dot, i) => dot.classList.toggle("active", i === current)); |
736 | 753 | counter.textContent = (current + 1) + " / " + slides.length; |
737 | 754 | } |
@@ -765,6 +782,30 @@ <h2>從會使用 AI,到會設計 AI 協作</h2> |
765 | 782 | } |
766 | 783 | }); |
767 | 784 |
|
| 785 | + let touchStartX = 0; |
| 786 | + let touchStartY = 0; |
| 787 | + let touchStartedOnControl = false; |
| 788 | + |
| 789 | + document.addEventListener("touchstart", event => { |
| 790 | + const touch = event.changedTouches[0]; |
| 791 | + if (!touch) return; |
| 792 | + touchStartedOnControl = Boolean(event.target?.closest?.("a, button, input, textarea, select")); |
| 793 | + touchStartX = touch.clientX; |
| 794 | + touchStartY = touch.clientY; |
| 795 | + }, { passive: true }); |
| 796 | + |
| 797 | + document.addEventListener("touchend", event => { |
| 798 | + if (touchStartedOnControl) return; |
| 799 | + const touch = event.changedTouches[0]; |
| 800 | + if (!touch) return; |
| 801 | + const deltaX = touch.clientX - touchStartX; |
| 802 | + const deltaY = touch.clientY - touchStartY; |
| 803 | + const isHorizontalSwipe = Math.abs(deltaX) > 56 && Math.abs(deltaX) > Math.abs(deltaY) * 1.25; |
| 804 | + if (!isHorizontalSwipe) return; |
| 805 | + if (deltaX < 0) show(current + 1); |
| 806 | + if (deltaX > 0) show(current - 1); |
| 807 | + }, { passive: true }); |
| 808 | + |
768 | 809 | document.querySelectorAll(".layer").forEach(layer => { |
769 | 810 | layer.addEventListener("click", () => { |
770 | 811 | document.querySelectorAll(".layer").forEach(item => item.classList.remove("active")); |
|
0 commit comments