LoaderPage.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template>
  2. <div class="main">
  3. <div class="part">
  4. <span class="greeting bold-font">{{ title }}</span>
  5. <span class="greeting">Добро пожаловать!</span>
  6. <span class="greeting">Поддерживаются форматы: fb2, fb2.zip, html, txt</span>
  7. </div>
  8. <div class="part center">
  9. <el-input ref="input" placeholder="URL книги" v-model="bookUrl">
  10. <el-button slot="append" icon="el-icon-check" @click="submitUrl"></el-button>
  11. </el-input>
  12. <div class="space"></div>
  13. <el-button size="mini" @click="loadFle">
  14. Загрузить файл
  15. </el-button>
  16. </div>
  17. <div class="part bottom">
  18. <span class="bottom-span clickable" @click="openHelp">Справка</span>
  19. <span class="bottom-span">{{ version }}</span>
  20. </div>
  21. </div>
  22. </template>
  23. <script>
  24. //-----------------------------------------------------------------------------
  25. import Vue from 'vue';
  26. import Component from 'vue-class-component';
  27. export default @Component({
  28. })
  29. class LoaderPage extends Vue {
  30. bookUrl = null;
  31. created() {
  32. this.commit = this.$store.commit;
  33. this.dispatch = this.$store.dispatch;
  34. this.config = this.$store.state.config;
  35. }
  36. activated() {
  37. this.$refs.input.focus();
  38. }
  39. get title() {
  40. if (this.config.mode == 'omnireader')
  41. return 'Omni Reader - браузерная онлайн-читалка.';
  42. return 'Универсальная читалка книг и ресурсов интернета.';
  43. }
  44. get version() {
  45. return `v${this.config.version}`;
  46. }
  47. submitUrl() {
  48. if (this.bookUrl)
  49. //loadUrl()
  50. ;
  51. }
  52. loadFle() {
  53. }
  54. openHelp() {
  55. }
  56. keyHook(event) {
  57. //недостатки сторонних ui
  58. if (document.activeElement == this.$refs.input.$refs.input && event.type == 'keyup' && event.key == 'Enter')
  59. this.submitUrl();
  60. }
  61. }
  62. //-----------------------------------------------------------------------------
  63. </script>
  64. <style scoped>
  65. .main {
  66. flex: 1;
  67. display: flex;
  68. flex-direction: column;
  69. }
  70. .part {
  71. flex: 1;
  72. display: flex;
  73. flex-direction: column;
  74. justify-content: center;
  75. align-items: center;
  76. }
  77. .greeting {
  78. font-size: 130%;
  79. line-height: 170%;
  80. }
  81. .bold-font {
  82. font-weight: bold;
  83. }
  84. .clickable {
  85. color: blue;
  86. text-decoration: underline;
  87. cursor: pointer;
  88. }
  89. .center {
  90. justify-content: flex-start;
  91. padding: 0 5px 0 5px;
  92. }
  93. .bottom {
  94. justify-content: flex-end;
  95. }
  96. .bottom-span {
  97. font-size: 70%;
  98. margin-bottom: 10px;
  99. }
  100. .el-input {
  101. max-width: 600px;
  102. }
  103. .space {
  104. height: 20px;
  105. }
  106. </style>