forked from codeforjapan/mapprint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_map.vue
123 lines (121 loc) · 4.26 KB
/
_map.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<template lang="pug">
div.layout-map
div.layout-map-inner.grid-noGutter
aside.print-exclude.col-12_md-3_xl-6
.aside-inner
.aside-grid
.aside-item1
h2.aside-title-sp
img(src="~/assets/images/sp_logo.png" width="607" height="452" alt="地図情報を印刷できる「紙マップ」")
h2.aside-title-pc
img(src="~/assets/images/logo.png" width="895" height="160" alt="地図情報を印刷できる「紙マップ」")
.aside-item2
p
| {{$t('map.desc_1')}}
.aside-item3
div.aside-item-illust1
img(src="~/assets/images/illust_1.png" width="360" height="450" alt="")
.aside-item4
p
| {{$t('map.desc_2')}}
br
| {{$t('map.desc_3')}}
.aside-item5
p
| {{$t('map.desc_4')}}
br
| {{$t('map.desc_5')}}
.aside-item6
div.aside-item-illust2
img(src="~/assets/images/illust_2.png" width="640" height="435" alt="")
.aside-item7
p
| {{$t('map.desc_6')}}
br
| {{$t('map.desc_7')}}
main.main.col-12_md-9_xl-6
.main-sheet
header.header
.to-top
nuxt-link(to='/')
i.far.fa-arrow-alt-circle-left.fa-2x
.banner
.logo.print-exclude
img(src="~/assets/images/logo.png" width="895" height="160" alt="地図情報を印刷できる「紙マップ」")
.sub-outer.print-exclude
.sub-button(@click='isOpenExplain=!isOpenExplain')
i.fas.fa-info-circle.fa-lg
span
| {{$t('common.about')}}
.sub-button.github-link
i.fab.fa-github.fa-lg
a(href="https://github.com/codeforjapan/mapprint") {{ $t('common.contribute') }}
.sub-button(v-for="locale in $i18n.locales")
nuxt-link(
:key="locale.code"
:to="switchLocalePath(locale.code)"
)
span {{ locale.name }}
.title-outer
h1.title(v-if="map_config && $i18n.locale === 'ja'")
| {{map_config.map_title}}
h1.title(v-else)
| {{map_config.map_title_en}}
.datetime
| {{$t('map.printed_at')}} {{updated_at}}
.qrcode
vue-qrcode(v-bind:value='fullURL' tag="img")
printable-map(:map_config='map_config', v-if="map_config", @bounds-changed="updateQRCode")
footer.footer
.footer-logo
img(src="~/assets/images/logo.png" width="895" height="160" alt="地図情報を印刷できる「紙マップ」")
modal(v-bind:isOpen='isOpenExplain' v-on:closeModal="closeModalMethod")
</template>
<script>
import VueQrcode from '@chenfengyuan/vue-qrcode'
import PrintableMap from '~/components/PrintableMap'
import { getNowYMD } from '~/lib/displayHelper.ts'
import Modal from '~/components/Modal'
if (process.client) {
require('viewport-units-buggyfill').init()
}
export default {
components: {
PrintableMap, VueQrcode, Modal
},
asyncData ({ app }) {
const updated_at = getNowYMD(new Date(), app.i18n.locale)
return { updated_at }
},
data () {
return {
map_config: require('~/assets/config/' + (this.$nuxt.$route.params.map)),
isOpenExplain: false,
fullURL: null,
updated_at: null
}
},
head () {
return {
title: this.map_config.map_title,
meta: [
{ hid: 'description', name: 'description', content: this.map_config.map_description },
{ hid: 'og:image', property: 'og:image', content: 'https://kamimap.com/images/' + (this.map_config.map_image ? this.map_config.map_image : 'logo.png') },
{ hid: 'og:description', name: 'og:description', content: this.map_config.map_description },
{ hid: 'og:title', name: 'og:title', content: this.map_config.map_title + ' - 紙マップ' }
]
}
},
mounted () {
this.fullURL = location.href
},
methods: {
updateQRCode () {
this.fullURL = location.href
},
closeModalMethod () {
this.isOpenExplain = false
}
}
}
</script>