component.tsx 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 { value } = useCompData(props.compId);
  12. return () => (
  13. <div
  14. class={cx(rootStyles, " pl-0.28rem")}
  15. style={{
  16. backgroundImage: `linear-gradient(#fff 1.3rem,${value.themeColor} 1.3rem, ${value.themeColor} 87%, #fff 87%)`,
  17. }}
  18. >
  19. <div class="h-1.3rem">
  20. <Text.Component compId={value.title.id} />
  21. </div>
  22. <Image.Component
  23. compId={value.img1.id}
  24. class="w-6.22rem h-6.22rem object-cover -ml-0.28rem"
  25. />
  26. <div class="absolute right-1rem top-3rem">
  27. <div
  28. class="p-0.08rem pt-1rem border-light-50 border-0.08rem border-top-0.06rem border-solid"
  29. style={{
  30. backgroundColor: value.themeColor,
  31. }}
  32. >
  33. <div class="min-w-1.25rem px-0.1rem bg-light-50">
  34. <Text.Component compId={value.colorText?.id} />
  35. </div>
  36. </div>
  37. </div>
  38. <div class="flex flex-row-reverse mt-0.5rem mb-0.35rem">
  39. <div class="w-4.75rem py-0.55rem bg-light-50 text-center border-dark-200 border-2 border-solid leading-2">
  40. <Text.Component compId={value.text?.id} />
  41. </div>
  42. </div>
  43. <Image.Component
  44. compId={value.img2.id}
  45. class="!absolute bottom-0 left-0 w-4rem h-2.85rem object-cover"
  46. />
  47. </div>
  48. );
  49. },
  50. });
  51. const rootStyles = css`
  52. background-clip: content-box;
  53. `;