%PDF- %PDF-
Direktori : /home/forge/takeaseat.eco-n-tech.co.uk/.nuxt/dist/server/components/ |
Current File : //home/forge/takeaseat.eco-n-tech.co.uk/.nuxt/dist/server/components/personalisation.js |
exports.ids = [24,10]; exports.modules = { /***/ 131: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/slots/Block.vue?vue&type=template&id=0e972406& var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('section',{staticClass:"bg-gray py-8 md:py-20 px-4 md:px-8 mb-8"},[_vm._ssrNode("<div class=\"max-w-xl mx-auto w-full\"><header class=\"text-center mb-10\"><h2"+(_vm._ssrClass("text-2xl sm:text-3xl font-bold",_vm.description ? 'mb-8' : ''))+">"+_vm._ssrEscape(_vm._s(_vm.title))+"</h2> "+((_vm.description)?("<p class=\"text-sm sm:text-base\">"+_vm._ssrEscape(_vm._s(_vm.description))+"</p>"):"<!---->")+"</header></div> "),_vm._ssrNode("<div"+(_vm._ssrClass("mx-auto w-full",_vm.width ? _vm.width : 'max-w-xl'))+">","</div>",[_vm._t("default")],2)],2)} var staticRenderFns = [] // CONCATENATED MODULE: ./components/slots/Block.vue?vue&type=template&id=0e972406& // CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/slots/Block.vue?vue&type=script&lang=js& // // // // // // // // // // // // // // // // // /* harmony default export */ var Blockvue_type_script_lang_js_ = ({ props: { title: { type: String, required: true }, description: { type: String, required: false }, width: { type: String, required: false } } }); // CONCATENATED MODULE: ./components/slots/Block.vue?vue&type=script&lang=js& /* harmony default export */ var slots_Blockvue_type_script_lang_js_ = (Blockvue_type_script_lang_js_); // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js var componentNormalizer = __webpack_require__(1); // CONCATENATED MODULE: ./components/slots/Block.vue /* normalize component */ var component = Object(componentNormalizer["a" /* default */])( slots_Blockvue_type_script_lang_js_, render, staticRenderFns, false, null, null, "127f880a" ) /* harmony default export */ var Block = __webpack_exports__["default"] = (component.exports); /* nuxt-component-imports */ installComponents(component, {Header: __webpack_require__(12).default}) /***/ }), /***/ 153: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(URL) {// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ data() { return { working: false, showModal: false, photo_url: null, file: null, selected_colour: 'yellow', colours: [{ name: 'yellow' }, { name: 'green' }, { name: 'pink' }, { name: 'blue-light' }, { name: 'blue-medium' }, { name: 'orange' }, { name: 'green-dark' }, { name: 'red' }, { name: 'blue' }, { name: 'purple' }] }; }, computed: { user() { return this.$auth.user; } }, async mounted() { await this.$axios.$get('/profile').then(response => { this.selected_colour = response.data.colour; this.photo_url = response.data.user.photo_url; }); }, methods: { async handleFileChange(e) { const { valid } = await this.$refs.provider.validate(e); let fileUrl = this.$refs.file.files[0]; if (valid == true) { this.$refs.cropModal.show(); if (fileUrl) { setTimeout(() => { this.$refs.croppieRef.bind({ url: URL.createObjectURL(fileUrl) }); }, 250); } } }, crop() { let options = { format: 'jpeg' }; this.$refs.croppieRef.result(options, output => { this.file = output; this.uploadPhoto(); }); }, result(output) { this.file = output; }, async uploadPhoto() { this.$refs.form.validate().then(success => { if (!success) { return; } this.working = true; this.$axios.$post('/account/profile/photo', { file: this.file }).then(response => { this.working = false; this.photo_url = response; this.$refs.cropModal.hide(); this.$store.dispatch('account/progress/get', { slug: 'profile' }); this.$toast.success('Successfully updated your photo').goAway(1500); }).catch(error => { this.working = false; this.$refs.cropModal.hide(); this.$refs.form.setErrors(error.response.data.errors); }); }); }, async saveTheme() { this.working = true; this.$axios.$post('/profile/update', { colour: this.selected_colour }).then(response => { this.working = false; this.$toast.success('Successfully updated your colour').goAway(1500); }); } } }); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(130)["URL"])) /***/ }), /***/ 198: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/blocks/Account/profile/Personalisation.vue?vue&type=template&id=51eeda71& var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('Block',{attrs:{"title":"Personalisation","description":"Upload a photo & choose a colour that makes you stand out"}},[_c('ValidationObserver',{ref:"form"},[_c('form',{attrs:{"role":"form","method":"POST"},on:{"submit":function($event){$event.preventDefault();return _vm.uploadPhoto($event)}}},[_c('ValidationProvider',{ref:"provider",attrs:{"rules":"image|size:10000"},scopedSlots:_vm._u([{key:"default",fn:function(ref){ var validate = ref.validate; var errors = ref.errors; return [_c('div',{staticClass:"w-full mx-auto mb-8 text-center",staticStyle:{"max-width":"170px"}},[_c('label',{staticClass:"block cursor-pointer",attrs:{"for":"file"}},[(_vm.photo_url)?_c('div',{staticClass:"relative"},[_c('div',{staticClass:"absolute top-0 left-0 w-full h-full border-15 border-opacity-50",class:'tas-border-'+_vm.selected_colour}),_vm._v(" "),_c('img',{staticClass:"w-full",attrs:{"src":_vm.photo_url,"alt":_vm.user.data.full_name}})]):_c('div',{staticClass:"w-full flex items-center justify-center border-2 border-dashed border-black border-opacity-20 rounded-md",staticStyle:{"height":"170px"}},[_c('span',{staticClass:"text-sm text-black"},[_vm._v("Click to upload")])]),_vm._v(" "),_c('input',{ref:"file",staticClass:"hidden",attrs:{"type":"file","id":"file","accept":"image/*"},on:{"change":function($event){return _vm.handleFileChange()}}}),_vm._v(" "),_c('span',{staticClass:"mt-4 block uppercase text-blue-light"},[_vm._v("Upload Photo")])]),_vm._v(" "),(errors[0])?_c('span',{staticClass:"field-invalid"},[_vm._v(_vm._s(errors[0]))]):_vm._e()]),_vm._v(" "),_c('t-modal',{ref:"cropModal",attrs:{"header":"Crop & Upload"},scopedSlots:_vm._u([{key:"footer",fn:function(){return [_c('div',{staticClass:"flex flex-wrap justify-between"},[_c('button',{staticClass:"btn btn-small btn-primary",attrs:{"type":"button"},on:{"click":function($event){return _vm.$refs.cropModal.hide()}}},[_vm._v("\n Cancel\n ")]),_vm._v(" "),_c('button',{staticClass:"btn btn-small btn-primary",attrs:{"type":"button"},on:{"click":function($event){return _vm.crop()}}},[(_vm.working == false)?_c('span',[_vm._v("Crop & Upload")]):_c('span',{staticClass:"flex items-center justify-center"},[_c('svg',{staticClass:"animate-spin -ml-1 mr-3 h-5 w-5 text-current",attrs:{"xmlns":"http://www.w3.org/2000/svg","fill":"none","viewBox":"0 0 24 24"}},[_c('circle',{staticClass:"opacity-25",attrs:{"cx":"12","cy":"12","r":"10","stroke":"currentColor","stroke-width":"4"}}),_vm._v(" "),_c('path',{staticClass:"opacity-75",attrs:{"fill":"currentColor","d":"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"}})]),_vm._v(" "),_c('span',[_vm._v("Processing")])])])])]},proxy:true}],null,true)},[_c('vue-croppie',{ref:"croppieRef",attrs:{"enableOrientation":true,"enableResize":false,"boundary":{ width: 270, height: 270},"viewport":{ width: 250, height: 250}},on:{"result":_vm.result}})],1)]}}])})],1)]),_vm._v(" "),_c('div',{staticClass:"grid grid-cols-1 sm:grid-cols-4 bg-black mb-8"},[_c('div',{staticClass:"relative col-span-1"},[_c('div',{staticClass:"absolute top-0 left-0 w-full h-full border-10 border-opacity-75",class:'tas-border-'+_vm.selected_colour}),_vm._v(" "),_c('img',{staticClass:"w-full",attrs:{"src":_vm.photo_url,"alt":_vm.user.data.full_name}})]),_vm._v(" "),_c('div',{staticClass:"sm:col-span-3 py-6 sm:py-0 flex flex-col items-center justify-center"},[_c('span',{staticClass:"text-5xl text-white ",class:'tas-text-'+_vm.selected_colour},[_vm._v(_vm._s(_vm.user.data.first_name))]),_vm._v(" "),_c('span',{staticClass:"uppercase text-xl text-white"},[_vm._v(_vm._s(_vm.user.data.last_name))])])]),_vm._v(" "),_c('t-input-group',{attrs:{"label":"Colour Options"}},[_c('div',{staticClass:"grid grid-cols-4 sm:grid-cols-5 gap-5 sm:gap-10 mb-10 pt-3"},_vm._l((_vm.colours),function(colour,key){return _c('div',{key:key,staticClass:"flex items-center justify-center"},[_c('label',{staticClass:"flex items-center justify-center relative w-10 h-10 rounded cursor-pointer",class:'tas-bg-'+colour.name},[(colour.name == _vm.selected_colour)?_c('svg',{staticClass:"text-white w-8 h-8",attrs:{"xmlns":"http://www.w3.org/2000/svg","fill":"none","viewBox":"0 0 24 24","stroke":"currentColor"}},[_c('path',{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2","d":"M5 13l4 4L19 7"}})]):_vm._e(),_vm._v(" "),_c('input',{directives:[{name:"model",rawName:"v-model",value:(_vm.selected_colour),expression:"selected_colour"}],staticClass:"absolute top-0 left-0 w-full h-full hidden",attrs:{"name":"colours","type":"radio"},domProps:{"value":colour.name,"checked":_vm._q(_vm.selected_colour,colour.name)},on:{"change":[function($event){_vm.selected_colour=colour.name},_vm.saveTheme]}})])])}),0)])],1)} var staticRenderFns = [] // CONCATENATED MODULE: ./components/blocks/Account/profile/Personalisation.vue?vue&type=template&id=51eeda71& // EXTERNAL MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/blocks/Account/profile/Personalisation.vue?vue&type=script&lang=js& var Personalisationvue_type_script_lang_js_ = __webpack_require__(153); // CONCATENATED MODULE: ./components/blocks/Account/profile/Personalisation.vue?vue&type=script&lang=js& /* harmony default export */ var profile_Personalisationvue_type_script_lang_js_ = (Personalisationvue_type_script_lang_js_["a" /* default */]); // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js var componentNormalizer = __webpack_require__(1); // CONCATENATED MODULE: ./components/blocks/Account/profile/Personalisation.vue /* normalize component */ var component = Object(componentNormalizer["a" /* default */])( profile_Personalisationvue_type_script_lang_js_, render, staticRenderFns, false, null, null, "2766d782" ) /* harmony default export */ var Personalisation = __webpack_exports__["default"] = (component.exports); /* nuxt-component-imports */ installComponents(component, {Block: __webpack_require__(131).default}) /***/ }) };; //# sourceMappingURL=personalisation.js.map