meeting.blade.php 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. @extends('layouts.guest-meeting')
  2. @section('content')
  3. <style>
  4. .main-view {
  5. width: 800px;
  6. height: 600px;
  7. margin: 0 1rem;
  8. background: #444;
  9. border-radius: 3px;
  10. }
  11. .tp-bar {
  12. width: 140px;
  13. }
  14. .tp-bar .tp-item img {
  15. border-radius: 3px;
  16. opacity: 0.8;
  17. cursor: pointer;
  18. }
  19. .tp-bar .tp-item img:hover, .tp-bar .tp-item.active img {
  20. opacity: 1;
  21. }
  22. .tp-bar .tp-item.active img {
  23. box-shadow: 0 0 0 0.3rem #44bdad85;
  24. }
  25. </style>
  26. <div id="meetingComponent">
  27. <h5 class="bg-dark font-weight-bold text-white m-0 py-3 px-4 d-flex">
  28. <span>Meeting</span>
  29. <span class="ml-auto" v-if="!started">
  30. Connecting...
  31. </span>
  32. <span class="ml-auto" v-if="started">
  33. <i class="fa fa-clock mr-1 text-light"></i>
  34. @{{ timeDisplay() }}
  35. </span>
  36. </h5>
  37. <div class="d-flex align-items-stretch mt-4 justify-content-center flex-nowrap">
  38. <div class="tp-bar">
  39. <div v-for="(guest, index) of guests"
  40. class="tp-item mb-4"
  41. :class="activeParticipant && activeType === 'guest' && activeParticipant.id === guest.id ? 'active' : ''"
  42. v-on:click="setActiveView('guest', guest)">
  43. <img :src="guest.image" alt="" class="w-100">
  44. <p class="font-weight-bold text-center mt-1 mb-0">@{{ guest.name }}</p>
  45. </div>
  46. <div v-if="!guest" class="tp-item mb-4">
  47. <img src="/images/person/guest.png" alt="" class="w-100">
  48. <p class="font-weight-bold text-center mt-1">Invite Guest</p>
  49. </div>
  50. </div>
  51. <div class="main-view" style="width: 800px; min-height: 600px;">
  52. <div class="p-4 w-100 h-100 d-flex align-items-stretch justify-content-stretch flex-column">
  53. <img :src="activeParticipant.image" class="d-block mw-100 mh-100 mx-auto">
  54. <p class="font-weight-bold text-center text-white mt-2">Feed from @{{ activeParticipant.name }}</p>
  55. </div>
  56. </div>
  57. <div class="tp-bar">
  58. <div v-for="(pro, index) of pros"
  59. class="tp-item mb-4"
  60. :class="activeParticipant && activeType === 'pro' && activeParticipant.id === pro.id ? 'active' : ''"
  61. v-on:click="setActiveView('pro', pro)">
  62. <div v-if="pro.status === 'active'">
  63. <img :src="pro.image" alt="" class="w-100">
  64. <p class="font-weight-bold text-center mt-1 mb-0">@{{ pro.name }}</p>
  65. <p class="font-weight-normal text-center">@{{ pro.type }}</p>
  66. </div>
  67. <div v-if="pro.status === 'connecting'">
  68. <img src="/images/person/connecting.jpg" alt="" class="w-100">
  69. <p class="font-weight-normal text-center mt-1 d-flex align-items-center justify-content-center">
  70. <img src="/images/loading.gif" class="mr-1">
  71. Connecting
  72. </p>
  73. </div>
  74. </div>
  75. </div>
  76. </div>
  77. </div>
  78. <script>
  79. new Vue({
  80. el: '#meetingComponent',
  81. delimiters: ['@{{', '}}'],
  82. data: {
  83. time: 0,
  84. startTime: 0,
  85. started: false,
  86. guest: false,
  87. activeType: false,
  88. activeParticipant: false,
  89. guests: [
  90. {
  91. id: 1,
  92. name: 'You',
  93. image: '/images/person/you.jpg',
  94. status: 'active',
  95. },
  96. ],
  97. pros: [
  98. {
  99. id: 1,
  100. name: 'Nancy Drew',
  101. type: 'Receptionist',
  102. image: '/images/person/nancy.jpg',
  103. status: 'connecting',
  104. }
  105. ]
  106. // pros: []
  107. },
  108. methods: {
  109. setActiveView: function(_type, _participant) {
  110. if(_participant.status === 'active') {
  111. this.activeType = _type;
  112. this.activeParticipant = _participant;
  113. }
  114. },
  115. timeDisplay: function() {
  116. // this.time = new Date().getTime() - this.startTime;
  117. var seconds = this.time / 1000,
  118. minutes = parseInt(seconds / 60, 10);
  119. seconds = parseInt(seconds % 60, 10);
  120. return minutes + " min, " + seconds + " sec";
  121. }
  122. },
  123. mounted: function() {
  124. this.activeType = 'guest';
  125. this.activeParticipant = this.guests[0];
  126. var self = this;
  127. // after 2 seconds, connect recep
  128. window.setTimeout(function() {
  129. self.pros[0].status = 'active';
  130. self.started = true;
  131. self.startTime = new Date().getTime();
  132. self.activeType = 'pro';
  133. self.activeParticipant = self.pros[0];
  134. window.setInterval(function() {
  135. self.time = new Date().getTime() - self.startTime;
  136. }, 1000);
  137. // after 1 second, add 2 docs in connecting state
  138. window.setTimeout(function() {
  139. self.pros.push({
  140. id: 2,
  141. name: 'Dr. Strange',
  142. type: 'Dietitian',
  143. image: '/images/person/strange.0.jpg',
  144. status: 'connecting',
  145. });
  146. self.pros.push({
  147. id: 3,
  148. name: 'Dr. Do Little',
  149. type: 'Cardiologist',
  150. image: '/images/person/dl.jpg',
  151. status: 'connecting',
  152. });
  153. // after a second, connect strange
  154. window.setTimeout(function() {
  155. self.pros[1].status = 'active';
  156. window.setTimeout(function() {
  157. self.pros[2].status = 'active';
  158. }, 1000);
  159. }, 1000);
  160. }, 1000);
  161. }, 2000);
  162. }
  163. });
  164. </script>
  165. @endsection