@@ -15,6 +15,7 @@ order: 31
15
15
< div class = " profile" >
16
16
< h3 : data- official- title= " profile.title" >
17
17
{{ profile .name }}
18
+ < sup v- if = " profile.title && titleVisible" v- html= " profile.title" >< / sup>
18
19
< / h3>
19
20
< dl>
20
21
< template v- if = " profile.reposOfficial" >
@@ -142,6 +143,7 @@ order: 31
142
143
v-for="profile in sortedTeam"
143
144
:key="profile.github"
144
145
:profile="profile"
146
+ :title-visible="titleVisible"
145
147
></vuer-profile>
146
148
</div >
147
149
@@ -181,6 +183,7 @@ order: 31
181
183
v-for="profile in sortedPartners"
182
184
:key="profile.github"
183
185
:profile="profile"
186
+ :title-visible="titleVisible"
184
187
></vuer-profile>
185
188
</div >
186
189
</div >
@@ -724,7 +727,8 @@ order: 31
724
727
Vue .component (' vuer-profile' , {
725
728
template: ' #vuer-profile-template' ,
726
729
props: {
727
- profile: Object
730
+ profile: Object ,
731
+ titleVisible: Boolean
728
732
},
729
733
computed: {
730
734
workHtml : function () {
@@ -828,14 +832,21 @@ order: 31
828
832
isSorting: false ,
829
833
errorGettingLocation: false ,
830
834
userPosition: null ,
831
- useMiles: false
835
+ useMiles: false ,
836
+ konami: {
837
+ position: 0 ,
838
+ code: [38 , 38 , 40 , 40 , 37 , 39 , 37 , 39 , 66 , 65 ]
839
+ }
832
840
},
833
841
computed: {
834
842
sortedTeam : function () {
835
843
return this .sortVuersByDistance (this .team )
836
844
},
837
845
sortedPartners : function () {
838
846
return this .sortVuersByDistance (this .partners )
847
+ },
848
+ titleVisible : function () {
849
+ return this .konami .code .length === this .konami .position
839
850
}
840
851
},
841
852
created : function () {
@@ -849,7 +860,11 @@ order: 31
849
860
this .useMiles = true
850
861
}
851
862
}
863
+ document .addEventListener (' keydown' , this .konamiKeydown )
852
864
},
865
+ beforeDestroy : function () {
866
+ document .removeEventListener (' keydown' , this .konamiKeydown )
867
+ }
853
868
methods: {
854
869
getUserPosition : function () {
855
870
var vm = this
@@ -890,6 +905,15 @@ order: 31
890
905
)
891
906
})
892
907
return vuersWithDistances
908
+ },
909
+ konamiKeydown : function (event ) {
910
+ if (this .titleVisible ) {
911
+ return
912
+ }
913
+
914
+ if (event .keyCode !== this .konami .code [this .konami .position ++ ]) {
915
+ this .konami .position = 0
916
+ }
893
917
}
894
918
}
895
919
})
0 commit comments