LeftPanel.svelte 936 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <script lang="js">
  2. import {
  3. leftPanelCardId,
  4. leftPanelCardDesc,
  5. } from '../control/left_panel.svelte'
  6. </script>
  7. <div class="left-panel">
  8. <div class="card-preview">
  9. <div class="card-image-large">
  10. {#if $leftPanelCardId}
  11. <img height="100%" src="https://cdn.233.momobako.com/ygopro/pics/{$leftPanelCardId}.jpg" alt="card img">
  12. {/if}
  13. </div>
  14. <div class="card-description">
  15. <pre class="card-desc-text">{$leftPanelCardDesc}</pre>
  16. </div>
  17. </div>
  18. </div>
  19. <style>
  20. .left-panel {
  21. width: 25%;
  22. padding: 20px;
  23. background-color: #f5f5f5;
  24. }
  25. .card-image-large {
  26. height: 400px;
  27. text-align: center;
  28. background-color: #ddd;
  29. margin-bottom: 20px;
  30. border-radius: 8px;
  31. }
  32. .card-description {
  33. line-height: 1.6;
  34. font-size: 14px;
  35. }
  36. .card-desc-text {
  37. white-space: pre-wrap;
  38. word-wrap: break-word;
  39. }
  40. </style>