|
| 1 | +<template> |
| 2 | + <div class="footer-bottom"> |
| 3 | + <header class="site-head"> |
| 4 | + <div class="site-head__brand"> |
| 5 | + <a href="/"> |
| 6 | + <span class="visually-hidden">Wikimedia Deutschland e V.</span> |
| 7 | + <Logo/> |
| 8 | + </a> |
| 9 | + </div> |
| 10 | + <div class="site-head__mobile-nav-toggle"> |
| 11 | + <button class="mobile-nav-toggle" :class="{ 'mobile-nav-toggle--active': menuActive }" @click="menuActive = !menuActive" aria-label="Hide Navigation Menu" :aria-expanded="menuActive"> |
| 12 | + <span class="mobile-nav-toggle__open"> |
| 13 | + <Burger/> |
| 14 | + </span> |
| 15 | + <span class="mobile-nav-toggle__close"> |
| 16 | + <Close/> |
| 17 | + </span> |
| 18 | + </button> |
| 19 | + </div> |
| 20 | + <div class="site-head__menu"> |
| 21 | + <nav class="nav" :class="{ 'nav--active': menuActive }" aria-label="Main"> |
| 22 | + <ul class="nav__list"> |
| 23 | + <li><a href="#" aria-current="page">Donate</a></li> |
| 24 | + <li><a href="#">Become a Member</a></li> |
| 25 | + <li><a href="#">Allocation of Funds</a></li> |
| 26 | + <li><a href="#">FAQ</a></li> |
| 27 | + </ul> |
| 28 | + </nav> |
| 29 | + </div> |
| 30 | + <div class="site-head__locale locale" :class="{ 'locale--active': localeActive }"> |
| 31 | + <button class="locale__button" @click="localeActive = !localeActive"> |
| 32 | + <LocaleIcon/><span>en</span><ChevronDown/> |
| 33 | + </button> |
| 34 | + <form action="/" class="locale__form"> |
| 35 | + <label><input type="radio" name="locale" value="de"> Deutsch</label> |
| 36 | + <label><input type="radio" name="locale" value="en" checked> English</label> |
| 37 | + <button class="button" type="submit" data-button-size="small">Set Language</button> |
| 38 | + </form> |
| 39 | + </div> |
| 40 | + </header> |
| 41 | + |
| 42 | + <div class="content-wrapper flow footer-bottom__stretch"> |
| 43 | + |
| 44 | + <div class="sidebar" data-direction="rtl"> |
| 45 | + |
| 46 | + <main class="flow"> |
| 47 | + <PageDetail v-if="page" :page="page"/> |
| 48 | + <PatternDetail v-else-if="pattern" :pattern="pattern" :assets-path="assetsPath"/> |
| 49 | + <template v-else> |
| 50 | + <component v-for="pattern in content.patterns" :key="pattern.name" :is="pattern.examples" :assets-path="assetsPath"/> |
| 51 | + </template> |
| 52 | + </main> |
| 53 | + |
| 54 | + <aside> |
| 55 | + <SidebarLinks :content="content"/> |
| 56 | + </aside> |
| 57 | + </div> |
| 58 | + |
| 59 | + </div> |
| 60 | + |
| 61 | + <footer class="site-foot"> |
| 62 | + <div class="content-wrapper"> |
| 63 | + <div class="sidebar" data-direction="rtl"> |
| 64 | + <div class="site-foot__content"> |
| 65 | + <figure class="site-foot__brand"> |
| 66 | + <a href="https://www.wikimedia.de/"> |
| 67 | + <img :src="assetsPath + '/images/logo-vertical-wikimedia.svg'" alt="Wikimedia Deutschland"> |
| 68 | + </a> |
| 69 | + </figure> |
| 70 | + <div class="site-foot__copy flow"> |
| 71 | + <p>Wikimedia Deutschland e. V. is an independent non-profit association that collects donations for Wikipedia and other Wikimedia projects in Germany.</p> |
| 72 | + <p>As the organisation behind Wikipedia, we support the volunteers, secure and develop the technical infrastructure, and advocate for free access to knowledge and education worldwide.</p> |
| 73 | + </div> |
| 74 | + </div> |
| 75 | + <nav class="footer-nav"> |
| 76 | + <ul class="footer-nav__list"> |
| 77 | + <li><a href="#" aria-current="page">Contact</a></li> |
| 78 | + <li><a href="#">Legal Notice</a></li> |
| 79 | + <li><a href="#">Privacy</a></li> |
| 80 | + <li><a href="#">Hall of Fame</a></li> |
| 81 | + <li><a href="#">Donation Comments</a></li> |
| 82 | + </ul> |
| 83 | + </nav> |
| 84 | + </div> |
| 85 | + </div> |
| 86 | + </footer> |
| 87 | + </div> |
| 88 | +</template> |
| 89 | + |
| 90 | +<script setup lang="ts"> |
| 91 | +
|
| 92 | +import { computed, ref, watch } from 'vue'; |
| 93 | +import ChevronDown from '@src/components/shared/icons/ChevronDown.vue'; |
| 94 | +import Logo from '@src/components/layout/Logo.vue'; |
| 95 | +import Burger from '@src/pattern_library/components/icons/Burger.vue'; |
| 96 | +import Close from '@src/pattern_library/components/icons/Close.vue'; |
| 97 | +import LocaleIcon from '@src/components/shared/icons/LocaleIcon.vue'; |
| 98 | +import SidebarLinks from '@src/pattern_library/components/SidebarLinks.vue'; |
| 99 | +import { Content } from '@src/pattern_library/content'; |
| 100 | +import { Pattern } from '@src/pattern_library/patterns/Pattern'; |
| 101 | +import PatternDetail from '@src/pattern_library/components/PatternDetail.vue'; |
| 102 | +import { Page } from '@src/pattern_library/pages/Page'; |
| 103 | +import PageDetail from '@src/pattern_library/components/PageDetail.vue'; |
| 104 | +
|
| 105 | +interface Props { |
| 106 | + patternID: string; |
| 107 | + content: Content; |
| 108 | + assetsPath: string; |
| 109 | +} |
| 110 | +const props = defineProps<Props>(); |
| 111 | +
|
| 112 | +const menuActive = ref<boolean>( false ); |
| 113 | +const localeActive = ref<boolean>( false ); |
| 114 | +const page = computed<Page | undefined>( () => props.content.pages.find( x => x.url === props.patternID ) ); |
| 115 | +const pattern = computed<Pattern | undefined>( () => props.content.patterns.find( x => x.url === props.patternID ) ); |
| 116 | +
|
| 117 | +const dialog = ref<HTMLDialogElement>( null ); |
| 118 | +const modalIsVisible = ref<boolean>( false ); |
| 119 | +watch( modalIsVisible, ( visible: boolean ) => { |
| 120 | + if ( visible ) { |
| 121 | + dialog.value.showModal(); |
| 122 | + } else { |
| 123 | + dialog.value.close(); |
| 124 | + } |
| 125 | +} ); |
| 126 | +
|
| 127 | +</script> |
0 commit comments