component.tsx 2.2 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 } = useCompData(props.compId);
  12. return () => (
  13. <div class={cx(rootStyles, "overflow-hidden")}>
  14. <div class="bg flex flex-col"></div>
  15. <div class="relative z-1 overflow-hidden">
  16. <div class="mt-0.4rem h-1.2rem text-30px text-center text_main">
  17. <Text.Component compId={children.title.id} />
  18. </div>
  19. <div class="h-10.22rem mt-10px flex flex-1">
  20. <div class="ml-0.64rem">
  21. <Image.Component
  22. compId={children.img1.id}
  23. class="w-4.5rem h-10.22rem object-cover"
  24. />
  25. </div>
  26. <div class="ml-0.3rem flex flex-col justify-between">
  27. <Image.Component
  28. compId={children.img2.id}
  29. class="w-1.67rem h-3.06rem object-cover"
  30. />
  31. <Image.Component
  32. compId={children.img3.id}
  33. class="w-1.67rem h-2.08rem object-cover"
  34. />
  35. </div>
  36. </div>
  37. </div>
  38. <div class="absolute top-5rem right-1.1rem text-stroke-dark-900 z-2">
  39. <Text.Component compId={children.text1?.id} />
  40. <Text.Component
  41. class="mt-1rem text-right"
  42. compId={children.text2?.id}
  43. />
  44. <div class="line"></div>
  45. </div>
  46. </div>
  47. );
  48. },
  49. });
  50. const rootStyles = css`
  51. .bg {
  52. position: absolute;
  53. width: 100%;
  54. z-index: 0;
  55. height: 9.28rem;
  56. background-image: linear-gradient(to right, #000 59%, #fff 59%);
  57. }
  58. .text_main {
  59. color: #fff;
  60. background-image: linear-gradient(to right, #000 59%, #fff 59%);
  61. font-size: 0.8rem;
  62. span {
  63. color: #fff;
  64. mix-blend-mode: difference;
  65. text-transform: uppercase;
  66. }
  67. }
  68. .line {
  69. height: 1px;
  70. background: linear-gradient(to left, #000 1.2rem, #fff 1.2rem);
  71. }
  72. `;