meeting.blade.php 5.9 KB

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