123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158 |
- @extends('layouts.guest-meeting')
- @section('content')
- <div id="meetingComponent">
- <h5 class="bg-dark font-weight-bold text-white m-0 py-3 px-4 d-flex">
- <span>Meeting</span>
- <span class="ml-auto" v-if="!started">
- Connecting...
- </span>
- <span class="ml-auto" v-if="started">
- <i class="fa fa-clock mr-1 text-light"></i>
- @{{ timeDisplay() }}
- </span>
- </h5>
- <div class="d-flex align-items-stretch mt-4 justify-content-center flex-nowrap">
- <div class="tp-bar">
- <div v-for="(guest, index) of guests"
- class="tp-item mb-4"
- :class="activeParticipant && activeType === 'guest' && activeParticipant.id === guest.id ? 'active' : ''"
- v-on:click="setActiveView('guest', guest)">
- <img :src="guest.image" alt="" class="w-100">
- <p class="font-weight-bold text-center mt-1 mb-0">@{{ guest.name }}</p>
- </div>
- <div v-if="!guest" class="tp-item mb-4">
- <img src="/images/person/guest.png" alt="" class="w-100">
- <p class="font-weight-bold text-center mt-1">Invite Guest</p>
- </div>
- </div>
- <div class="main-view" style="width: 800px; min-height: 600px;">
- <div class="p-4 w-100 h-100 d-flex align-items-stretch justify-content-stretch flex-column">
- <img :src="activeParticipant.image" class="d-block mw-100 mh-100 mx-auto">
- <p class="font-weight-bold text-center text-white mt-2">Feed from @{{ activeParticipant.name }}</p>
- </div>
- </div>
- <div class="tp-bar">
- <div v-for="(pro, index) of pros"
- class="tp-item mb-4"
- :class="activeParticipant && activeType === 'pro' && activeParticipant.id === pro.id ? 'active' : ''"
- v-on:click="setActiveView('pro', pro)">
- <div v-if="pro.status === 'active'">
- <img :src="pro.image" alt="" class="w-100">
- <p class="font-weight-bold text-center mt-1 mb-0">@{{ pro.name }}</p>
- <p class="font-weight-normal text-center">@{{ pro.type }}</p>
- </div>
- <div v-if="pro.status === 'connecting'">
- <img src="/images/person/connecting.jpg" alt="" class="w-100">
- <p class="font-weight-normal text-center mt-1 d-flex align-items-center justify-content-center">
- <img src="/images/loading.gif" class="mr-1">
- Connecting
- </p>
- </div>
- </div>
- </div>
- </div>
- </div>
- <script>
- new Vue({
- el: '#meetingComponent',
- delimiters: ['@{{', '}}'],
- data: {
- meetingID: '<?= $meetingID ?>',
- participantID: '<?= $participantID ?>',
- time: 0,
- startTime: 0,
- started: false,
- guest: false,
- activeType: false,
- activeParticipant: false,
- guests: [
- {
- id: 1,
- name: 'You',
- image: '/images/person/you.jpg',
- status: 'active',
- },
- ],
- pros: [
- {
- id: 1,
- name: 'Nancy Drew',
- type: 'Receptionist',
- image: '/images/person/nancy.jpg',
- status: 'connecting',
- }
- ]
- // pros: []
- },
- methods: {
- setActiveView: function(_type, _participant) {
- if(_participant.status === 'active') {
- this.activeType = _type;
- this.activeParticipant = _participant;
- }
- },
- timeDisplay: function() {
- // this.time = new Date().getTime() - this.startTime;
- var seconds = this.time / 1000,
- minutes = parseInt(seconds / 60, 10);
- seconds = parseInt(seconds % 60, 10);
- return minutes + " min, " + seconds + " sec";
- }
- },
- mounted: function() {
- this.activeType = 'guest';
- this.activeParticipant = this.guests[0];
- var self = this;
- // after 2 seconds, connect recep
- window.setTimeout(function() {
- self.pros[0].status = 'active';
- self.started = true;
- self.startTime = new Date().getTime();
- self.activeType = 'pro';
- self.activeParticipant = self.pros[0];
- window.setInterval(function() {
- self.time = new Date().getTime() - self.startTime;
- }, 1000);
- // after 1 second, add 2 docs in connecting state
- window.setTimeout(function() {
- self.pros.push({
- id: 2,
- name: 'Dr. Strange',
- type: 'Dietitian',
- image: '/images/person/strange.0.jpg',
- status: 'connecting',
- });
- self.pros.push({
- id: 3,
- name: 'Dr. Do Little',
- type: 'Cardiologist',
- image: '/images/person/dl.jpg',
- status: 'connecting',
- });
- // after a second, connect strange
- window.setTimeout(function() {
- self.pros[1].status = 'active';
- window.setTimeout(function() {
- self.pros[2].status = 'active';
- }, 1000);
- }, 1000);
- }, 1000);
- }, 2000);
- }
- });
- </script>
- @endsection
|