2
0

my_han_crop.tpl 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <style type="text/css">
  5. .img {
  6. max-height: 27.5%;
  7. /*max-width: 85%;*/
  8. overflow-x: auto;
  9. overflow-y: auto;
  10. border-width: 1px 0 1px 0;
  11. border-style: dashed;
  12. border-color: transparent;
  13. resize: vertical;
  14. position: relative;
  15. }
  16. .img:hover {
  17. border-color: black;
  18. }
  19. .dict {
  20. width: 45vw;
  21. }
  22. .crop_a {
  23. clip-path: inset(0 0 0 15%);
  24. margin-left: -15%;
  25. }
  26. .crop_b {
  27. clip-path: inset(0 15% 0 0);
  28. margin-right: -15%;
  29. }
  30. .word {
  31. width: 10vw;
  32. display: contents;
  33. }
  34. .word-img img{
  35. width: 35vw;
  36. margin: -5px;
  37. }
  38. .result{
  39. max-height: 200vw;
  40. overflow: scroll;
  41. }
  42. /* 默认滚动条样式 */
  43. .img::-webkit-scrollbar {
  44. width: 6px;
  45. height: 6px;
  46. }
  47. .img::-webkit-scrollbar-track {
  48. background: #f1f1f1;
  49. border-radius: 6px;
  50. }
  51. .img:not(:hover)::-webkit-scrollbar-track {
  52. background: transparent;
  53. }
  54. .img::-webkit-scrollbar-thumb {
  55. background: #888;
  56. border-radius: 6px;
  57. transition: all 0.3s ease;
  58. }
  59. .img:not(:hover)::-webkit-scrollbar-thumb {
  60. background: transparent;
  61. border-radius: 6px;
  62. transition: all 0.3s ease;
  63. }
  64. .img::-webkit-scrollbar-thumb:hover {
  65. background: #555;
  66. }
  67. .result::-webkit-scrollbar {
  68. width: 6px;
  69. height: 6px;
  70. }
  71. .result::-webkit-scrollbar-track {
  72. background: #f1f1f1;
  73. border-radius: 6px;
  74. }
  75. .result:not(:hover)::-webkit-scrollbar-track {
  76. background: transparent;
  77. }
  78. .result::-webkit-scrollbar-thumb {
  79. background: #888;
  80. border-radius: 6px;
  81. transition: all 0.3s ease;
  82. }
  83. .result:not(:hover)::-webkit-scrollbar-thumb {
  84. background: transparent;
  85. border-radius: 6px;
  86. transition: all 0.3s ease;
  87. }
  88. .result::-webkit-scrollbar-thumb:hover {
  89. background: #555;
  90. }
  91. .copied {
  92. color: #01955e;
  93. display: none;
  94. position: fixed;
  95. }
  96. </style>
  97. <script>
  98. function copy(text, index) {
  99. navigator.clipboard.writeText(text).then(() => {
  100. show(index);
  101. setTimeout(() => {
  102. hide(index);
  103. }, 2000);
  104. });
  105. }
  106. function show(index) {
  107. let el = document.getElementById("copied-" + index);
  108. el.style.display = "inline-block";
  109. }
  110. function hide(index) {
  111. let el = document.getElementById("copied-" + index);
  112. el.style.display = "none";
  113. }
  114. </script>
  115. </head>
  116. <body>
  117. <h3>Page {{ page }}</h3>
  118. <div style="display: flex">
  119. <div>
  120. {{#dict}}
  121. <div class="img">
  122. <img class="dict crop_{{ index }}" src="{{ img }}" />
  123. </div>
  124. {{/dict}}
  125. </div>
  126. <div>
  127. <table>
  128. {{#words}}
  129. <tr>
  130. <td class="word">{{ index }}</td>
  131. <td class="word">
  132. {{ word }}
  133. <button onclick="copy('{{ word }}',{{ index }})">复制</button>
  134. <span class="copied" id="copied-{{ index }}">已经复制</span>
  135. </td>
  136. <td class="word-img">
  137. <img src="img/{{ word }}.png" />
  138. </td>
  139. </tr>
  140. {{/words}}
  141. </table>
  142. </div>
  143. </div>
  144. </body>
  145. </html>