Admin.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <template>
  2. <div class='admin'>
  3. <div class='admin__menu'>
  4. <div class='admin__menu__item' v-for='route in routes' :class='{ "admin__menu__item--selected" : false }'>
  5. <div>
  6. <span class='fa admin__menu__item__icon' :class='route.icon'></span>
  7. </div>
  8. <div>
  9. <div class='admin__menu__item__title'>
  10. {{route.title}}
  11. </div>
  12. <div class='admin__menu__item__description'>
  13. {{route.description}}
  14. </div>
  15. </div>
  16. </div>
  17. </div>
  18. </div>
  19. </template>
  20. <script>
  21. export default {
  22. name: 'Admin',
  23. data () {
  24. return {
  25. routes: [
  26. { title: 'Dashboard', description: 'Quick links and stats about your forum', icon: 'fa-home' },
  27. { title: 'Moderation', description: 'View and respond to user reports', icon: 'fa-exclamation-circle' },
  28. { title: 'Categories', description: 'Add and remove thread categories', icon: 'fa-th' },
  29. { title: 'Back-up', description: 'Download and restore forum data', icon: 'fa-cloud-download' }
  30. ]
  31. }
  32. }
  33. }
  34. </script>
  35. <style lang='scss' scoped>
  36. @import '../../assets/scss/variables.scss';
  37. .admin {
  38. height: calc(100% + 1rem);
  39. margin-top: -1rem;
  40. @at-root #{&}__menu {
  41. width: 15rem;
  42. height: calc(100%);
  43. background-color: #fff;
  44. cursor: default;
  45. overflow-y: auto;
  46. border-right: thin solid $color__lightgray--darker;
  47. @at-root #{&}__item {
  48. transition: background-color 0.2s;
  49. padding: 1rem;
  50. border-bottom: thin solid $color__lightgray--darker;
  51. display: flex;
  52. flex-direction: row;
  53. position: relative;
  54. &:hover {
  55. background-color: $color__lightgray--primary;
  56. }
  57. &::before {
  58. content: '';
  59. position: absolute;
  60. left: -0.25rem;
  61. top: 0;
  62. width: 0.25rem;
  63. height: 100%;
  64. background-color: $color__gray--darkest;
  65. transition: right 0.2s;
  66. }
  67. @at-root #{&}--selected {
  68. background-color: $color__lightgray--primary;
  69. &::before {
  70. left: 0;
  71. }
  72. }
  73. @at-root #{&}__icon {
  74. margin-right: 0.5rem;
  75. margin-top: 0.1875rem;
  76. }
  77. @at-root #{&}__title {
  78. font-weight: 600;
  79. }
  80. @at-root #{&}__description {
  81. font-size: 0.9rem;
  82. color: $color__text--secondary;
  83. margin-top: 0.125rem;
  84. }
  85. }
  86. }
  87. }
  88. </style>