|
| 1 | +<template> |
| 2 | + <footer :class="`bg-navy white pt5-m pt5-l pt4 pb2 ${noTopMargin ? '':'footer-margin'}`" |
| 3 | + data-cy="footer-component" |
| 4 | + > |
| 5 | + <div class="flex mw7 ph3 center flex-wrap"> <!-- logo & columns --> |
| 6 | + <div class="w-33-l w-100 mb0-l mb3"> |
| 7 | + <router-link to="/" class="flex items-center link"> |
| 8 | + <ProtoSchoolLogo alt="ProtoSchool" class="w2 mr2 "/> |
| 9 | + <div class="ma0 fw4 white f3"> |
| 10 | + <span class="montserrat fw4">Proto</span> |
| 11 | + <span class="montserrat fw2">School</span> |
| 12 | + </div> |
| 13 | + </router-link> |
| 14 | + </div> |
| 15 | + <div v-for="column in processedColumns" :key="column.title" class="w-20-l w-25-m w-33 column "> |
| 16 | + <span class="fw7">{{column.title}}</span> |
| 17 | + <ul class="list pl0"> |
| 18 | + <li v-for="(link, index) in column.links" :key="index" class="pv1"> |
| 19 | + <a class="link underline-hover white o-80 glow" |
| 20 | + :target="link.external ? '_blank' : ''" |
| 21 | + :data-cy="link.external ? 'footer-link-external' : 'footer-link-internal'" |
| 22 | + :href="link.url">{{link.text}} |
| 23 | + </a> |
| 24 | + </li> |
| 25 | + </ul> |
| 26 | + </div> |
| 27 | + </div> |
| 28 | + <div class="flex justify-start mt4 mw7 center ph3 f7 o-70"> <!-- fake element plus copyright --> |
| 29 | + <div class="w-33-l"> |
| 30 | + </div> |
| 31 | + <p>© <a class="link underline white o-80 glow" target="_blank" href="https://protocol.ai">Protocol Labs</a> | {{translations.copyright._1}} <a class="link underline white o-80 glow" target="_blank" href="https://protocol.ai/legal/">{{translations.copyright._2}}</a>{{translations.copyright._3}} <a class="link underline white o-80 glow" target="_blank" :href="translations.copyright.licenseURL" >CC-BY 3.0</a>{{translations.copyright._4}}</p> |
| 32 | + </div> |
| 33 | + </footer> |
| 34 | +</template> |
| 35 | + |
| 36 | +<script> |
| 37 | +import ProtoSchoolLogo from '../../static/images/ps_symbol_color.svg?inline' |
| 38 | +import translations from '../../static/translations' |
| 39 | +import projects from '../../static/projects.json' |
| 40 | +
|
| 41 | +export default { |
| 42 | + name: 'Footer', |
| 43 | + components: { |
| 44 | + ProtoSchoolLogo |
| 45 | + }, |
| 46 | + props: { |
| 47 | + noTopMargin: Boolean |
| 48 | + }, |
| 49 | + computed: { |
| 50 | + translations: function () { |
| 51 | + return translations.footer |
| 52 | + }, |
| 53 | + processedColumns: function () { |
| 54 | + return translations.footer.columns.map(column => ({ |
| 55 | + ...column, |
| 56 | + links: column.links.map(link => { |
| 57 | + let text = link.text // text or undefined |
| 58 | + let url = link.url // url or underfined |
| 59 | +
|
| 60 | + // Fill in course and project link data automatically |
| 61 | + if (column.type === 'courses' || column.type === 'projects') { |
| 62 | + let project = projects.find(project => project.id === link) |
| 63 | +
|
| 64 | + text = project.name |
| 65 | + url = (column.type === 'courses') ? `/course/${link}` : project.url |
| 66 | + } |
| 67 | +
|
| 68 | + return { text, url, external: !url.startsWith('/') } |
| 69 | + }) |
| 70 | + })) |
| 71 | + } |
| 72 | + } |
| 73 | +} |
| 74 | +</script> |
| 75 | +<style scoped> |
| 76 | +.column { |
| 77 | + margin-top: 0.7rem; |
| 78 | +} |
| 79 | +.footer-margin { |
| 80 | + margin-top: 6rem; |
| 81 | +} |
| 82 | +
|
| 83 | +@media (max-width: 30rem) { |
| 84 | + .footer-margin { |
| 85 | + margin-top: 3rem; |
| 86 | + } |
| 87 | +} |
| 88 | +</style> |
0 commit comments