NewPosts.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <template>
  2. <div class='widgets__new_post'>
  3. <div class='widgets__new_post__main'>
  4. <template v-if='count'>
  5. {{count}} new {{count | pluralize('post')}}
  6. </template>
  7. <template v-else>
  8. No new posts
  9. </template>
  10. </div>
  11. <div class='widgets__new_post__message'>
  12. <template v-if='change === 0'>
  13. <span class='fa fa-minus'></span>
  14. No change since yesterday
  15. </template>
  16. <template v-else-if='change > 0'>
  17. <span class='fa fa-caret-up'></span>
  18. Up {{change}} since yesterday
  19. </template>
  20. <template v-else>
  21. <span class='fa fa-caret-down'></span>
  22. Down {{Math.abs(change)}} since yesterday
  23. </template>
  24. </div>
  25. </div>
  26. </template>
  27. <script>
  28. export default {
  29. name: 'NewPosts',
  30. data () {
  31. return {
  32. count: 1,
  33. change: -2,
  34. }
  35. }
  36. }
  37. </script>
  38. <style lang='scss' scoped>
  39. @import '../../assets/scss/variables.scss';
  40. .widgets__new_post {
  41. background-color: #3498db;
  42. color: #fff;
  43. width: 100%;
  44. height: 100%;
  45. border-radius: 0.25rem 0.25rem 0 0;
  46. display: flex;
  47. flex-direction: column;
  48. padding: 0.5rem;
  49. align-items: center;
  50. justify-content: center;
  51. @at-root #{&}__main {
  52. font-size: 2.5rem;
  53. font-family: $font--role-emphasis;
  54. }
  55. @at-root #{&}__message {
  56. margin-top: 0.5rem;
  57. span {
  58. margin-right: 0.25rem;
  59. }
  60. }
  61. }
  62. </style>