|
| 1 | +<template> |
| 2 | + <div> |
| 3 | + <div class="team"> |
| 4 | + <h2 id="active-core-team-members"> |
| 5 | + Active Core Team Members |
| 6 | + <GetPositionButton |
| 7 | + v-if="!userPosition" |
| 8 | + @positionRetrieved="setUserPosition" |
| 9 | + @positionErrored="setUserPositionError" |
| 10 | + /> |
| 11 | + </h2> |
| 12 | + |
| 13 | + <div v-if="errorGettingLocation" class="danger custom-block"> |
| 14 | + <p>Failed to get your location.</p> |
| 15 | + </div> |
| 16 | + |
| 17 | + <p> |
| 18 | + The development of Vue and its ecosystem is guided by an international team, some of whom have chosen to be featured below. |
| 19 | + </p> |
| 20 | + |
| 21 | + <div v-if="userPosition" class="tip custom-block"> |
| 22 | + <p>The core team have been sorted by their distance from you.</p> |
| 23 | + </div> |
| 24 | + |
| 25 | + <VuerProfile v-for="profile in members" :key="profile.name" :profile="profile" :use-miles="useMiles"/> |
| 26 | + </div> |
| 27 | + |
| 28 | + <div class="team"> |
| 29 | + <h2 id="core-team-emeriti"> |
| 30 | + Core Team Emeriti |
| 31 | + </h2> |
| 32 | + |
| 33 | + <p> |
| 34 | + Here we honor some no-longer-active core team members who have made valuable contributions in the past. |
| 35 | + </p> |
| 36 | + |
| 37 | + <VuerProfile v-for="profile in emeriti" :key="profile.name" :profile="profile" :use-miles="useMiles"/> |
| 38 | + </div> |
| 39 | + |
| 40 | + <div class="team"> |
| 41 | + <h2 id="community-partners"> |
| 42 | + Community Partners |
| 43 | + <GetPositionButton |
| 44 | + v-if="!userPosition" |
| 45 | + @positionRetrieved="setUserPosition" |
| 46 | + @positionErrored="setUserPositionError" |
| 47 | + /> |
| 48 | + </h2> |
| 49 | + |
| 50 | + <div v-if="errorGettingLocation" class="danger custom-block"> |
| 51 | + <p>Failed to get your location.</p> |
| 52 | + </div> |
| 53 | + |
| 54 | + <p> |
| 55 | + Some members of the Vue community have so enriched it, that they deserve special mention. We've developed a more intimate relationship with these key partners, often coordinating with them on upcoming features and news. |
| 56 | + </p> |
| 57 | + |
| 58 | + <div v-if="userPosition" class="tip custom-block"> |
| 59 | + <p>The community partners have been sorted by their distance from you.</p> |
| 60 | + </div> |
| 61 | + |
| 62 | + <VuerProfile v-for="profile in partners" :key="profile.name" :profile="profile" :use-miles="useMiles"/> |
| 63 | + </div> |
| 64 | + </div> |
| 65 | +</template> |
| 66 | + |
| 67 | +<script> |
| 68 | +import { getDistanceFromLatLonInKm } from './utils' |
| 69 | +import members from './members' |
| 70 | +import emeriti from './emeriti' |
| 71 | +import partners from './partners' |
| 72 | +
|
| 73 | +const imperialLanguageCodes = ['en-US', 'en-MY', 'en-MM', 'en-BU', 'en-LR', 'my', 'bu'] |
| 74 | +
|
| 75 | +const cityCoordsFor = { |
| 76 | + 'Annecy, France': [45.899247, 6.129384], |
| 77 | + 'Alicante, Spain' : [38.346543, -0.483838], |
| 78 | + 'Amsterdam, Netherlands': [4.895168, 52.370216], |
| 79 | + 'Atlanta, GA, USA': [33.749051, -84.387858], |
| 80 | + 'Bangalore, India': [12.971599, 77.594563], |
| 81 | + 'Beijing, China': [39.904200, 116.407396], |
| 82 | + 'Bordeaux, France': [44.837789, -0.579180], |
| 83 | + 'Bucharest, Romania': [44.426767, 26.102538], |
| 84 | + 'Chengdu, China': [30.572815, 104.066801], |
| 85 | + 'Chongqing, China': [29.431586, 106.912251], |
| 86 | + 'Denver, CO, USA': [39.739236, -104.990251], |
| 87 | + 'Dublin, Ireland': [53.349918, -6.260174], |
| 88 | + 'Dubna, Russia': [56.732020, 37.166897], |
| 89 | + 'East Lansing, MI, USA': [42.736979, -84.483865], |
| 90 | + 'Fort Worth, TX, USA': [32.755331, -97.325735], |
| 91 | + 'Hangzhou, China': [30.274084, 120.155070], |
| 92 | + 'Jersey City, NJ, USA': [40.728157, -74.558716], |
| 93 | + 'Kingston, Jamaica': [18.017874, -76.809904], |
| 94 | + 'Krasnodar, Russia': [45.039267, 38.987221], |
| 95 | + 'Lansing, MI, USA': [42.732535, -84.555535], |
| 96 | + 'London, UK': [51.507351, -0.127758], |
| 97 | + 'Lyon, France': [45.764043, 4.835659], |
| 98 | + 'Mannheim, Germany': [49.487459, 8.466039], |
| 99 | + 'Moscow, Russia': [55.755826, 37.617300], |
| 100 | + 'Munich, Germany': [48.137154, 11.576124], |
| 101 | + 'Orlando, FL, USA': [28.538335, -81.379236], |
| 102 | + 'Paris, France': [48.856614, 2.352222], |
| 103 | + 'Poznań, Poland': [52.4006553, 16.761583], |
| 104 | + 'Seoul, South Korea': [37.566535, 126.977969], |
| 105 | + 'Shanghai, China': [31.230390, 121.473702], |
| 106 | + 'Singapore': [1.352083, 103.819839], |
| 107 | + 'Sydney, Australia': [-33.868820, 151.209290], |
| 108 | + 'Taquaritinga, Brazil': [-21.430094, -48.515285], |
| 109 | + 'Tehran, Iran': [35.689197, 51.388974], |
| 110 | + 'Thessaloniki, Greece': [40.640063, 22.944419], |
| 111 | + 'Tokyo, Japan': [35.689487, 139.691706], |
| 112 | + 'Toronto, Canada': [43.653226, -79.383184], |
| 113 | + 'Wrocław, Poland': [51.107885, 17.038538], |
| 114 | + 'Boston, MA, USA': [42.360081, -71.058884], |
| 115 | + 'Kyiv, Ukraine': [50.450100, 30.523399], |
| 116 | + 'Washington, DC, USA': [38.8935755,-77.0846156,12], |
| 117 | + 'Kraków, Poland': [50.064650, 19.936579], |
| 118 | + 'Oslo, Norway': [59.911491, 10.757933], |
| 119 | + 'Kanagawa, Japan': [35.44778, 139.6425] |
| 120 | +} |
| 121 | +
|
| 122 | +export default { |
| 123 | + components: { |
| 124 | + VuerProfile: () => import('./vuer-profile'), |
| 125 | + GetPositionButton: () => import('./get-position-button') |
| 126 | + }, |
| 127 | +
|
| 128 | + data: () => ({ |
| 129 | + emeriti, |
| 130 | + geolocationSupported: false, |
| 131 | + errorGettingLocation: false, |
| 132 | + userPosition: null, |
| 133 | + useMiles: false |
| 134 | + }), |
| 135 | +
|
| 136 | + computed: { |
| 137 | + members () { |
| 138 | + return this.sortByDistance(members) |
| 139 | + }, |
| 140 | +
|
| 141 | + partners () { |
| 142 | + return this.sortByDistance(partners) |
| 143 | + } |
| 144 | + }, |
| 145 | +
|
| 146 | + methods: { |
| 147 | + setUserPosition (position) { |
| 148 | + this.userPosition = position |
| 149 | + this.errorGettingLocation = false |
| 150 | + }, |
| 151 | +
|
| 152 | + setUserPositionError () { |
| 153 | + this.userPosition = null |
| 154 | + this.errorGettingLocation = true |
| 155 | + }, |
| 156 | +
|
| 157 | + sortByDistance (vuers) { |
| 158 | + if (!this.userPosition) { |
| 159 | + return vuers |
| 160 | + } |
| 161 | +
|
| 162 | + const vuersWithDistances = vuers.map(vuer => { |
| 163 | + const cityCoords = cityCoordsFor[vuer.city] |
| 164 | +
|
| 165 | + if (cityCoords) { |
| 166 | + return Object.assign({}, vuer, { |
| 167 | + distanceInKm: getDistanceFromLatLonInKm( |
| 168 | + this.userPosition.coords.latitude, |
| 169 | + this.userPosition.coords.longitude, |
| 170 | + cityCoords[0], |
| 171 | + cityCoords[1] |
| 172 | + ) |
| 173 | + }) |
| 174 | + } |
| 175 | +
|
| 176 | + return Object.assign({}, vuer, { |
| 177 | + distanceInKm: null |
| 178 | + }) |
| 179 | + }) |
| 180 | +
|
| 181 | + vuersWithDistances.sort((a, b) => { |
| 182 | + if (a.distanceInKm && b.distanceInKm) return a.distanceInKm - b.distanceInKm |
| 183 | + if (a.distanceInKm && !b.distanceInKm) return -1 |
| 184 | + if (!a.distanceInKm && b.distanceInKm) return 1 |
| 185 | + if (a.name < b.name) return -1 |
| 186 | + if (a.name > b.name) return 1 |
| 187 | + }) |
| 188 | +
|
| 189 | + return vuersWithDistances |
| 190 | + } |
| 191 | + }, |
| 192 | +
|
| 193 | + mounted () { |
| 194 | + this.useMiles = imperialLanguageCodes.includes(window.navigator.language) |
| 195 | + } |
| 196 | +} |
| 197 | +</script> |
| 198 | + |
| 199 | +<style lang="scss" scoped> |
| 200 | +.vuer+.vuer { |
| 201 | + border-top: 1px dotted #ddd; |
| 202 | +} |
| 203 | +
|
| 204 | +.get-position-button { |
| 205 | + float: right; |
| 206 | + margin-top: .3em; |
| 207 | +} |
| 208 | +</style> |
0 commit comments