my_han_crop.tpl 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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. }
  33. .word-img {
  34. width: 45vw;
  35. }
  36. /* 默认滚动条样式 */
  37. .img::-webkit-scrollbar {
  38. width: 6px;
  39. height: 6px;
  40. }
  41. .img::-webkit-scrollbar-track {
  42. background: #f1f1f1;
  43. border-radius: 6px;
  44. }
  45. .img:not(:hover)::-webkit-scrollbar-track {
  46. background: transparent;
  47. }
  48. .img::-webkit-scrollbar-thumb {
  49. background: #888;
  50. border-radius: 6px;
  51. transition: all 0.3s ease;
  52. }
  53. .img:not(:hover)::-webkit-scrollbar-thumb {
  54. background: transparent;
  55. border-radius: 6px;
  56. transition: all 0.3s ease;
  57. }
  58. .img::-webkit-scrollbar-thumb:hover {
  59. background: #555;
  60. }
  61. </style>
  62. <script>
  63. function copy(text) {
  64. navigator.clipboard.writeText(text).then(() => {
  65. alert(text + " 已经拷贝到剪贴板");
  66. });
  67. }
  68. </script>
  69. </head>
  70. <body>
  71. <h3>Page {{ page }}</h3>
  72. <div style="display: flex">
  73. <div>
  74. {{#dict}}
  75. <div class="img">
  76. <img class="dict crop_{{ index }}" src="{{ img }}" />
  77. </div>
  78. {{/dict}}
  79. </div>
  80. <div>
  81. <table>
  82. {{#words}}
  83. <tr>
  84. <td class="word">{{ index }}</td>
  85. <td class="word">
  86. {{ word }}
  87. <button onclick="copy('{{ word }}')">复制</button>
  88. </td>
  89. <td class="word-img">
  90. <img src="img/{{ word }}.png" />
  91. </td>
  92. </tr>
  93. {{/words}}
  94. </table>
  95. </div>
  96. </div>
  97. </body>
  98. </html>