From 0043364500ffd620d79d61bc7715923039892c72 Mon Sep 17 00:00:00 2001 From: SeanHsieh Date: Sat, 15 Jul 2023 16:57:04 +0800 Subject: [PATCH 1/7] feat: ui venue change --- .nvmrc | 1 + components/venue/VenueDivision.vue | 66 ++++++ components/venue/VenueDriveTab.vue | 101 +++------ .../venue/VenuePublicTransporterTab.vue | 208 ++++++++++++------ i18n/venue/index.i18n.js | 55 ++++- static/img/venue/bus-white.svg | 3 + 6 files changed, 279 insertions(+), 155 deletions(-) create mode 100644 .nvmrc create mode 100644 components/venue/VenueDivision.vue create mode 100644 static/img/venue/bus-white.svg diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000000..21cff1fb03 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +14.18.1 \ No newline at end of file diff --git a/components/venue/VenueDivision.vue b/components/venue/VenueDivision.vue new file mode 100644 index 0000000000..ce7d84d7e7 --- /dev/null +++ b/components/venue/VenueDivision.vue @@ -0,0 +1,66 @@ + + + + + diff --git a/components/venue/VenueDriveTab.vue b/components/venue/VenueDriveTab.vue index 76033a4cf9..9ccfe32b0a 100644 --- a/components/venue/VenueDriveTab.vue +++ b/components/venue/VenueDriveTab.vue @@ -12,7 +12,7 @@
-
+
{{ $t('carInstructions.destination') }} -
    -
  1. - {{ carInstruction }} -
  2. -
@@ -46,15 +38,12 @@ {{ $t('carInstructions.footerTitle') }}
- -
-
-

- - {{ $t('parkingInfo.title') }} -

-
-
+ +

+ + {{ $t('parkingInfo.title') }} +

+
@@ -63,7 +52,15 @@ {{ $t('parkingInfo.car.title') }}
-

{{ $t('parkingInfo.car.description') }}

+ + + {{ $t('parkingInfo.car.parkingPlace') }} + +
@@ -108,10 +111,11 @@ - + diff --git a/components/venue/VenuePublicTransporterTab.vue b/components/venue/VenuePublicTransporterTab.vue index 5fc9c34281..9c85c7ea4d 100644 --- a/components/venue/VenuePublicTransporterTab.vue +++ b/components/venue/VenuePublicTransporterTab.vue @@ -5,8 +5,10 @@ -
-
+
+
@@ -17,7 +19,18 @@ {{ $t('publicTransport.taxi.description') }}

-
+
+
+ +
+ {{ $t('publicTransport.bus.title') }} +
+
+

+ {{ $t('publicTransport.bus.description') }} +

+
+
@@ -37,37 +50,90 @@
+
+
+ {{ $t('publicTransport.uBikePark.title') }} +
+ +
-
-
-

- - {{ $t('publicTransport.title') }} -

+ +

+ + {{ $t('publicTransport.title') }} +

+
+ +
+
+ +
+ {{ $t('publicTransportInfo.title') }} +
-
-
-
-
- -
- {{ $t('publicTransportInfo.title') }} -
+
+ -

- {{ $t('publicTransportInfo.info') }} -

- - {{ $t('publicTransportInfo.1843infoTitle') }} - -
@@ -84,14 +167,44 @@ @@ -22,12 +19,14 @@ export default { align-items: center; white-space: nowrap; color: #9387ff; - & >>> h3 { + + &>>>h3 { padding: 0 14px; position: relative; display: flex; align-items: center; justify-content: center; + &::before { position: absolute; content: ''; @@ -37,6 +36,7 @@ export default { display: inline-block; border-radius: 50%; } + &::after { position: absolute; content: ''; @@ -46,8 +46,10 @@ export default { display: inline-block; border-radius: 50%; } + margin: 0; } + &::before { max-width: 336px; content: ''; @@ -55,6 +57,7 @@ export default { border-top: 1px solid #9387ff; display: inline-block; } + &::after { max-width: 336px; width: 100%; @@ -62,5 +65,4 @@ export default { border-top: 1px solid #9387ff; display: inline-block; } -} - +} From 268e12b14e4612ad7cdd9ea38a148afa2b17c468 Mon Sep 17 00:00:00 2001 From: SeanHsieh Date: Sat, 22 Jul 2023 15:55:06 +0800 Subject: [PATCH 3/7] fix: memory leak on event listener --- pages/about/community.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pages/about/community.vue b/pages/about/community.vue index 892a2a148c..765910aaa9 100644 --- a/pages/about/community.vue +++ b/pages/about/community.vue @@ -128,6 +128,9 @@ export default { mounted() { this.$refs.communities.addEventListener('scroll', this.handleScroll) }, + beforeDestroy() { + this.$refs.communities.removeEventListener('scroll', this.handleScroll) + }, methods: { handleScroll() { const scrollTop = this.$refs.communities.scrollTop From a3f597d5b3ce0601015652e84a93f5e3d3939e0f Mon Sep 17 00:00:00 2001 From: SeanHsieh Date: Sat, 22 Jul 2023 15:55:43 +0800 Subject: [PATCH 4/7] feat: update en i18n and ui on venue --- components/venue/VenueDivision.vue | 5 +- components/venue/VenueDriveTab.vue | 30 +++++++-- .../venue/VenuePublicTransporterTab.vue | 42 +++++++++++-- i18n/venue/index.i18n.js | 61 +++++++++++++++---- .../venue/en-us/publicTransporterGuide-md.svg | 9 +++ .../venue/en-us/publicTransporterGuide.svg | 9 +++ .../img/venue/en-us/venue-destination-md.svg | 6 ++ static/img/venue/en-us/venue-destination.svg | 6 ++ 8 files changed, 145 insertions(+), 23 deletions(-) create mode 100644 static/img/venue/en-us/publicTransporterGuide-md.svg create mode 100644 static/img/venue/en-us/publicTransporterGuide.svg create mode 100644 static/img/venue/en-us/venue-destination-md.svg create mode 100644 static/img/venue/en-us/venue-destination.svg diff --git a/components/venue/VenueDivision.vue b/components/venue/VenueDivision.vue index 74640ea950..ffcc9ff0b7 100644 --- a/components/venue/VenueDivision.vue +++ b/components/venue/VenueDivision.vue @@ -20,7 +20,7 @@ export default { white-space: nowrap; color: #9387ff; - &>>>h3 { + & >>> h3 { padding: 0 14px; position: relative; display: flex; @@ -65,4 +65,5 @@ export default { border-top: 1px solid #9387ff; display: inline-block; } -} +} + diff --git a/components/venue/VenueDriveTab.vue b/components/venue/VenueDriveTab.vue index 9ccfe32b0a..eef9a81c78 100644 --- a/components/venue/VenueDriveTab.vue +++ b/components/venue/VenueDriveTab.vue @@ -118,7 +118,25 @@ export default { components: { VenueDivision }, data() { return { - icon: { + parkingInfo: { + car: '人社館地下室設有汽車停車場,車輛進入院區持證件向大門警衛換證後可駛入院區,停車費用每小時20元。', + }, + } + }, + computed: { + icon() { + if (this.$i18n.locale === 'en-us') { + return { + car: require('~/static/img/venue/car.svg'), + carWhite: require('~/static/img/venue/car-white.svg'), + motorWhite: require('~/static/img/venue/motor-white.svg'), + parking: require('~/static/img/venue/parking.svg'), + parkingPink: require('~/static/img/venue/parking-pink.svg'), + venueDestination: require('~/static/img/venue/en-us/venue-destination.svg'), + venueDestinationMd: require('~/static/img/venue/en-us/venue-destination-md.svg'), + } + } + return { car: require('~/static/img/venue/car.svg'), carWhite: require('~/static/img/venue/car-white.svg'), motorWhite: require('~/static/img/venue/motor-white.svg'), @@ -126,11 +144,11 @@ export default { parkingPink: require('~/static/img/venue/parking-pink.svg'), venueDestination: require('~/static/img/venue/venue-destination.svg'), venueDestinationMd: require('~/static/img/venue/venue-destination-md.svg'), - }, - parkingInfo: { - car: '人社館地下室設有汽車停車場,車輛進入院區持證件向大門警衛換證後可駛入院區,停車費用每小時20元。', - }, - } + } + }, + }, + mounted() { + console.log(this.$i18n.locale) }, } diff --git a/components/venue/VenuePublicTransporterTab.vue b/components/venue/VenuePublicTransporterTab.vue index 9c85c7ea4d..13d9a9d9a8 100644 --- a/components/venue/VenuePublicTransporterTab.vue +++ b/components/venue/VenuePublicTransporterTab.vue @@ -136,7 +136,23 @@
  • - {{ $t('publicTransportInfo.description3') }} + {{ $t('publicTransportInfo.description3.title') }} +
      +
    • + {{ + $t( + 'publicTransportInfo.description3.info1', + ) + }} +
    • +
    • + {{ + $t( + 'publicTransportInfo.description3.info2', + ) + }} +
    • +
  • {{ $t('publicTransportInfo.description4') }} @@ -202,7 +218,25 @@ export default { i18nLinkPath: 'publicTransport.uBikePark.parkPlace.park5', }, ], - icon: { + } + }, + + computed: { + icon() { + if (this.$i18n.locale === 'en-us') { + return { + carWhite: require('~/static/img/venue/car-white.svg'), + busWhite: require('~/static/img/venue/bus-white.svg'), + publicTransporterGuide: require('~/static/img/venue/en-us/publicTransporterGuide.svg'), + publicTransporterGuideMd: require('~/static/img/venue/en-us/publicTransporterGuide-md.svg'), + taxiWhite: require('~/static/img/venue/taxi-white.svg'), + transporterWhite: require('~/static/img/venue/transporter-white.svg'), + uBike: require('~/static/img/venue/uBike.svg'), + parking: require('~/static/img/venue/parking.svg'), + airplane: require('~/static/img/venue/airplane.svg'), + } + } + return { carWhite: require('~/static/img/venue/car-white.svg'), busWhite: require('~/static/img/venue/bus-white.svg'), publicTransporterGuide: require('~/static/img/venue/publicTransporterGuide.svg'), @@ -212,8 +246,8 @@ export default { uBike: require('~/static/img/venue/uBike.svg'), parking: require('~/static/img/venue/parking.svg'), airplane: require('~/static/img/venue/airplane.svg'), - }, - } + } + }, }, } diff --git a/i18n/venue/index.i18n.js b/i18n/venue/index.i18n.js index de4db29be4..ac3832a198 100644 --- a/i18n/venue/index.i18n.js +++ b/i18n/venue/index.i18n.js @@ -36,8 +36,9 @@ export default genI18nMessages({ title: 'Parking Info', car: { title: 'Car', + parkingPlace: 'Humanities and Social Science Building (HSSB)', description: - 'The underground parking lot (B2) in the Humanities and Social Science Building is available for cars. ' + + 'The underground parking lot (B2) in the {0} is available for cars. ' + 'Upon entering the campus, drivers should present their identification to the main gate security guard' + ' and obtain a parking permit. The parking fee is NT$20 per hour.', }, @@ -63,6 +64,11 @@ export default genI18nMessages({ ' Based on past experience, many people choose this option,' + ' so sharing a taxi from the MRT station is a good idea.', }, + bus: { + title: 'Passenger bus', + description: + "To reach Academia Sinica, you can take buses 205, 212, 212 直 (212 Express), 270, 270 區 (270 Shuttle), 276, 306, 306 區 (306 Shuttle), 620, 645, 645 副 (645 Sub), S1, S12, 小 12 區 (S12 Shuttle), S5, or 藍 25 (Blue 25), and get off at Academia Sinica Station. From there, it's approximately an 8-minute walk to your destination.", + }, uBike: { link: { description1: 'official YouBike website', @@ -74,25 +80,54 @@ export default genI18nMessages({ 'It is recommended to check the available docking stations on the app to return the bike. {2}' + 'Cycling time from Nangang Station or Nangang Exhibition Center Station to Academia Sinica is approximately 10-15 minutes', }, + uBikePark: { + parkPlace: { + park1: 'YouBike 2.0: Humanities and Social Science Building', + park2: 'YouBike 2.0: Academia Sinica Gymnasium (East)', + park3: 'YouBike 2.0: Academia Sinica (Jiuzhuang St. Intersection)', + park4: 'YouBike 2.0: Academia Park', + park5: 'YouBike 2.0: Dr. Hu Shih Par', + }, + parkingInfo: { + park1: '{0}', + park2: '{0}', + park3: '{0} — Approximately a 10-minute walk', + park4: '{0} — Approximately a 12-minute walk', + park5: '{0} — Approximately a 13-minute walk', + }, + title: 'Youbike 附近租賃站點', + }, }, publicTransportInfo: { - title: 'Way of Transportation', + title: 'Public transportation', info: - 'You can take the Kuo-Kuang Bus 1843 to travel between Nangang Exhibition' + + 'You can take the {0} to travel between Nangang Exhibition' + ' Center and Terminal 1 and Terminal 2 of Taoyuan International Airport.', - '1843infoTitle': 'Kuo-Kuang Bus 1843 Route Information:', + '1843infoTitle': '{0} Route Information:', + publicTransport: 'Kuo-Kuang Bus 1843', + description1: 'Route: Taiwan Taoyuan Airport Terminal 1 ->' + ' Taiwan Taoyuan Airport Terminal 2 -> MRT Gangqian Station' + ' -> Ruiguang Road -> Neihu Administrative Center ->' + ' MRT Nangang Exhibition Center Station (Nangang Rd.) -> Nangang Bus Station (West)', - description2: - 'Bus platform location: Terminal I: B1 bus area of' + - ' Arrivals Hall Terminal II: Outdoor gallery at East side of 1F Arrivals Hall', - description3: - 'Fare (for reference only):Full Fare: NT$140,Half Fare: NT$75', - description4: 'Schedule: 09:10, 13:10, and 17:20', + description2: { + title: 'Bus platform location:', + info1: 'Terminal I: B1 bus area of Arrivals Hall', + info2: 'Terminal II: Outdoor gallery at East side of 1F Arrivals Hall', + }, + description3: { + title: 'Fare (for reference only):', + info1: 'Fare: NT$140', + info2: 'Fare: NT$75', + }, + description4: 'Schedule: 09:10, 13:10, and 17:20, From Terminal II', description5: 'Estimated time: 1 hour with moderate traffic', + moreInfo: { + title: 'For more information, please refer to {0} and {1} 。', + info1: 'the traffic information of Academia Sinica', + info2: 'the public transportation information of Taoyuan international Airport', + }, }, }, 'zh-hant': { @@ -197,7 +232,11 @@ export default genI18nMessages({ info1: '第一航廈:B1 層巴士乘車區。', info2: '第二航廈:1F 層巴士乘車區。', }, - description3: '票價(票價僅供參考):全票 NT$140,半票 NT$75', + description3: { + title: '票價(票價僅供參考):', + info1: '全票 NT$140', + info2: '半票 NT$75', + }, description4: '時間:09:10、13:10、17:20,從第二航廈發車', description5: '路程時間:一般交通狀況下一小時', moreInfo: { diff --git a/static/img/venue/en-us/publicTransporterGuide-md.svg b/static/img/venue/en-us/publicTransporterGuide-md.svg new file mode 100644 index 0000000000..ddfeb18013 --- /dev/null +++ b/static/img/venue/en-us/publicTransporterGuide-md.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/static/img/venue/en-us/publicTransporterGuide.svg b/static/img/venue/en-us/publicTransporterGuide.svg new file mode 100644 index 0000000000..79673da2d6 --- /dev/null +++ b/static/img/venue/en-us/publicTransporterGuide.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/static/img/venue/en-us/venue-destination-md.svg b/static/img/venue/en-us/venue-destination-md.svg new file mode 100644 index 0000000000..ecf2275716 --- /dev/null +++ b/static/img/venue/en-us/venue-destination-md.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/static/img/venue/en-us/venue-destination.svg b/static/img/venue/en-us/venue-destination.svg new file mode 100644 index 0000000000..29664864ab --- /dev/null +++ b/static/img/venue/en-us/venue-destination.svg @@ -0,0 +1,6 @@ + + + + + + From 14db116cf2d84a79ebb294a5ad81a05e3eaf34fb Mon Sep 17 00:00:00 2001 From: SeanHsieh Date: Tue, 25 Jul 2023 16:55:36 +0800 Subject: [PATCH 5/7] update comments --- components/venue/VenueDivision.vue | 10 ++--- components/venue/VenueDriveTab.vue | 33 ++++++++------ .../venue/VenuePublicTransporterTab.vue | 44 ++++++++++++++----- i18n/venue/index.i18n.js | 10 ++--- 4 files changed, 60 insertions(+), 37 deletions(-) diff --git a/components/venue/VenueDivision.vue b/components/venue/VenueDivision.vue index ffcc9ff0b7..dd176f1ca5 100644 --- a/components/venue/VenueDivision.vue +++ b/components/venue/VenueDivision.vue @@ -1,5 +1,7 @@