meeting.blade.php 6.6 KB

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