+page.svelte 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <script>
  2. import logoMark from '$lib/images/logo_white.svg';
  3. let { data } = $props();
  4. </script>
  5. <svelte:head>
  6. <title>Workouts — Torus</title>
  7. </svelte:head>
  8. <div class="page">
  9. <header class="top">
  10. <a class="brand" href="/">
  11. <img class="brand-mark" src={logoMark} alt="" width="28" height="28" />
  12. <span class="brand-name">Torus</span>
  13. </a>
  14. <a class="btn btn-ghost" href="/logout">Log out</a>
  15. </header>
  16. <main>
  17. <section class="panel">
  18. <div class="panel-head">
  19. <div class="panel-copy">
  20. <h1>Workouts</h1>
  21. <p class="lede">Signed in as {data.user.name}. Your sessions will show up here.</p>
  22. </div>
  23. <a class="btn btn-primary new-workout" href="/workout/new">New workout</a>
  24. </div>
  25. </section>
  26. </main>
  27. </div>
  28. <style>
  29. .page {
  30. min-height: 100vh;
  31. display: flex;
  32. flex-direction: column;
  33. }
  34. .top {
  35. display: flex;
  36. align-items: center;
  37. justify-content: space-between;
  38. gap: 16px;
  39. padding: 16px 20px;
  40. border-bottom: 1px solid var(--border);
  41. }
  42. .brand {
  43. display: inline-flex;
  44. align-items: center;
  45. gap: 10px;
  46. font-weight: 700;
  47. letter-spacing: -0.02em;
  48. }
  49. .brand-mark {
  50. display: block;
  51. width: 28px;
  52. height: 28px;
  53. flex-shrink: 0;
  54. }
  55. .brand-name {
  56. font-size: 15px;
  57. }
  58. main {
  59. flex: 1;
  60. width: min(1120px, 100%);
  61. margin: 0 auto;
  62. padding: 40px 20px 64px;
  63. }
  64. .panel {
  65. background: var(--surface);
  66. border: 1px solid var(--border);
  67. border-radius: var(--radius-lg);
  68. padding: 24px;
  69. }
  70. .panel-head {
  71. display: flex;
  72. flex-direction: column;
  73. align-items: flex-start;
  74. gap: 16px;
  75. }
  76. .panel-copy {
  77. min-width: 0;
  78. width: 100%;
  79. }
  80. .new-workout {
  81. flex-shrink: 0;
  82. }
  83. h1 {
  84. margin: 0;
  85. font-size: 1.6rem;
  86. letter-spacing: -0.03em;
  87. font-weight: 750;
  88. }
  89. .lede {
  90. margin: 8px 0 0;
  91. color: var(--text-muted);
  92. line-height: 1.45;
  93. }
  94. @media (min-width: 720px) {
  95. .top {
  96. padding: 16px 28px;
  97. }
  98. main {
  99. padding: 48px 28px 80px;
  100. }
  101. .panel-head {
  102. flex-direction: row;
  103. align-items: center;
  104. justify-content: space-between;
  105. gap: 20px;
  106. }
  107. .panel-copy {
  108. width: auto;
  109. flex: 1;
  110. }
  111. }
  112. </style>