left_panel.svelte 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <script lang="js">
  2. import {
  3. leftPanelCardId,
  4. leftPanelCardDesc,
  5. } from '../left_panel';
  6. import { cardImageUrl } from '../utils';
  7. </script>
  8. <div class="left-panel">
  9. <div class="card-preview">
  10. <div class="card-image-large">
  11. {#if $leftPanelCardId}
  12. <img height="100%" src={cardImageUrl($leftPanelCardId)} alt="card img">
  13. {/if}
  14. </div>
  15. <div class="card-description">
  16. <pre class="card-desc-text">{$leftPanelCardDesc}</pre>
  17. <div style="height:3em;line-height:1.0;overflow:hidden;">
  18. <div style="break-inside:avoid;"><p style="text-align:center;"><small>
  19. <a class="link" href="https://github.com/mistivia/ygo-deck-builder">GitHub</a>
  20. <br>关注 <a class="link" href="https://mistivia.com">Mistivia</a> 谢谢喵~
  21. </small></p></div>
  22. </div>
  23. </div>
  24. </div>
  25. </div>
  26. <style>
  27. .left-panel {
  28. width: 25%;
  29. padding: 2vh 20px;
  30. background-color: #f5f5f5;
  31. }
  32. .card-image-large {
  33. height: 40vh;
  34. text-align: center;
  35. background-color: #ddd;
  36. margin-bottom: 20px;
  37. border-radius: 8px;
  38. }
  39. .card-description {
  40. line-height: 1.4;
  41. font-size: 14px;
  42. height: 50vh;
  43. }
  44. .card-desc-text {
  45. height: calc(50vh - 3em);
  46. white-space: pre-wrap;
  47. word-wrap: break-word;
  48. overflow: auto;
  49. }
  50. a.link {
  51. color: #000000; /* 文本颜色设置为黑色 */
  52. text-decoration: underline; /* 添加下划线 */
  53. cursor: pointer; /* 鼠标悬停时显示手形指针 */
  54. }
  55. a.link:visited {
  56. color: #000000; /* 已访问链接颜色保持黑色 */
  57. }
  58. a.link:hover {
  59. color: #000000; /* 悬停时颜色不变 */
  60. text-decoration: underline; /* 悬停时保持下划线 */
  61. }
  62. a.link:active {
  63. color: #000000; /* 点击时颜色不变 */
  64. }
  65. </style>