File tree Expand file tree Collapse file tree 4 files changed +41
-0
lines changed
Expand file tree Collapse file tree 4 files changed +41
-0
lines changed Original file line number Diff line number Diff line change 1+ <template >
2+ <!-- eslint-disable max-len -->
3+ <button v-if =" showScroll"
4+ class =" z-10 fixed text-2xl text-white-matcha font-bold bottom-0 mx-auto ml-4 sm:ml-8 mb-8 w-12 h-12 rounded-full bg-purple-matcha"
5+ v-on:click =" scrollUp()" >
6+ ↑</button >
7+ </template >
8+
9+ <script >
10+ export default {
11+ data : () => ({
12+ showScroll: false ,
13+ }),
14+ methods: {
15+ scrollUp () {
16+ window .scrollTo ({
17+ top: 0 ,
18+ behavior: ' smooth' ,
19+ });
20+ },
21+ handleScroll () {
22+ this .showScroll = window .scrollY > window .screen .height ;
23+ },
24+ },
25+ created () {
26+ window .addEventListener (' scroll' , this .handleScroll );
27+ },
28+ destroyed () {
29+ window .removeEventListener (' scroll' , this .handleScroll );
30+ },
31+ };
32+ </script >
Original file line number Diff line number Diff line change 1313 v-bind:recommendationsReceived =" recommendations"
1414 v-bind:recommendationsAnalysis =" recommendationsAnalysis" ></Recommendations >
1515 <div id =" invisibleFooter" class =" h-4 w-full bg-white" ></div >
16+ <ScrollUpButton ></ScrollUpButton >
1617 </section >
1718 </div >
1819</template >
2122/* eslint-disable max-len */
2223
2324import Recommendations from ' @/components/app/recommendations/Recommendations.vue' ;
25+ import ScrollUpButton from ' @/components/shared/ScrollUpButton.vue' ;
2426
2527export default {
2628 name: ' Browse' ,
2729 props: [' recommendationsFromSettingUp' ],
2830 components: {
2931 Recommendations,
32+ ScrollUpButton,
3033 },
3134 data : () => ({
3235 recommendations: [],
Original file line number Diff line number Diff line change 2525 v-bind:recommendationsReceived =" recommendations"
2626 v-bind:recommendationsAnalysis =" recommendationsAnalysis" ></HistoryRecommendations >
2727 <div id =" invisibleFooterHistory" class =" h-4 w-full bg-white" ></div >
28+ <ScrollUpButton ></ScrollUpButton >
2829 </section >
2930 </div >
3031</template >
3536
3637import HistoryRecommendations from ' @/components/app/recommendations/HistoryRecommendations.vue' ;
3738import DropdownDisplayChoiceHistory from ' @/components/shared/DropdownDisplayChoiceHistory.vue' ;
39+ import ScrollUpButton from ' @/components/shared/ScrollUpButton.vue' ;
3840
3941export default {
4042 name: ' History' ,
4143 props: [' recommendationsFromSettingUp' ],
4244 components: {
4345 HistoryRecommendations,
4446 DropdownDisplayChoiceHistory,
47+ ScrollUpButton,
4548 },
4649 data : () => ({
4750 recommendations: [],
Original file line number Diff line number Diff line change 1414 v-bind:title =" 'Potential matches'"
1515 v-bind:recommendationsReceived =" recommendations"
1616 v-bind:recommendationsAnalysis =" filters" ></Recommendations >
17+ <ScrollUpButton ></ScrollUpButton >
1718 </section >
1819 <div id =" invisibleFooterSearch" class =" h-4 w-full bg-white" ></div >
1920 <section v-on:click =" setError(null)"
7475import FilterSlider from ' @/components/shared/FilterSlider.vue' ;
7576import MultipleFilters from ' @/components/shared/MultipleFilters.vue' ;
7677import Recommendations from ' @/components/app/recommendations/Recommendations.vue' ;
78+ import ScrollUpButton from ' @/components/shared/ScrollUpButton.vue' ;
7779
7880export default {
7981 name: ' Search' ,
8082 components: {
8183 MultipleFilters,
8284 FilterSlider,
8385 Recommendations,
86+ ScrollUpButton,
8487 },
8588 data : () => ({
8689 recommendations: [],
You can’t perform that action at this time.
0 commit comments