Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.73 KB | None | 0 0
  1. <style id="jsbin-css">
  2. .limit-lines {
  3. margin-top: 1.24em !important;
  4. display: block;
  5. /* or inline-block */
  6. text-overflow: ellipsis;
  7. word-wrap: break-word;
  8. overflow: hidden;
  9. max-height: 6em;
  10. line-height: 1.5em;
  11. }
  12.  
  13. .card-papa {
  14. background-position: center center !important;
  15. background-size: cover !important;
  16. background-repeat: no-repeat !important;
  17. }
  18.  
  19. .card-papa .card-panel {
  20. background: rgba(0, 92, 151, .8);
  21. background: -webkit-linear-gradient(to right, rgba(55, 67, 117, .8), rgba(0, 92, 151, .8));
  22. background: linear-gradient(to right, rgba(55, 67, 117, .8), rgba(0, 92, 151, .8));
  23. }
  24.  
  25. .trending-container {
  26. width: 90% !important;
  27. margin: .2em auto;
  28. }
  29. </style>
  30. <div class="browse reviews blue-grey lighten-4">
  31. <div class="white black-text">
  32. <p>
  33. <%= JSON.stringify(trending , null, 4)%>
  34. </p>
  35. <h5>
  36. No. of trending reviews overall:
  37. <%= trending.length %>
  38. </h5>
  39. <h5>
  40. No. of reviews having image:
  41. <% for(var i=0,ll=0; i<trending.length; i++){if (trending[i].images.length>0) ll++} %>
  42. <%= ll %>
  43. </h5>
  44.  
  45.  
  46. </div>
  47.  
  48. <% function rColor(){ %>
  49. <% var colors = ['blue', 'indigo', 'blue-grey', 'deep-purple'] %>
  50. <% var rand = Math.random(), toReturn = '' %>
  51. <% if (rand < .25) {%>
  52. <% toReturn = colors[0] %>
  53. <%} else if ((rand >= .25) && (rand < .5)) {%>
  54. <% toReturn = colors[1] %>
  55. <%} else if ((rand >= .5) && (rand < .75)) {%>
  56. <% toReturn = colors[2] %>
  57. <%} else if ((rand >= .75) && (rand < 1)) {%>
  58. <% toReturn = colors[3] %>
  59. <%} return toReturn %>
  60. <% } %>
  61.  
  62. <h5 class="center black-text"><i class="fa fa-fire red-text text-darken-4"></i>&nbsp;Trending Reviews</h5>
  63. <div class="trending-container">
  64. <div class="owl-carousel owl-theme">
  65.  
  66. <% trending.forEach(review =>{ %>
  67. <% var bg = '', hasImage = false %>
  68. <% if (review.images.length > 0 ) {%>
  69. <% bg = 'style="background:url(\''+review.images[0]+'\')"' %>
  70. <% hasImage = true %>
  71. <%} else {%>
  72. <% bg = rColor() %>
  73. <% hasImage = false %>
  74. <%}%>
  75.  
  76.  
  77. <div class="item card <%= hasImage ? 'card-papa' : '' %>" <%= hasImage ? bg : ''%>>
  78. <div class="card-panel darken-4 <%= !hasImage ? bg : '' %> ">
  79. <strong><%= review.titleReview %></strong>
  80. <a href="#" class="white-text br-author"><%= review.userInfo.username +'(' + review.userInfo.reps + ')' %></a>
  81. <span role="presentation" aria-hidden="true"> · </span>
  82. <a href="" class="white-text tooltipped" data-tooltip="written <%= review.fromNow %>"><i class="fa fa-globe"></i></a>
  83. <div class="right">
  84. <i class="fa fa-eye"></i> 232
  85. <span role="presentation" aria-hidden="true">&middot;</span>
  86. <i class="fa fa-thumbs-up"></i> <%= review.useful.length %>
  87. <span role="presentation" aria-hidden="true">&middot;</span>
  88. <i class="fa fa-thumbs-down"></i> <%= review.notUseful.length %>
  89. </div>
  90. <div class="clearfix"></div>
  91. <span class="browserate" data-rateyo-rating="<%=review.overall%>" data-rateyo-rated-fill="#ff8f00"></span>
  92. <span class="white-text limit-lines"><%= review.reviewText %></span>...
  93. <div class="divider"></div>
  94. <div class="card-action">
  95. <a class="btn btn-flat left indigo-text"><span class="text-lighten-4 amber-text"><%= review.companyName %></span></a>
  96. <a href="#" class="btn btn-flat darken-4 waves-effect waves-dark right white-text">Read</a>
  97. <div class="clearfix"></div>
  98. </div>
  99. </div>
  100. </div>
  101.  
  102. <% }) %>
  103.  
  104.  
  105. </div>
  106. </div>
  107. <script id="jsbin-source-html" type="text/html"> <div class="browse reviews blue-grey lighten-4">
  108. <div class="white black-text">
  109. <p>
  110. <%= JSON.stringify(trending , null, 4)%>
  111. </p>
  112. <h5>
  113. No. of trending reviews overall:
  114. <%= trending.length %>
  115. </h5>
  116. <h5>
  117. No. of reviews having image:
  118. <% for(var i=0,ll=0; i<trending.length; i++){if (trending[i].images.length>0) ll++} %>
  119. <%= ll %>
  120. </h5>
  121.  
  122.  
  123. </div>
  124.  
  125. <% function rColor(){ %>
  126. <% var colors = ['blue', 'indigo', 'blue-grey', 'deep-purple'] %>
  127. <% var rand = Math.random(), toReturn = '' %>
  128. <% if (rand < .25) {%>
  129. <% toReturn = colors[0] %>
  130. <%} else if ((rand >= .25) && (rand < .5)) {%>
  131. <% toReturn = colors[1] %>
  132. <%} else if ((rand >= .5) && (rand < .75)) {%>
  133. <% toReturn = colors[2] %>
  134. <%} else if ((rand >= .75) && (rand < 1)) {%>
  135. <% toReturn = colors[3] %>
  136. <%} return toReturn %>
  137. <% } %>
  138.  
  139. <h5 class="center black-text"><i class="fa fa-fire red-text text-darken-4"></i>&nbsp;Trending Reviews</h5>
  140. <div class="trending-container">
  141. <div class="owl-carousel owl-theme">
  142.  
  143. <% trending.forEach(review =>{ %>
  144. <% var bg = '', hasImage = false %>
  145. <% if (review.images.length > 0 ) {%>
  146. <% bg = 'style="background:url(\''+review.images[0]+'\')"' %>
  147. <% hasImage = true %>
  148. <%} else {%>
  149. <% bg = rColor() %>
  150. <% hasImage = false %>
  151. <%}%>
  152.  
  153.  
  154. <div class="item card <%= hasImage ? 'card-papa' : '' %>" <%= hasImage ? bg : ''%>>
  155. <div class="card-panel darken-4 <%= !hasImage ? bg : '' %> ">
  156. <strong><%= review.titleReview %></strong>
  157. <a href="#" class="white-text br-author"><%= review.userInfo.username +'(' + review.userInfo.reps + ')' %></a>
  158. <span role="presentation" aria-hidden="true"> · </span>
  159. <a href="" class="white-text tooltipped" data-tooltip="written <%= review.fromNow %>"><i class="fa fa-globe"></i></a>
  160. <div class="right">
  161. <i class="fa fa-eye"></i> 232
  162. <span role="presentation" aria-hidden="true">&middot;</span>
  163. <i class="fa fa-thumbs-up"></i> <%= review.useful.length %>
  164. <span role="presentation" aria-hidden="true">&middot;</span>
  165. <i class="fa fa-thumbs-down"></i> <%= review.notUseful.length %>
  166. </div>
  167. <div class="clearfix"></div>
  168. <span class="browserate" data-rateyo-rating="<%=review.overall%>" data-rateyo-rated-fill="#ff8f00"></span>
  169. <span class="white-text limit-lines"><%= review.reviewText %></span>...
  170. <div class="divider"></div>
  171. <div class="card-action">
  172. <a class="btn btn-flat left indigo-text"><span class="text-lighten-4 amber-text"><%= review.companyName %></span></a>
  173. <a href="#" class="btn btn-flat darken-4 waves-effect waves-dark right white-text">Read</a>
  174. <div class="clearfix"></div>
  175. </div>
  176. </div>
  177. </div>
  178.  
  179. <% }) %>
  180.  
  181.  
  182. </div>
  183. </div></script>
  184.  
  185. <script id="jsbin-source-css" type="text/css">.limit-lines {
  186. margin-top: 1.24em !important;
  187. display: block;
  188. /* or inline-block */
  189. text-overflow: ellipsis;
  190. word-wrap: break-word;
  191. overflow: hidden;
  192. max-height: 6em;
  193. line-height: 1.5em;
  194. }
  195.  
  196. .card-papa {
  197. background-position: center center !important;
  198. background-size: cover !important;
  199. background-repeat: no-repeat !important;
  200. }
  201.  
  202. .card-papa .card-panel {
  203. background: rgba(0, 92, 151, .8);
  204. background: -webkit-linear-gradient(to right, rgba(55, 67, 117, .8), rgba(0, 92, 151, .8));
  205. background: linear-gradient(to right, rgba(55, 67, 117, .8), rgba(0, 92, 151, .8));
  206. }
  207.  
  208. .trending-container {
  209. width: 90% !important;
  210. margin: .2em auto;
  211. }
  212. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement