|
5 | 5 | <link rel="stylesheet" href="{% static 'css/menu.css' %}" /> |
6 | 6 | <link rel="stylesheet" href="{% static 'css/rules.css' %}" /> |
7 | 7 | <style> |
| 8 | + /* ======== BUTTON SECTION ======== */ |
8 | 9 | .buttons-container { |
9 | 10 | display: flex; |
10 | 11 | justify-content: center; |
11 | | - gap: 20px; |
12 | | - margin-bottom: 20px; |
| 12 | + flex-wrap: wrap; |
| 13 | + gap: 14px; |
| 14 | + margin-bottom: 22px; |
13 | 15 | } |
| 16 | + |
14 | 17 | .filter-btn { |
15 | | - padding: 10px 20px; |
16 | | - font-size: 1.2rem; |
17 | | - font-weight: bold; |
| 18 | + padding: 8px 18px; |
| 19 | + font-size: 1rem; |
| 20 | + font-weight: 600; |
18 | 21 | border: none; |
19 | 22 | cursor: pointer; |
20 | | - border-radius: 5px; |
| 23 | + border-radius: 8px; |
21 | 24 | transition: all 0.3s ease-in-out; |
22 | 25 | } |
| 26 | + |
23 | 27 | .filter-btn.active { |
24 | 28 | background-color: rgb(18, 37, 106); |
25 | | - color: white; |
| 29 | + color: #fff; |
| 30 | + box-shadow: 0 4px 8px rgba(0,0,0,0.15); |
26 | 31 | } |
| 32 | + |
27 | 33 | .filter-btn.inactive { |
28 | 34 | background-color: #e0e0e0; |
29 | | - color: black; |
| 35 | + color: #000; |
| 36 | + } |
| 37 | + |
| 38 | + /* ======== MAIN STRUCTURE ======== */ |
| 39 | + main { |
| 40 | + width: 92%; |
| 41 | + max-width: 1100px; |
| 42 | + margin: 0 auto; |
| 43 | + padding-top: 0.5rem; |
| 44 | + box-sizing: border-box; |
| 45 | + } |
| 46 | + |
| 47 | + h1.text-center { |
| 48 | + text-align: center; |
| 49 | + margin: 1.4rem 0 1rem 0; |
| 50 | + font-size: 1.8rem; |
| 51 | + font-weight: 700; |
| 52 | + letter-spacing: 0.3px; |
| 53 | + word-wrap: break-word; |
| 54 | + } |
| 55 | + |
| 56 | + /* ======== CATERER INFO (SINGLE BLOCK) ======== */ |
| 57 | + .caterer-info-block { |
| 58 | + background: #ffffff; |
| 59 | + border: 1.5px solid rgb(227, 227, 227); |
| 60 | + border-radius: 10px; |
| 61 | + padding: 18px 25px; |
| 62 | + margin: 16px 0 28px 0; |
| 63 | + box-shadow: 0 3px 10px rgba(0,0,0,0.04); |
| 64 | + line-height: 1.6; |
| 65 | + color: #444; |
| 66 | + word-wrap: break-word; |
30 | 67 | } |
| 68 | + |
| 69 | + .caterer-info-block h2 { |
| 70 | + font-size: 1.3rem; |
| 71 | + margin-top: 0.8rem; |
| 72 | + margin-bottom: 0.4rem; |
| 73 | + color: #222; |
| 74 | + font-weight: 700; |
| 75 | + } |
| 76 | + |
| 77 | + .caterer-info-block p { |
| 78 | + font-size: 1.05rem; |
| 79 | + margin-bottom: 0.8rem; |
| 80 | + } |
| 81 | + |
| 82 | + .caterer-info-block hr { |
| 83 | + border: none; |
| 84 | + border-top: 1px solid #ddd; |
| 85 | + margin: 1rem 0; |
| 86 | + } |
| 87 | + |
| 88 | + /* ======== MENU CONTAINER (A4 ratio, responsive) ======== */ |
31 | 89 | .menu-container { |
32 | | - max-width: 80%; |
33 | | - height: 80vh; |
34 | | - overflow: auto; |
35 | | - border: 2px solid #ccc; |
36 | | - border-radius: 10px; |
37 | | - display: flex; |
38 | | - justify-content: center; |
39 | | - align-items: center; |
40 | | - margin: auto; |
41 | | - padding: 1rem; |
| 90 | + width: 100%; |
| 91 | + max-width: 900px; |
| 92 | + aspect-ratio: 1 / 1.414; /* A4 ratio */ |
| 93 | + border: 2px solid #ccc; |
| 94 | + border-radius: 10px; |
| 95 | + overflow: hidden; |
| 96 | + margin: auto; |
| 97 | + box-shadow: 0 3px 10px rgba(0,0,0,0.05); |
| 98 | + background-color: #fff; |
| 99 | + display: flex; |
| 100 | + justify-content: center; |
| 101 | + align-items: stretch; |
| 102 | + } |
| 103 | + |
| 104 | + .menu-inner-scroll { |
| 105 | + width: 100%; |
| 106 | + height: 100%; |
| 107 | + overflow-y: auto; |
| 108 | + border-radius: inherit; |
42 | 109 | } |
| 110 | + |
43 | 111 | iframe { |
44 | 112 | width: 100%; |
45 | 113 | height: 100%; |
46 | 114 | border: none; |
| 115 | + display: block; |
47 | 116 | } |
48 | | - section { |
49 | | - padding: 10px; |
50 | | - margin-bottom: 10px; |
51 | | - border-radius: 10px; |
52 | | - background: #ffffff; |
53 | | - border: solid rgb(227, 227, 227); |
| 117 | + |
| 118 | + /* ======== RESPONSIVE BEHAVIOR ======== */ |
| 119 | + @media (max-width: 1024px) { |
| 120 | + main { |
| 121 | + width: 94%; |
| 122 | + } |
| 123 | + |
| 124 | + .caterer-info-block { |
| 125 | + padding: 15px 20px; |
| 126 | + } |
| 127 | + |
| 128 | + .filter-btn { |
| 129 | + font-size: 0.95rem; |
| 130 | + padding: 7px 16px; |
| 131 | + } |
| 132 | + |
| 133 | + .menu-container { |
| 134 | + max-width: 95%; |
| 135 | + } |
54 | 136 | } |
55 | | - .information { |
56 | | - font-size: 1.1rem; |
57 | | - line-height: 1.6; |
58 | | - color: #555; |
59 | | - background: #ffffff; |
60 | | - padding: 15px; |
61 | | - border-radius: 8px; |
| 137 | + |
| 138 | + @media (max-width: 768px) { |
| 139 | + h1.text-center { |
| 140 | + font-size: 1.5rem; |
| 141 | + } |
| 142 | + |
| 143 | + .caterer-info-block h2 { |
| 144 | + font-size: 1.15rem; |
| 145 | + } |
| 146 | + |
| 147 | + .caterer-info-block p { |
| 148 | + font-size: 1rem; |
| 149 | + } |
| 150 | + |
| 151 | + .menu-container { |
| 152 | + aspect-ratio: auto; |
| 153 | + height: 70vh; /* maintain fixed visual space */ |
| 154 | + } |
62 | 155 | } |
63 | 156 |
|
| 157 | + @media (max-width: 480px) { |
| 158 | + .caterer-info-block { |
| 159 | + padding: 12px 16px; |
| 160 | + } |
| 161 | + |
| 162 | + .buttons-container { |
| 163 | + gap: 10px; |
| 164 | + } |
| 165 | + |
| 166 | + .filter-btn { |
| 167 | + font-size: 0.9rem; |
| 168 | + padding: 6px 12px; |
| 169 | + border-radius: 6px; |
| 170 | + } |
| 171 | + |
| 172 | + .menu-container { |
| 173 | + height: 65vh; |
| 174 | + } |
| 175 | + } |
64 | 176 | </style> |
65 | 177 | {% endblock %} |
66 | 178 |
|
67 | 179 | {% block body %} |
68 | 180 | <main> |
69 | 181 | <h1 class="text-center">Caterers Information</h1> |
70 | 182 |
|
71 | | - {% for caterer in caterers %} |
72 | | - <section class="container"> |
73 | | - <h2>{{ caterer.name }} Caterers</h2> |
74 | | - <div class="information mx-md-5 mx-3"> |
| 183 | + <div class="caterer-info-block"> |
| 184 | + {% for caterer in caterers %} |
| 185 | + <h2>{{ caterer.name }} Caterers</h2> |
75 | 186 | <p>{{ caterer.upper_description }}</p> |
76 | | - </div> |
77 | | - </section> |
78 | | - {% endfor %} |
| 187 | + {% if not forloop.last %} |
| 188 | + <hr> |
| 189 | + {% endif %} |
| 190 | + {% endfor %} |
| 191 | + </div> |
79 | 192 |
|
80 | 193 | <h1 class="text-center">Menu</h1> |
81 | | - <div class="buttons-container"> |
82 | | - {% for menu in menus %} |
83 | | - <button class="filter-btn {% if forloop.first %}active{% else %}inactive{% endif %}" |
84 | | - onclick="showMenu('{{ menu.menu_type }}')" |
85 | | - id="btn-{{ menu.menu_type }}"> |
86 | | - {{ menu.menu_type }} |
87 | | - </button> |
88 | | - {% endfor %} |
89 | | - </div> |
90 | | - {% for menu in menus %} |
91 | | - <div class="menu-container" id="menu-{{ menu.menu_type }}" {% if not forloop.first %}style="display:none;"{% endif %}> |
92 | | - <iframe src="{{ menu.sheet_url}}"></iframe> |
93 | | - </div> |
94 | | - {% endfor %} |
95 | | - <br> |
| 194 | + <div class="buttons-container"> |
| 195 | + {% for menu in menus %} |
| 196 | + <button class="filter-btn {% if forloop.first %}active{% else %}inactive{% endif %}" |
| 197 | + onclick="showMenu('{{ menu.menu_type }}')" |
| 198 | + id="btn-{{ menu.menu_type }}"> |
| 199 | + {{ menu.menu_type }} |
| 200 | + </button> |
| 201 | + {% endfor %} |
| 202 | + </div> |
| 203 | + |
| 204 | + {% for menu in menus %} |
| 205 | + <div class="menu-container" id="menu-{{ menu.menu_type }}" {% if not forloop.first %}style="display:none;"{% endif %}> |
| 206 | + <div class="menu-inner-scroll"> |
| 207 | + <iframe src="{{ menu.sheet_url }}"></iframe> |
| 208 | + </div> |
| 209 | + </div> |
| 210 | + {% endfor %} |
| 211 | + <br> |
96 | 212 | </main> |
97 | 213 |
|
98 | 214 | <script> |
99 | 215 | function showMenu(menuType) { |
100 | 216 | document.querySelectorAll('.menu-container').forEach(menu => { |
101 | 217 | menu.style.display = 'none'; |
102 | 218 | }); |
103 | | - document.getElementById('menu-' + menuType).style.display = 'block'; |
| 219 | + document.getElementById('menu-' + menuType).style.display = 'flex'; |
104 | 220 | document.querySelectorAll('.filter-btn').forEach(btn => { |
105 | 221 | btn.classList.remove('active'); |
106 | 222 | btn.classList.add('inactive'); |
|
0 commit comments