PlayfulCard.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <template>
  2. <view class="playful-card" :style="cardStyle">
  3. <view class="playful-card__header" v-if="$slots.header">
  4. <slot name="header"></slot>
  5. </view>
  6. <view class="playful-card__content">
  7. <slot></slot>
  8. </view>
  9. <view class="playful-card__actions" v-if="$slots.actions">
  10. <slot name="actions"></slot>
  11. </view>
  12. </view>
  13. </template>
  14. <script>
  15. export default {
  16. name: 'PlayfulCard',
  17. props: {
  18. // simple elevation control (not strictly required with CSS vars)
  19. elevation: { type: Number, default: 1 }
  20. },
  21. computed: {
  22. cardStyle() {
  23. // Optional per-card styling hook; kept simple here
  24. return {};
  25. }
  26. }
  27. }
  28. </script>
  29. <style scoped>
  30. .playful-card {
  31. background: var(--surface, #ffffff);
  32. border: 1px solid var(--border, #e5e7eb);
  33. border-radius: 20px;
  34. padding: 16px;
  35. box-shadow: 0 4px 14px rgba(14, 165, 233, 0.12);
  36. }
  37. .playful-card__header {
  38. font-weight: 700;
  39. font-family: var(--font-display, system-ui, -apple-system, "Noto Sans SC", sans-serif);
  40. font-size: 1.05rem;
  41. margin-bottom: 8px;
  42. }
  43. .playful-card__content {
  44. color: var(--text, #1f2937);
  45. line-height: 1.6;
  46. font-family: var(--font-body, system-ui, -apple-system, "Inter", sans-serif);
  47. }
  48. .playful-card__actions {
  49. margin-top: 12px;
  50. display: flex;
  51. justify-content: flex-end;
  52. gap: 8px;
  53. }
  54. </style>