editor-modal-media.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <template lang='pug'>
  2. v-card.editor-modal-media.animated.fadeInLeft(flat, tile)
  3. v-container.pa-3(grid-list-lg, fluid)
  4. v-layout(row, wrap)
  5. v-flex(xs9)
  6. v-card.radius-7.animated.fadeInLeft.wait-p1s(light)
  7. v-card-text
  8. .d-flex
  9. v-toolbar.radius-7(color='teal lighten-5', dense, flat, height='44')
  10. .body-2.teal--text Images
  11. v-btn.ml-3.my-0.radius-7(outline, large, color='teal', disabled)
  12. v-icon(left) keyboard_backspace
  13. span Parent Folder
  14. v-btn.my-0.radius-7(outline, large, color='teal')
  15. v-icon(left) add
  16. span New Folder
  17. v-list.mt-3(dense, two-line)
  18. template(v-for='(item, idx) of [1,2,3,4,5,6,7,8,9,10]')
  19. v-list-tile(@click='')
  20. v-list-tile-avatar
  21. v-avatar.radius-7(color='teal', tile)
  22. v-icon(dark) image
  23. v-list-tile-content
  24. v-list-tile-title Image {{item}}
  25. v-list-tile-sub-title 1024x768, 10 KBs
  26. v-list-tile-action
  27. .caption.pr-3 2019-04-07
  28. v-list-tile-action
  29. v-chip.teal--text(label, small, color='teal lighten-5') JPG
  30. v-divider(v-if='idx < 10 - 1')
  31. .d-flex.mt-3
  32. v-toolbar.radius-7(flat, color='grey lighten-4', dense, height='44')
  33. .body-2 / universe
  34. v-spacer
  35. .body-1.grey--text.text--darken-1 10 files
  36. v-btn.ml-3.my-0.radius-7(color='teal', large, @click='insert', disabled)
  37. v-icon(left) save_alt
  38. span Insert
  39. v-flex(xs3)
  40. v-card.radius-7.animated.fadeInRight.wait-p3s(light)
  41. v-card-text
  42. v-toolbar.radius-7(color='teal lighten-5', dense, flat)
  43. v-icon.mr-3(color='teal') cloud_upload
  44. .body-2.teal--text Upload Images
  45. file-pond.mt-3(
  46. name='mediaUpload'
  47. ref='pond'
  48. label-idle='Browse or Drop files here...'
  49. allow-multiple='true'
  50. accepted-file-types='image/jpeg, image/png'
  51. :files='files'
  52. )
  53. v-divider
  54. v-card-actions.pa-3
  55. .caption.grey--text.text-darken-2 Max 20 files, 5 MB each
  56. v-spacer
  57. v-btn(color='teal', dark) Upload
  58. v-card.mt-3.radius-7.animated.fadeInRight.wait-p4s(light)
  59. v-card-text.pb-0
  60. v-toolbar.radius-7(color='teal lighten-5', dense, flat)
  61. v-icon.mr-3(color='teal') cloud_download
  62. .body-2.teal--text Fetch Remote Image
  63. v-text-field.mt-3(
  64. v-model='remoteImageUrl'
  65. outline
  66. single-line
  67. background-color='grey lighten-2'
  68. placeholder='https://example.com/image.jpg'
  69. )
  70. v-divider
  71. v-card-actions.pa-3
  72. .caption.grey--text.text-darken-2 Max 5 MB
  73. v-spacer
  74. v-btn(color='teal', dark) Fetch
  75. v-card.mt-3.radius-7.animated.fadeInRight.wait-p4s(light)
  76. v-card-text.pb-0
  77. v-toolbar.radius-7(color='teal lighten-5', dense, flat)
  78. v-icon.mr-3(color='teal') format_align_left
  79. .body-2.teal--text Alignment
  80. v-select.mt-3(
  81. v-model='imageAlignment'
  82. :items='imageAlignments'
  83. outline
  84. single-line
  85. background-color='grey lighten-2'
  86. placeholder='None'
  87. )
  88. </template>
  89. <script>
  90. // import _ from 'lodash'
  91. import { sync } from 'vuex-pathify'
  92. import vueFilePond from 'vue-filepond'
  93. import 'filepond/dist/filepond.min.css'
  94. import 'filepond-plugin-image-preview/dist/filepond-plugin-image-preview.min.css'
  95. import FilePondPluginFileValidateType from 'filepond-plugin-file-validate-type'
  96. import FilePondPluginImagePreview from 'filepond-plugin-image-preview'
  97. const FilePond = vueFilePond(FilePondPluginFileValidateType, FilePondPluginImagePreview)
  98. export default {
  99. components: {
  100. FilePond
  101. },
  102. props: {
  103. value: {
  104. type: Boolean,
  105. default: false
  106. }
  107. },
  108. data() {
  109. return {
  110. files: [],
  111. remoteImageUrl: '',
  112. imageAlignments: [
  113. { text: 'None', value: '' },
  114. { text: 'Centered', value: 'center' },
  115. { text: 'Right', value: 'right' },
  116. { text: 'Absolute Top Right', value: 'abstopright' }
  117. ],
  118. imageAlignment: ''
  119. }
  120. },
  121. computed: {
  122. isShown: {
  123. get() { return this.value },
  124. set(val) { this.$emit('input', val) }
  125. },
  126. activeModal: sync('editor/activeModal')
  127. },
  128. methods: {
  129. insert () {
  130. this.activeModal = ''
  131. }
  132. }
  133. }
  134. </script>
  135. <style lang='scss'>
  136. .editor-modal-media {
  137. position: fixed;
  138. top: 112px;
  139. left: 64px;
  140. z-index: 10;
  141. width: calc(100vw - 64px - 17px);
  142. height: calc(100vh - 112px - 24px);
  143. background-color: rgba(darken(mc('grey', '900'), 3%), .9) !important;
  144. }
  145. </style>