Simple text editor based on tiptap. HTML format.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

128 lines
3.1 KiB

  1. <template>
  2. <div class="meta-editor">
  3. <div class="meta-editor-content">
  4. <button title="fermer" class="close-btn" v-on:click="hide">
  5. &times;
  6. <!--<svg viewPort="0 0 42 42" version="1.1"-->
  7. <!--xmlns="http://www.w3.org/2000/svg">-->
  8. <!--<line x1="0" y1="42"-->
  9. <!--x2="42" y2="0"-->
  10. <!--stroke="black"-->
  11. <!--stroke-width="1"/>-->
  12. <!--<line x1="0" y1="0"-->
  13. <!--x2="42" y2="42"-->
  14. <!--stroke="black"-->
  15. <!--stroke-width="1"/>-->
  16. <!--</svg>-->
  17. </button>
  18. <h3>Métadonnées</h3>
  19. <div>
  20. <label>Titre</label>
  21. <input type="text" v-model="title"/>
  22. </div>
  23. <div>
  24. <label>Auteur</label>
  25. <input type="text" v-model="author"/>
  26. </div>
  27. <div>
  28. <label>Date</label>
  29. <input type="text" v-model="date"/>
  30. </div>
  31. </div>
  32. </div>
  33. </template>
  34. <script>
  35. export default {
  36. components: {},
  37. data() {
  38. let today = new Date();
  39. return {
  40. title: "Lorem Ipsum",
  41. author: "John Doe",
  42. date: (today.getDate() < 10 ? ('0' + today.getDate()): today.getDate() )
  43. + '/' + (today.getMonth() < 9 ? '0' :'') + (today.getMonth() + 1) + '/' + today.getFullYear()
  44. }
  45. },
  46. beforeDestroy() {
  47. },
  48. mounted() {
  49. },
  50. methods: {
  51. hide: function(){
  52. this.$emit('meta-editor:closed')
  53. }
  54. }
  55. }
  56. </script>
  57. <style lang="scss">
  58. @import '../assets/_vars';
  59. .meta-editor {
  60. width: 100vw;
  61. height: 100vh;
  62. background-color: rgba(100, 100, 100, 0.75);
  63. display: flex;
  64. justify-content: center;
  65. align-items: center;
  66. position: fixed;
  67. top: 0;
  68. left: 0;
  69. z-index: 500;
  70. h3 {
  71. text-align: center;
  72. margin-bottom: 50px;
  73. }
  74. .meta-editor-content {
  75. padding: 10px;
  76. width: 800px;
  77. height: 400px;
  78. background-color: $bg-color;
  79. position: relative;
  80. div {
  81. margin: 5px;
  82. label, input {
  83. display: inline-block;
  84. width: 200px;
  85. }
  86. }
  87. .close-btn {
  88. position: absolute;
  89. top: 5px;
  90. right: 5px;
  91. padding:0;
  92. margin : 0;
  93. border: none;
  94. cursor: pointer;
  95. background-color: $bg-color;
  96. //height: $button-width;
  97. font-size: $button-width;
  98. /*svg{
  99. width: $button-width;
  100. height: 4$button-width;
  101. }*/
  102. }
  103. }
  104. }
  105. </style>