You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

138 lines
4.2 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <!-- { 'background-image': 'linear-gradient(rgba(0, 0, 0, 0.3),rgba(0, 0, 0, 0.3)),url(' + banner + ')' } 設置透明度-->
  3. <div
  4. class="hero tw-flex tw-justify-start tw-px-[16px] tw-pt-[60px] tw-pb-[40px] md:tw-pt-[140px] xl:tw-pt-[165px] xl:tw-pb-[150px]"
  5. :style="{ 'background-image': banner ? 'url(' + banner + ')' : 'linear-gradient(rgba(0, 0, 0, 0.3),rgba(0, 0, 0, 0.3)),url(' + banner + ')' }">
  6. <div
  7. class="tw-flex tw-items-center tw-text-transparent xl:tw-px-[30px] xl:tw-w-full xl:tw-max-w-[1366px] xl:tw-mx-auto">
  8. <div class="tw-w-full tw-px-0 tw-flex- tw-flex-col tw-items-start">
  9. <div :class="['tw-mx-0']">
  10. <div class="tw-p-0">
  11. <div class="logo-title tw-text-[#504f4f] tw-font-medium t24 md:t28 tw-font-normal md:tw-text-[36px] xl:tw-text-[48px]">
  12. {{ slogan }}
  13. </div>
  14. </div>
  15. </div>
  16. <!-- <div class="t20 tw-font-normal tw-text-[#504f4f] tw-mt-[10px] tw-hidden xl:tw-block">
  17. {{ subslogan }}
  18. </div> -->
  19. <Search class="tw-mt-[8px] xl:tw-mt-[16px]"
  20. :width="WindowWidth > 960 ? '760' : WindowWidth > 600 ? '382' : '345'"
  21. :height="WindowWidth > 960 ? '60' : WindowWidth > 600 ? '48' : '40'"
  22. :exhibitionsSearchs="exhibitionsSearchs"
  23. :exhibitionsLocations="exhibitionsLocations" :exhibitionsCategories="exhibitionsCategories"
  24. :exhibitionListIcon="exhibitionListIcon" :populars="populars"
  25. :exhibitionsKeywords="exhibitionsKeywords" :type="type" @type="type=$event" />
  26. <div v-if="type=='exhibition'" class="keep-width xl:tw-block">
  27. <v-btn depressed class="neutrals--text text--darken-4 neutrals darken-1 border-radius-12 text-capitalize mx-1 tw-mt-[8px] xl:tw-mt-[16px]"
  28. style="opacity: 0.8" v-for="popular in populars.search" :key="popular">
  29. <nuxt-link :to="localePath(`/exhibition?q=${popular}`)" class="remove-underline">
  30. {{ popular }}
  31. </nuxt-link>
  32. </v-btn>
  33. </div>
  34. <!-- <div v-if="type=='service'" :class="['tw-w-[60%] keep-width tw-hidden xl:tw-block xl:tw-mt-[16px]']">
  35. <v-btn depressed class="neutrals--text text--darken-4 neutrals darken-1 border-radius-12 text-capitalize mx-1"
  36. style="opacity: 0.8" v-for="popular in populars.service" :key="popular">
  37. <nuxt-link :to="localePath(`/service?q=${popular}`)" class="remove-underline">
  38. {{ popular }}
  39. </nuxt-link>
  40. </v-btn>
  41. </div> -->
  42. </div>
  43. </div>
  44. </div>
  45. </template>
  46. <script>
  47. import Search from "~/components/home/Search.vue";
  48. export default {
  49. components: {
  50. Search,
  51. },
  52. props: [
  53. "slogan",
  54. "subslogan",
  55. "populars",
  56. "servicesSearchs",
  57. "servicesLocations",
  58. "serviceKeywords",
  59. "exhibitionsSearchs",
  60. "exhibitionsLocations",
  61. "exhibitionsCategories",
  62. "exhibitionsKeywords",
  63. "banner",
  64. ],
  65. data() {
  66. return {
  67. type: 'exhibition',
  68. service: false,
  69. exhibition: false,
  70. WindowWidth: undefined,
  71. exhibitionListIcon: [
  72. "rawMaterial",
  73. "aeroSpace",
  74. "energy",
  75. "autoMobile",
  76. "electronics",
  77. "contrucstion",
  78. "security",
  79. "Machinary",
  80. "Medical",
  81. "education",
  82. "textile",
  83. "food",
  84. "entertainment",
  85. "consumer",
  86. "others",
  87. ],
  88. };
  89. },
  90. mounted() {
  91. this.$nextTick(() => {
  92. window.addEventListener("resize", this.onResize);
  93. });
  94. },
  95. beforeDestroy() {
  96. window.removeEventListener("resize", this.onResize);
  97. },
  98. created() {
  99. if (process.client) {
  100. this.WindowWidth = window.innerWidth;
  101. }
  102. },
  103. methods: {
  104. onResize() {
  105. if (process.client) {
  106. this.WindowWidth = window.innerWidth;
  107. }
  108. },
  109. },
  110. };
  111. </script>
  112. <style lang="scss" scoped>
  113. .hero {
  114. position: relative;
  115. background-repeat: no-repeat, no-repeat;
  116. background-size: cover, cover;
  117. background-position: center, center;
  118. // filter: brightness(.7);
  119. }
  120. .hero-content {
  121. position: absolute;
  122. width: 100%;
  123. top: 30%;
  124. left: 5%;
  125. }
  126. .hero-content-wrapper {
  127. position: absolute;
  128. top: 0;
  129. width: 100%;
  130. height: 100%;
  131. }
  132. </style>