Skip to main content

logicaffeine_web/ui/components/
footer.rs

1//! Site-wide footer component.
2//!
3//! A responsive footer with four sections: Brand, Product, Resources, and Legal.
4//! Responsive behavior:
5//! - Desktop (1025px+): 4-column layout
6//! - Tablet (769-1024px): 2-column layout
7//! - Mobile (≤768px): Single column layout
8
9use crate::ui::components::icon::{Icon, IconSize, IconVariant};
10use crate::ui::components::main_nav::LOGO_SVG;
11use dioxus::prelude::*;
12
13const FOOTER_STYLES: &str = r#"
14.site-footer {
15    background: linear-gradient(180deg, rgba(6, 8, 20, 0) 0%, rgba(6, 8, 20, 1) 100%);
16    border-top: 1px solid rgba(255, 255, 255, 0.06);
17    padding: 64px 24px 32px;
18    margin-top: auto;
19}
20
21.footer-container {
22    max-width: 1200px;
23    margin: 0 auto;
24}
25
26.footer-grid {
27    display: grid;
28    grid-template-columns: 2fr repeat(3, 1fr);
29    gap: 48px;
30    margin-bottom: 48px;
31}
32
33/* Brand section (first column, wider) */
34.footer-brand {
35    display: flex;
36    flex-direction: column;
37    gap: 16px;
38}
39
40.footer-brand-content {
41    display: flex;
42    flex-direction: column;
43    gap: 12px;
44}
45
46.footer-brand-logo {
47    display: flex;
48    align-items: center;
49    gap: 12px;
50    text-decoration: none;
51}
52
53.footer-logo-img {
54    width: 40px;
55    height: 40px;
56    border-radius: 8px;
57    overflow: hidden;
58    flex-shrink: 0;
59}
60
61.footer-logo-img svg {
62    width: 100%;
63    height: 100%;
64    filter: invert(1);
65}
66
67.footer-logo-text {
68    font-size: 18px;
69    font-weight: 700;
70    color: var(--text-primary, #f0f0f0);
71    letter-spacing: -0.02em;
72}
73
74.footer-brand-tagline {
75    color: var(--text-tertiary, #909090);
76    font-size: 14px;
77    line-height: 1.6;
78    max-width: 280px;
79}
80
81.footer-social-links {
82    display: flex;
83    gap: 12px;
84    margin-top: 8px;
85}
86
87.footer-social-link {
88    display: flex;
89    align-items: center;
90    justify-content: center;
91    width: 36px;
92    height: 36px;
93    border-radius: 8px;
94    background: rgba(255, 255, 255, 0.05);
95    color: var(--text-secondary, #b0b0b0);
96    text-decoration: none;
97    transition: all 0.2s ease;
98    font-size: 18px;
99}
100
101.footer-social-link:hover {
102    background: rgba(0, 212, 255, 0.15);
103    color: var(--text-primary, #f0f0f0);
104}
105
106/* Footer sections (Product, Resources, Legal) */
107.footer-section {
108    display: flex;
109    flex-direction: column;
110    gap: 16px;
111}
112
113.footer-section-title {
114    font-size: 12px;
115    font-weight: 600;
116    text-transform: uppercase;
117    letter-spacing: 0.1em;
118    color: var(--text-secondary, #b0b0b0);
119    margin-bottom: 4px;
120}
121
122.footer-section-links {
123    display: flex;
124    flex-direction: column;
125    gap: 12px;
126}
127
128.footer-link {
129    color: var(--text-tertiary, #909090);
130    text-decoration: none;
131    font-size: 14px;
132    transition: color 0.2s ease;
133    display: flex;
134    align-items: center;
135    gap: 6px;
136}
137
138.footer-link:hover {
139    color: var(--text-primary, #f0f0f0);
140}
141
142.footer-link-badge {
143    font-size: 10px;
144    padding: 2px 6px;
145    border-radius: 4px;
146    background: rgba(0, 212, 255, 0.15);
147    color: var(--color-accent-blue, #60a5fa);
148    text-transform: uppercase;
149    font-weight: 600;
150}
151
152/* Footer bottom bar */
153.footer-bottom {
154    display: flex;
155    justify-content: space-between;
156    align-items: center;
157    padding-top: 24px;
158    border-top: 1px solid rgba(255, 255, 255, 0.06);
159}
160
161.footer-copyright {
162    color: var(--text-tertiary, #909090);
163    font-size: 13px;
164}
165
166.footer-bottom-links {
167    display: flex;
168    gap: 24px;
169}
170
171.footer-bottom-link {
172    color: var(--text-tertiary, #909090);
173    text-decoration: none;
174    font-size: 13px;
175    transition: color 0.2s ease;
176}
177
178.footer-bottom-link:hover {
179    color: var(--text-primary, #f0f0f0);
180}
181
182/* Tablet: 2-column layout */
183@media (min-width: 769px) and (max-width: 1024px) {
184    .footer-grid {
185        grid-template-columns: repeat(2, 1fr);
186        gap: 40px;
187    }
188
189    .footer-brand {
190        grid-column: span 2;
191        flex-direction: row;
192        justify-content: space-between;
193        align-items: flex-start;
194        padding-bottom: 24px;
195        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
196        margin-bottom: 8px;
197    }
198
199    .footer-brand-content {
200        display: flex;
201        flex-direction: column;
202        gap: 12px;
203    }
204
205    .footer-brand-tagline {
206        max-width: 320px;
207    }
208}
209
210/* Mobile: single column */
211@media (max-width: 768px) {
212    .site-footer {
213        padding: 48px 16px 24px;
214    }
215
216    .footer-grid {
217        grid-template-columns: 1fr;
218        gap: 32px;
219    }
220
221    .footer-brand {
222        text-align: center;
223        align-items: center;
224    }
225
226    .footer-brand-tagline {
227        max-width: 100%;
228    }
229
230    .footer-social-links {
231        justify-content: center;
232    }
233
234    .footer-section {
235        align-items: center;
236        text-align: center;
237    }
238
239    .footer-section-links {
240        align-items: center;
241    }
242
243    .footer-bottom {
244        flex-direction: column;
245        gap: 16px;
246        text-align: center;
247    }
248
249    .footer-bottom-links {
250        flex-wrap: wrap;
251        justify-content: center;
252        gap: 16px;
253    }
254}
255"#;
256
257/// Footer variant for minimal pages (Privacy, Terms)
258#[derive(Clone, Copy, PartialEq, Default)]
259pub enum FooterVariant {
260    #[default]
261    Full,
262    Minimal,
263}
264
265#[component]
266pub fn Footer(#[props(default)] variant: FooterVariant) -> Element {
267    let current_year = 2026; // Static for now, could use chrono
268
269    if variant == FooterVariant::Minimal {
270        return rsx! {
271            style { "{FOOTER_STYLES}" }
272            footer { class: "site-footer",
273                div { class: "footer-container",
274                    div { class: "footer-bottom",
275                        span { class: "footer-copyright",
276                            "© {current_year} Datacenter.Dev. Released under the MIT License."
277                        }
278                        div { class: "footer-bottom-links",
279                            Link { to: "/privacy", class: "footer-bottom-link", "Privacy Policy" }
280                            Link { to: "/terms", class: "footer-bottom-link", "Terms of Service" }
281                        }
282                    }
283                }
284            }
285        };
286    }
287
288    rsx! {
289        style { "{FOOTER_STYLES}" }
290        footer { class: "site-footer",
291            div { class: "footer-container",
292                div { class: "footer-grid",
293                    // Brand section
294                    div { class: "footer-brand",
295                        div { class: "footer-brand-content",
296                            Link { to: "/", class: "footer-brand-logo",
297                                div {
298                                    class: "footer-logo-img",
299                                    dangerous_inner_html: "{LOGO_SVG}"
300                                }
301                                span { class: "footer-logo-text", "LOGICAFFEINE" }
302                            }
303                            p { class: "footer-brand-tagline",
304                                "Debug your thoughts."
305                            }
306                        }
307                        div { class: "footer-social-links",
308                            a {
309                                href: "https://github.com/Brahmastra-Labs/logicaffeine",
310                                target: "_blank",
311                                rel: "noopener noreferrer",
312                                class: "footer-social-link",
313                                title: "GitHub",
314                                Icon { variant: IconVariant::Github, size: IconSize::Medium }
315                            }
316                            a {
317                                href: "https://x.com/logicaffeine",
318                                target: "_blank",
319                                rel: "noopener noreferrer",
320                                class: "footer-social-link",
321                                title: "X",
322                                "𝕏"
323                            }
324                        }
325                    }
326
327                    // Product section
328                    div { class: "footer-section",
329                        h4 { class: "footer-section-title", "Product" }
330                        nav { class: "footer-section-links",
331                            Link { to: "/studio", class: "footer-link", "Studio" }
332                            Link { to: "/learn", class: "footer-link", "Learn" }
333                            Link { to: "/guide", class: "footer-link", "Documentation" }
334                            Link { to: "/crates", class: "footer-link", "Crates" }
335                        }
336                    }
337
338                    // Resources section
339                    div { class: "footer-section",
340                        h4 { class: "footer-section-title", "Resources" }
341                        nav { class: "footer-section-links",
342                            Link { to: "/roadmap", class: "footer-link", "Roadmap" }
343                            Link { to: "/contact", class: "footer-link", "Contact" }
344                            Link { to: "/news", class: "footer-link", "News" }
345                            a {
346                                href: "https://github.com/Brahmastra-Labs/logicaffeine",
347                                target: "_blank",
348                                rel: "noopener noreferrer",
349                                class: "footer-link",
350                                "GitHub"
351                            }
352                        }
353                    }
354
355                    // Community section
356                    div { class: "footer-section",
357                        h4 { class: "footer-section-title", "Community" }
358                        nav { class: "footer-section-links",
359                            a {
360                                href: "https://discord.gg/pwnjnXvUHH",
361                                target: "_blank",
362                                rel: "noopener noreferrer",
363                                class: "footer-link",
364                                "Discord"
365                            }
366                        }
367                    }
368                }
369
370                // Bottom bar
371                div { class: "footer-bottom",
372                    span { class: "footer-copyright",
373                        "© {current_year} Datacenter.Dev. Released under the MIT License."
374                    }
375                    div { class: "footer-bottom-links",
376                        Link { to: "/privacy", class: "footer-bottom-link", "Privacy" }
377                        Link { to: "/terms", class: "footer-bottom-link", "Terms" }
378                    }
379                }
380            }
381        }
382    }
383}