|
1 | 1 | <template> |
2 | 2 | <!-- eslint-disable max-len --> |
3 | | - <div> |
4 | | - <h1>onboarding</h1> |
| 3 | + <div class="onboarding-container"> |
| 4 | + <section class="onboarding-sub-container" v-if="slide === 0"> |
| 5 | + <h1 class="onboarding-sub-container-content-heading text-8xl introduction mb-8 text-center leading-none">Meet<br>your<br>lover</h1> |
| 6 | + <button class="onboarding-sub-container-content-button-outline w-1/2 mt-0" v-on:click="nextSlide()">{{buttonText}}</button> |
| 7 | + </section> |
| 8 | + <section class="onboarding-sub-container" v-if="slide === 1"> |
| 9 | + <h1>{{slide}} / {{slideCount}}</h1> |
| 10 | + <h1 class="onboarding-sub-container-content-heading leading-none">I am</h1> |
| 11 | + <div class="h-64 flex flex-col items-center justify-center w-full"> |
| 12 | + <h1 class="onboarding-sub-container-content-button-outline mt-0">Man</h1> |
| 13 | + <h1 class="onboarding-sub-container-content-button-outline mt-2">Woman</h1> |
| 14 | + <h1 class="onboarding-sub-container-content-button-outline mt-2">Other</h1> |
| 15 | + </div> |
| 16 | + <button class="onboarding-sub-container-content-button-outline-light mt-0" v-on:click="nextSlide()">{{buttonText}}</button> |
| 17 | + </section> |
| 18 | + <section class="onboarding-sub-container" v-if="slide === 2"> |
| 19 | + <h1>{{slide}} / {{slideCount}}</h1> |
| 20 | + <h1 class="onboarding-sub-container-content-heading leading-none">I want</h1> |
| 21 | + <div class="h-64 flex flex-col items-center justify-center w-full"> |
| 22 | + <h1 class="onboarding-sub-container-content-button-outline mt-0">Men</h1> |
| 23 | + <h1 class="onboarding-sub-container-content-button-outline mt-2">Women</h1> |
| 24 | + <h1 class="onboarding-sub-container-content-button-outline mt-2">Other</h1> |
| 25 | + </div> |
| 26 | + <button class="onboarding-sub-container-content-button-outline-light mt-0" v-on:click="nextSlide()">{{buttonText}}</button> |
| 27 | + </section> |
| 28 | + <section class="onboarding-sub-container" v-if="slide === 3"> |
| 29 | + <h1>{{slide}} / {{slideCount}}</h1> |
| 30 | + <h1 class="onboarding-sub-container-content-heading leading-none">I like</h1> |
| 31 | + <div class="h-64 pb-4 my-8 sm:my-16 flex flex-col items-center w-full overflow-scroll"> |
| 32 | + <h1 class="onboarding-sub-container-content-button-outline mt-0">coffee</h1> |
| 33 | + <h1 class="onboarding-sub-container-content-button-outline">yoga</h1> |
| 34 | + <h1 class="onboarding-sub-container-content-button-outline">football</h1> |
| 35 | + <h1 class="onboarding-sub-container-content-button-outline">rap</h1> |
| 36 | + <h1 class="onboarding-sub-container-content-button-outline">travelling</h1> |
| 37 | + <h1 class="onboarding-sub-container-content-button-outline">Coffee</h1> |
| 38 | + <h1 class="onboarding-sub-container-content-button-outline">Coffee</h1> |
| 39 | + <h1 class="onboarding-sub-container-content-button-outline">Coffee</h1> |
| 40 | + <h1 class="onboarding-sub-container-content-button-outline">Coffee</h1> |
| 41 | + <h1 class="onboarding-sub-container-content-button-outline">Coffee</h1> |
| 42 | + <h1 class="onboarding-sub-container-content-button-outline">Coffee</h1> |
| 43 | + <h1 class="onboarding-sub-container-content-button-outline">Coffee</h1> |
| 44 | + </div> |
| 45 | + <button class="onboarding-sub-container-content-button-outline-light mt-0" v-on:click="nextSlide()">{{buttonText}}</button> |
| 46 | + </section> |
| 47 | + <section class="onboarding-sub-container" v-if="slide === 4"> |
| 48 | + <h1>{{slide}} / {{slideCount}}</h1> |
| 49 | + <h1 class="onboarding-sub-container-content-heading leading-none text-center">Profile<br>image</h1> |
| 50 | + <button v-if="!slide4.imageUploaded" class="relative onboarding-sub-container-upload-button my-8"> |
| 51 | + <input class="cursor-pointer opacity-0 absolute top-0 left-0 w-full h-full rounded-md" type="file" v-on:change="selectFile()" ref="file">ADD |
| 52 | + </button> |
| 53 | + <div class="relative my-8 rounded-lg" v-if="slide4.imageUploaded"> |
| 54 | + <img src="../../assets/onboarding/remove.png" class="absolute cursor-pointer top-0 left-0 -ml-5 -mt-5 w-10" v-on:click="deleteImage()"> |
| 55 | + <img v-bind:src="slide4.imageUrl" class="w-full rounded-lg"> |
| 56 | + </div> |
| 57 | + <button class="onboarding-sub-container-content-button-outline-light mt-0" v-on:click="nextSlide()">{{buttonText}}</button> |
| 58 | + </section> |
| 59 | + <section class="onboarding-sub-container" v-if="slide === 5"> |
| 60 | + <h1>{{slide}} / {{slideCount}}</h1> |
| 61 | + <h1 class="onboarding-sub-container-content-heading leading-none text-center">Other<br>images</h1> |
| 62 | + <button class="onboarding-sub-container-upload-button my-8" v-on:click="nextSlide()">ADD</button> |
| 63 | + <div class="uploaded-image-container"> |
| 64 | + </div> |
| 65 | + <button class="onboarding-sub-container-content-button-outline-light mt-0" v-on:click="nextSlide()">{{buttonText}}</button> |
| 66 | + </section> |
5 | 67 | </div> |
6 | 68 | </template> |
7 | 69 |
|
8 | 70 | <script> |
9 | 71 |
|
10 | 72 | export default { |
| 73 | + data: () => ({ |
| 74 | + slide: 0, |
| 75 | + slideCount: 6, |
| 76 | + slide4: { |
| 77 | + image: null, |
| 78 | + imageUrl: null, |
| 79 | + imageUploaded: false, |
| 80 | + imageUploadError: false, |
| 81 | + errorText: '', |
| 82 | + }, |
| 83 | + }), |
| 84 | + methods: { |
| 85 | + nextSlide() { |
| 86 | + if (this.slide === this.slideCount) { |
| 87 | + this.$router.push('/browse'); |
| 88 | + } |
| 89 | + if (this.slide < this.slideCount) { |
| 90 | + this.slide += 1; |
| 91 | + } |
| 92 | + }, |
| 93 | + selectFile() { |
| 94 | + const allowedTypes = ['image/jpeg', 'image/png', 'image/gif']; |
| 95 | + const file = this.$refs.file.files[0]; |
| 96 | + this.slide4.file = file; |
| 97 | +
|
| 98 | + if (!allowedTypes.includes(file.type)) { |
| 99 | + this.slide4.errorText = 'Only images allowed'; |
| 100 | + this.slide4.imageUploadError = true; |
| 101 | + return; |
| 102 | + } |
| 103 | + if (file.size > 2000000) { |
| 104 | + this.slide4.errorText = 'File too large'; |
| 105 | + this.slide4.imageUploadError = true; |
| 106 | + return; |
| 107 | + } |
| 108 | + this.slide4.imageUploaded = true; |
| 109 | + this.slide4.imageUrl = URL.createObjectURL(file); |
| 110 | + console.log(this.slide4.imageUrl); |
| 111 | + }, |
| 112 | + deleteImage() { |
| 113 | + this.slide4.image = null; |
| 114 | + this.slide4.imageUploaded = false; |
| 115 | + this.slide4.imageUrl = ''; |
| 116 | + }, |
| 117 | + }, |
| 118 | + computed: { |
| 119 | + buttonText() { |
| 120 | + if (this.slide === 0) { |
| 121 | + return 'Let\'s go'; |
| 122 | + } |
| 123 | + if (this.slide < this.slideCount) { |
| 124 | + return 'Continue'; |
| 125 | + } |
| 126 | + return 'Finish'; |
| 127 | + }, |
| 128 | + }, |
11 | 129 | }; |
12 | 130 |
|
13 | 131 | </script> |
| 132 | + |
| 133 | +<style scoped> |
| 134 | +.introduction { |
| 135 | + background: linear-gradient(315deg, #ad1deb 0%, #6e72fc 74%); |
| 136 | + -webkit-background-clip: text; |
| 137 | + -webkit-text-fill-color: transparent; |
| 138 | +} |
| 139 | +.upload-small { |
| 140 | + height: 50%; |
| 141 | +} |
| 142 | +</style> |
0 commit comments