Ngiler SH3LL 360
Home
Information
Create File
Create Folder
:
/
home
/
tbf
/
conferinta_tbf
/
resources
/
js
/
components
/
Information Server
MySQL :
OFF
Perl :
OFF
CURL :
ON
WGET :
OFF
PKEXEC :
OFF
Directive
Local Value
IP Address
89.40.16.97
System
Linux server.atelieruldeit.ro 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64
User
tbf
PHP Version
7.3.33
Software
Apache
Doc root
Writable
close
Edit File :
StartPage.vue
| Size :
5.62
KB
Copy
<template> <div class="content-step start-quiz"> <div class="question"> <h1 class="title"> <span class="overlay">Start</span> <span class="question" v-html="title"></span> </h1> <div class="small-line"></div> <div class="description">{{question.description}} <img :src="'images/' + question.image" v-if="question.image"> <div class="video-description" v-if="question.video"> <div :id="'wistia_'+question.video" class="wistia_embed"> </div> </div> <div class="video-description" v-if="question.audio_mp3"> <audio controls> <source :src="'images/' + question.audio_ogg" type="audio/ogg"> <source :src="'images/' + question.audio_mp3" type="audio/mpeg"> Your browser does not support the audio tag. </audio> </div> </div> </div> <div class="answer"> <div class="position-relative" v-for="(answer, key) in question.answers" :key="key"> <div class="answer-button" @click="setActive(key,answer)" v-bind:class="[active_answer == (questionKey + '-' + key) ? 'active' : '']"> <img class="img-answer" v-if="answer.image != null && answer.image != ''" :src="'images/' + answer.image"> <div class="video-answer" v-if="answer.video"> <div :id="'wistia_'+answer.video" class="wistia_embed"> </div> </div> <button class="start-button"><span>{{answer.title}}</span> <arrow-right></arrow-right></button> </div> </div> <!-- <div class="back_button" @click="back_to_previous" v-if="showPreviousBtn"> <button><arrow-left></arrow-left> Intrebarea precedenta</button> </div> --> </div> </div> </template> <script> import NextIcon from "./icons/Next"; import ArrowRight from "./icons/arrow-right"; import ArrowLeft from "./icons/ArrowLeft"; export default { data() { return { active_answer: 'nothing', answer_selected: 'nothing', title_question: '', showPreviousBtn: true } }, components: { 'next-icon': NextIcon, 'arrow-right':ArrowRight, 'arrow-left': ArrowLeft }, computed:{ title: function(){ let quiz_obj = JSON.parse(localStorage.getItem('quiz')) var new_title = ''; var regex_get_value = /(?:\#)([^#]+)(?=#|$)/; var title_escaped = ''; var new_title_v1 = ''; for (let i = 0; i < this.question.title.length; i++) { if(this.question.title[i].condition == 'true'){ if(regex_get_value.exec(this.question.title[i].title)){ title_escaped = eval(regex_get_value.exec(this.question.title[i].title)[1]); } new_title_v1 = this.question.title[i].title.replace(/\#([^#]+)\#/g , title_escaped); new_title = new_title_v1.replace('{','<mark>').replace('}','</mark>'); new_title = new_title.replace('&name', this.name_referral); this.title_question = new_title; break; } if(eval(this.question.title[i].condition)){ if(regex_get_value.exec(this.question.title[i].title)){ title_escaped = eval(regex_get_value.exec(this.question.title[i].title)[1]); } new_title_v1 = this.question.title[i].title.replace(/\#([^#]+)\#/g , title_escaped); new_title = new_title_v1.replace('{','<mark>').replace('}','</mark>'); new_title = new_title.replace('&name', this.name_referral); this.title_question = new_title; break; } } return new_title; } }, mounted() { if(localStorage.getItem('previous_step') == this.questionKey){ this.showPreviousBtn = false; }else{ this.showPreviousBtn = true; } }, watch: { question: function (val) { if(localStorage.getItem('previous_step') == this.questionKey){ this.showPreviousBtn = false; }else{ this.showPreviousBtn = true; } this.answer_selected = ''; this.active_answer = ''; } }, props: { question: Object, setNextQuestion: Function, previousSet: Function, questionKey: String, step_no: '', name_referral: String }, methods: { setActive(key, answer){ this.active_answer = (this.questionKey + '-' + key); this.answer_selected = answer; setTimeout(() => { $('.answer-button.active').removeClass('active'); }, 50); this.setNextQuestion(this.questionKey, this.answer_selected, this.title_question, key) }, back_to_previous(){ this.previousSet(); } } } </script>
Back