RelicItem.vue 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <template>
  2. <div
  3. class="relic-item"
  4. :class="{needFlip: !isOdd}"
  5. >
  6. <div class="curvy-wrap">
  7. <div
  8. class="node-point-top"
  9. />
  10. <img
  11. src="@/assets/images/curvy-line.png"
  12. alt=""
  13. class="curvy-line"
  14. >
  15. <div
  16. v-if="isLast"
  17. class="node-point-bottom"
  18. />
  19. </div>
  20. </div>
  21. </template>
  22. <script>
  23. export default {
  24. props: {
  25. isOdd: {
  26. type: Boolean,
  27. required: true,
  28. },
  29. isFirst: {
  30. type: Boolean,
  31. default: false,
  32. },
  33. isLast: {
  34. type: Boolean,
  35. default: false,
  36. },
  37. },
  38. }
  39. </script>
  40. <style lang="less" scoped>
  41. .relic-item {
  42. width: 100%;
  43. height: 17rem;
  44. position: relative;
  45. .curvy-wrap {
  46. position: absolute;
  47. height: 100%;
  48. left: 50%;
  49. transform: translateX(-50%);
  50. .node-point-top {
  51. position: absolute;
  52. left: 0;
  53. top: 0;
  54. transform: translate(-40%, -50%);
  55. width: 1.67rem;
  56. height: 1.67rem;
  57. border-radius: 50%;
  58. background-color: #BC945B;
  59. background-color: red;
  60. }
  61. .curvy-line {
  62. height: 100%;
  63. }
  64. .node-point-bottom {
  65. position: absolute;
  66. right: 0;
  67. bottom: 0;
  68. transform: translate(40%, 50%);
  69. width: 1.67rem;
  70. height: 1.67rem;
  71. border-radius: 50%;
  72. background-color: #BC945B;
  73. }
  74. }
  75. }
  76. .needFlip {
  77. .curvy-wrap {
  78. transform: translateX(-50%) rotateY(180deg);
  79. .curvy-line {
  80. }
  81. }
  82. }
  83. </style>