component.tsx 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. import { css, cx } from "@linaria/core";
  2. import { string } from "vue-types";
  3. import { useCompData } from ".";
  4. import { Image, Text } from "../../../basicUI";
  5. import { createUIComp } from "../../../defines/createUIComp";
  6. export const Component = createUIComp({
  7. props: {
  8. compId: string().isRequired,
  9. },
  10. setup(props) {
  11. const { children, value } = useCompData(props.compId);
  12. return () => (
  13. <div class={cx(rootStyles, "pl-0.65rem pr-0.35rem pt-0.3rem text-black")}>
  14. <div class="relative mb-0.4rem flex items-center justify-start">
  15. <Text.Component
  16. compId={children.title}
  17. class="relative -ml-0.1rem z-10 bg-light-50"
  18. />
  19. <div class="absolute left-0 top-1/2 w-5.1rem h-3/2 border-solid border-dark-200 border-1 border-b-0 border-l-0"></div>
  20. </div>
  21. <div
  22. class="relative"
  23. style={{
  24. backgroundImage: `linear-gradient(${value.themeColor} 87%, #fff 87%)`,
  25. }}
  26. >
  27. <div class="absolute left-5.1rem top-3rem z-10 card_color">
  28. <div
  29. class="p-0.08rem pt-1rem border-light-50 border-0.08rem border-top-0.06rem border-solid"
  30. style={{
  31. backgroundColor: value.themeColor,
  32. }}
  33. >
  34. <Text.Component
  35. compId={children.colorText}
  36. class="min-w-1.25rem bg-light-50"
  37. />
  38. </div>
  39. </div>
  40. <Image.Component
  41. compId={children.img1}
  42. class="-ml-0.28rem w-6.22rem h-6.22rem object-cover"
  43. />
  44. <div class="relative flex justify-end mt-0.5rem pb-0.35rem">
  45. <Text.Component
  46. compId={children.text}
  47. class="w-4.75rem py-0.3rem bg-light-50 border-dark-200 border-2 border-solid leading-loose"
  48. />
  49. <Image.Component
  50. compId={children.img2}
  51. class="!absolute bottom-0 left-0 -ml-0.28rem w-4rem h-2.85rem object-cover"
  52. />
  53. </div>
  54. </div>
  55. </div>
  56. );
  57. },
  58. });
  59. const rootStyles = css`
  60. .card_color {
  61. transform: translateX(-50%);
  62. &::before {
  63. content: "";
  64. position: absolute;
  65. right: 50%;
  66. bottom: 100%;
  67. width: 1px;
  68. height: 3rem;
  69. background-color: #fff;
  70. }
  71. }
  72. `;