jeawin-astro 3.0.35 → 3.0.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jeawin-astro",
3
- "version": "3.0.35",
3
+ "version": "3.0.36",
4
4
  "author": "chaegumi <chaegumi@qq.com>",
5
5
  "description": "",
6
6
  "license": "MIT",
@@ -16,16 +16,18 @@ import JeawinApi from "../scripts/cms.js";
16
16
  import Button from "./button.astro";
17
17
  interface Props {
18
18
  tag_name?: string;
19
- style_class?: any;
19
+ style_class?: any; // 包围banner滚动组件的元素class
20
20
  show_title?: boolean;
21
+ slide_class?: any; // 滚动项的元素class
21
22
  }
22
23
 
23
24
  const {url_suffix} = Astro.locals;
24
25
 
25
- const { tag_name, style_class, show_title = false } = Astro.props;
26
+ const { tag_name, style_class, show_title = false,slide_class } = Astro.props;
26
27
 
27
28
  const TagName = tag_name || "section";
28
29
  let StyleClass: any = [];
30
+ let SlideClass: any= [];
29
31
  if (style_class) {
30
32
  if (_.isArray(style_class)) {
31
33
  StyleClass = style_class;
@@ -33,6 +35,13 @@ if (style_class) {
33
35
  StyleClass = _.split(style_class, " ");
34
36
  }
35
37
  }
38
+ if(slide_class){
39
+ if(_.isArray(slide_class)){
40
+ SlideClass = slide_class;
41
+ }else if(_.isString(slide_class)){
42
+ SlideClass = _.split(slide_class, " ");
43
+ }
44
+ }
36
45
 
37
46
  const { jeawin_apikey, jeawin_api_domain, jeawin_api_path, all_langs, base } = Astro.locals;
38
47
  const jeawinapi = new JeawinApi({
@@ -59,24 +68,24 @@ const banners = await jeawinapi.get_nodes({ channel_id: 5 });
59
68
  >
60
69
  {banners.nodes &&
61
70
  banners.nodes.map((banner: any, idx: number) => (
62
- <swiper-slide class:list={["swiper-slide", { hidden: idx > 0 }]}>
71
+ <swiper-slide class:list={["swiper-slide", SlideClass, { hidden: idx > 0 }]}>
63
72
  {show_title && render_value(banner, 'show_text_block', '1') == '1' ? (
64
73
  <div class="relative h-full w-full">
65
- <div class="absolute inset-0 flex items-center justify-center text-white text-center p-4">
66
- <div class="p-2 bg-[rgba(0,0,0,0.5)]">
67
- {
68
- idx > 0 ? (
69
- <div class="text-base md:text-3xl lg:text-4xl">{banner.node_title}</div>
70
- ) : (
71
- <h1 class="text-base md:text-3xl lg:text-4xl">{banner.node_title}</h1>
72
- )
73
- }
74
- <div class="text-xs line-clamp-2 md:line-clamp-none md:text-lg md:mt-4">{render_value(banner, 'sub_title')}</div>
75
- <Button tag_name="a" class="inline-block md:mt-2" href={render_url(render_value(banner, "linkurl"), base, null, url_suffix)}
76
- title={render_value(banner, 'btntext') || render_value(all_langs, 'read more')}>{render_value(banner, 'btntext') || render_value(all_langs, 'read more')}</Button>
74
+ <div class="absolute inset-0 flex items-center justify-center text-white text-center p-4">
75
+ <div class="p-2 bg-[rgba(0,0,0,0.5)]">
76
+ {
77
+ idx > 0 ? (
78
+ <div class="text-base md:text-3xl lg:text-4xl">{banner.node_title}</div>
79
+ ) : (
80
+ <h1 class="text-base md:text-3xl lg:text-4xl">{banner.node_title}</h1>
81
+ )
82
+ }
83
+ <div class="text-xs line-clamp-2 md:line-clamp-none md:text-lg md:mt-4">{render_value(banner, 'sub_title')}</div>
84
+ <Button tag_name="a" class="inline-block md:mt-2" href={render_url(render_value(banner, "linkurl"), base, null, url_suffix)}
85
+ title={render_value(banner, 'btntext') || render_value(all_langs, 'read more')}>{render_value(banner, 'btntext') || render_value(all_langs, 'read more')}</Button>
86
+ </div>
87
+
77
88
  </div>
78
-
79
- </div>
80
89
 
81
90
  {idx > 0 ? (
82
91
  <Fragment
@@ -168,13 +168,13 @@ if (Astro.slots.has("default")) {
168
168
  type="button"
169
169
  disabled="disabled"
170
170
  aria-label="prev"
171
- class="scrollToLeftBtn size-9 border transition grid-center data-[icon]:*:size-6 bg-slate-100 border-slate-200 text-slate-900 hover:enabled:border-slate-400 hover:enabled:bg-slate-300 disabled:text-slate-400"
171
+ class="cursor-pointer scrollToLeftBtn size-9 border transition grid-center data-[icon]:*:size-6 bg-slate-100 border-slate-200 text-slate-900 hover:enabled:border-slate-400 hover:enabled:bg-slate-300 disabled:text-slate-400"
172
172
  ><Icon name="fa6-solid:arrow-left" class="mx-auto" /></button
173
173
  >
174
174
  <button
175
175
  type="button"
176
176
  aria-label="next"
177
- class="scrollToRightBtn size-9 border transition grid-center data-[icon]:*:size-6 bg-slate-100 border-slate-200 text-slate-900 hover:enabled:border-slate-400 hover:enabled:bg-slate-300 disabled:text-slate-400"
177
+ class="cursor-pointer scrollToRightBtn size-9 border transition grid-center data-[icon]:*:size-6 bg-slate-100 border-slate-200 text-slate-900 hover:enabled:border-slate-400 hover:enabled:bg-slate-300 disabled:text-slate-400"
178
178
  ><Icon name="fa6-solid:arrow-right" class="mx-auto" /></button
179
179
  >
180
180
  </div>
@@ -117,6 +117,7 @@ const { siteinfo, all_langs, jeawin_form_api_domain } = Astro.locals;
117
117
  .btn {
118
118
  display: inline-block;
119
119
  padding: 6px 12px;
120
+ cursor: pointer;
120
121
  }
121
122
  .btn-primary {
122
123
  color: white;
@@ -121,7 +121,7 @@ const { node_title, nodepics = [], video, view360 } = Astro.props;
121
121
  <div class="flex min-h-[343px] xl:min-h-[605px] w-full">
122
122
  <img src={video.poster} alt={video.title ? video.title : node_title} />
123
123
  <button
124
- class="absolute w-16 h-16 rounded-full inset-0 m-auto duration-150 bg-blue-500 hover:bg-blue-600 ring-offset-2 focus:ring-3 focus:ring-blue-500 text-white"
124
+ class="absolute cursor-pointer w-16 h-16 rounded-full inset-0 m-auto duration-150 bg-blue-500 hover:bg-blue-600 ring-offset-2 focus:ring-3 focus:ring-blue-500 text-white"
125
125
  x-on:click="openVideo()"
126
126
  >
127
127
  <svg
@@ -37,7 +37,7 @@ const newArr = _.chunk(block_items, 2);
37
37
  <div class="accordion bg-white shadow-[0_2px_10px_-3px_rgba(6,81,237,0.3)] rounded-lg">
38
38
  <button
39
39
  type="button"
40
- class="toggle-button p-6 w-full text-base text-left text-gray-800 flex items-center"
40
+ class="cursor-pointer toggle-button p-6 w-full text-base text-left text-gray-800 flex items-center"
41
41
  >
42
42
  <span class="mr-4">{item.title}</span>
43
43
  <svg
@@ -53,7 +53,7 @@ for (const item of block_items) {
53
53
  />
54
54
  <button
55
55
  type="submit"
56
- class="focus:ring-2 focus:ring-offset-2 text-gray-600 focus:text-indigo-700 focus:rounded-full focus:bg-gray-100 focus:ring-indigo-700 bg-white focus:outline-hidden absolute right-0 top-0 mt-5 mr-4"
56
+ class="cursor-pointer focus:ring-2 focus:ring-offset-2 text-gray-600 focus:text-indigo-700 focus:rounded-full focus:bg-gray-100 focus:ring-indigo-700 bg-white focus:outline-hidden absolute right-0 top-0 mt-5 mr-4"
57
57
  >
58
58
  <Icon name="fa6-solid:magnifying-glass" class="h-4 w-4" />
59
59
  </button>
@@ -30,7 +30,7 @@ const {
30
30
  <button
31
31
  type="button"
32
32
  class:list={[
33
- "toggle-button w-full text-base outline-hidden text-left font-semibold py-6",
33
+ "cursor-pointer toggle-button w-full text-base outline-hidden text-left font-semibold py-6",
34
34
  { "text-blue-600": idx == 0 },
35
35
  { "text-gray-800": idx > 0 },
36
36
  "hover:text-blue-600 flex items-center",
@@ -59,6 +59,7 @@ const {
59
59
  <button
60
60
  type="button"
61
61
  :class={`{
62
+ 'cursor-pointer':true,
62
63
  'bg-gray-100':activeTabIndex==${idx},
63
64
  'hover:border-transparent':activeTabIndex==${idx},
64
65
  'w-full':true,
@@ -95,7 +95,7 @@ const submitbuttontext = render_value(all_langs, "send message");
95
95
  <button
96
96
  type="submit"
97
97
  id={`submitbtn${form_id}`}
98
- class:list={btn_class}
98
+ class:list={['cursor-pointer',btn_class]}
99
99
  >
100
100
  {forminfo.submit_button_text || submitbuttontext}
101
101
  </button>
@@ -26,7 +26,7 @@ import { Icon } from "astro-icon/components";
26
26
  />
27
27
  <button
28
28
  type="submit"
29
- class="absolute right-2 top-2 h-6 w-6 fill-slate-400"
29
+ class="cursor-pointer absolute right-2 top-2 h-6 w-6 fill-slate-400"
30
30
  ><Icon name="fa6-solid:magnifying-glass" /></button
31
31
  >
32
32
  </div>
@@ -63,7 +63,7 @@ const BlockTitleTag = block_title_tag;
63
63
  <button
64
64
  type="submit"
65
65
  id="submitbtnsubscribe"
66
- class="flex items-center justify-center gap-x-2 py-2.5 px-4 mt-3 w-full text-sm text-white font-medium bg-sky-500 hover:bg-sky-400 active:bg-sky-600 duration-150 rounded-lg sm:mt-0 sm:w-auto"
66
+ class="cursor-pointer flex items-center justify-center gap-x-2 py-2.5 px-4 mt-3 w-full text-sm text-white font-medium bg-sky-500 hover:bg-sky-400 active:bg-sky-600 duration-150 rounded-lg sm:mt-0 sm:w-auto"
67
67
  >
68
68
  {render_value(all_langs, "Subscribe")}
69
69
  <Icon name="fa6-solid:arrow-right" />
@@ -72,7 +72,7 @@ const BlockTitleTag = block_title_tag;
72
72
  <button
73
73
  type="submit"
74
74
  id="submitbtnsubscribe"
75
- class="outline-hidden bg-gray-700 text-white text-center px-4 py-3 rounded-md shadow-sm w-full ring-offset-2 ring-gray-700 focus:ring-2 sm:w-auto"
75
+ class="cursor-pointer outline-hidden bg-gray-700 text-white text-center px-4 py-3 rounded-md shadow-sm w-full ring-offset-2 ring-gray-700 focus:ring-2 sm:w-auto"
76
76
  >
77
77
  {render_value(all_langs, "Subscribe")}
78
78
  </button>
@@ -105,7 +105,7 @@ const {base, url_suffix} = Astro.locals;
105
105
  {
106
106
  video_html ? (
107
107
  <button
108
- class="absolute w-16 h-16 rounded-full inset-0 m-auto duration-150 bg-blue-500 hover:bg-blue-600 ring-offset-2 focus:ring-3 focus:ring-blue-500 text-white"
108
+ class="cursor-pointer absolute w-16 h-16 rounded-full inset-0 m-auto duration-150 bg-blue-500 hover:bg-blue-600 ring-offset-2 focus:ring-3 focus:ring-blue-500 text-white"
109
109
  x-on:click="openVideo()"
110
110
  >
111
111
  <svg
@@ -134,7 +134,7 @@ const {base, url_suffix} = Astro.locals;
134
134
  ></div>
135
135
  <div class="px-4 relative">
136
136
  <button
137
- class="w-12 h-12 mb-5 rounded-full duration-150 bg-gray-800 hover:bg-gray-700 text-white"
137
+ class="cursor-pointer w-12 h-12 mb-5 rounded-full duration-150 bg-gray-800 hover:bg-gray-700 text-white"
138
138
  x-on:click="closeVideo()"
139
139
  >
140
140
  <svg
@@ -40,7 +40,7 @@ const {other_btn_class} = Astro.props;
40
40
  <button
41
41
  type="submit"
42
42
  id="submitbtnsubscribe"
43
- class:list={["break-keep", ...btn_class, other_btn_class ? other_btn_class : null]}
43
+ class:list={["break-keep cursor-pointer", ...btn_class, other_btn_class ? other_btn_class : null]}
44
44
  >{render_value(all_langs, "Subscribe")}</button
45
45
  >
46
46
  </div>
@@ -57,7 +57,7 @@ const { btn_class, siteinfo, jeawin_form_api_domain, all_langs } = Astro.locals;
57
57
  <button
58
58
  type="submit"
59
59
  id="submitbtnsubscribe"
60
- class="break-keep p-2 px-3 rounded-lg font-medium text-white bg-blue-600 hover:bg-blue-500 active:bg-blue-700 duration-150 outline-hidden shadow-md focus:shadow-none sm:px-4"
60
+ class="cursor-pointer break-keep p-2 px-3 rounded-lg font-medium text-white bg-blue-600 hover:bg-blue-500 active:bg-blue-700 duration-150 outline-hidden shadow-md focus:shadow-none sm:px-4"
61
61
  >
62
62
  {render_value(all_langs, "Subscribe")}
63
63
  </button>
@@ -59,7 +59,7 @@ const { btn_class, siteinfo, jeawin_form_api_domain, all_langs } = Astro.locals;
59
59
  <button
60
60
  type="submit"
61
61
  id="submitbtnsubscribe"
62
- class="break-keep w-full mt-3 px-5 py-3 rounded-md text-white bg-[var(--themeColor600)] hover:bg-[var(--themeColor500)] active:bg-[var(--themeColor700)] duration-150 outline-hidden shadow-md focus:shadow-none focus:ring-2 ring-offset-2 ring-indigo-600 sm:mt-0 sm:ml-3 sm:w-auto"
62
+ class="cursor-pointer break-keep w-full mt-3 px-5 py-3 rounded-md text-white bg-[var(--themeColor600)] hover:bg-[var(--themeColor500)] active:bg-[var(--themeColor700)] duration-150 outline-hidden shadow-md focus:shadow-none focus:ring-2 ring-offset-2 ring-indigo-600 sm:mt-0 sm:ml-3 sm:w-auto"
63
63
  >
64
64
  {render_value(all_langs, "Subscribe")}
65
65
  </button>
@@ -74,7 +74,7 @@ const { btn_class, siteinfo, jeawin_form_api_domain, all_langs } = Astro.locals;
74
74
  <button
75
75
  type="submit"
76
76
  id="submitbtnsubscribe"
77
- class="break-keep block w-full py-3 px-4 font-medium text-sm text-center text-white bg-[var(--themeColor600)] hover:bg-[var(--themeColor500)] active:bg-[var(--themeColor700)] active:shadow-none rounded-lg shadow-sm sm:w-auto md:w-full"
77
+ class="cursor-pointer break-keep block w-full py-3 px-4 font-medium text-sm text-center text-white bg-[var(--themeColor600)] hover:bg-[var(--themeColor500)] active:bg-[var(--themeColor700)] active:shadow-none rounded-lg shadow-sm sm:w-auto md:w-full"
78
78
  >
79
79
  {render_value(all_langs, "Subscribe")}
80
80
  </button>
@@ -72,7 +72,7 @@ const { btn_class, siteinfo, jeawin_form_api_domain, all_langs } = Astro.locals;
72
72
  <button
73
73
  type="submit"
74
74
  id="submitbtnsubscribe"
75
- class="break-keep block w-auto py-3 px-4 font-medium text-sm text-center text-white bg-[var(--themeColor600)] hover:bg-[var(--themeColor500)] active:bg-[var(--themeColor700)] active:shadow-none rounded-lg shadow"
75
+ class="cursor-pointer break-keep block w-auto py-3 px-4 font-medium text-sm text-center text-white bg-[var(--themeColor600)] hover:bg-[var(--themeColor500)] active:bg-[var(--themeColor700)] active:shadow-none rounded-lg shadow"
76
76
  >
77
77
  {render_value(all_langs, "Subscribe")}
78
78
  </button>
@@ -67,7 +67,7 @@ const { btn_class, siteinfo, jeawin_form_api_domain, all_langs } = Astro.locals;
67
67
  <button
68
68
  type="submit"
69
69
  id="submitbtnsubscribe"
70
- class="break-keep block w-auto py-3 px-4 font-medium text-sm text-center text-white bg-[var(--themeColor600)] hover:bg-[var(--themeColor500)] active:bg-[var(--themeColor700)] active:shadow-none rounded-lg shadow"
70
+ class="cursor-pointer break-keep block w-auto py-3 px-4 font-medium text-sm text-center text-white bg-[var(--themeColor600)] hover:bg-[var(--themeColor500)] active:bg-[var(--themeColor700)] active:shadow-none rounded-lg shadow"
71
71
  >
72
72
  {render_value(all_langs, "Subscribe")}
73
73
  </button>
@@ -71,7 +71,7 @@ const { btn_class, siteinfo, jeawin_form_api_domain, all_langs } = Astro.locals;
71
71
  class="text-gray-500 w-full p-3 rounded-md border border-gray-200 outline-hidden focus:border-[var(--themeColor600)]"
72
72
  />
73
73
  <button
74
- class="break-keep w-full mt-3 px-5 py-3 rounded-md text-white bg-[var(--themeColor600)] hover:bg-[var(--themeColor500)] active:bg-[var(--themeColor700)] duration-150 outline-hidden shadow-md focus:shadow-none focus:ring-2 ring-offset-2 ring-[var(--themeColor600)] sm:mt-0 sm:ml-3 sm:w-auto"
74
+ class="cursor-pointer break-keep w-full mt-3 px-5 py-3 rounded-md text-white bg-[var(--themeColor600)] hover:bg-[var(--themeColor500)] active:bg-[var(--themeColor700)] duration-150 outline-hidden shadow-md focus:shadow-none focus:ring-2 ring-offset-2 ring-[var(--themeColor600)] sm:mt-0 sm:ml-3 sm:w-auto"
75
75
  >
76
76
  {render_value(all_langs, "Subscribe")}
77
77
  </button>
@@ -36,6 +36,7 @@ const {base, url_suffix} = Astro.locals;
36
36
  group_plans.map((group: any, idx: number) => (
37
37
  <button
38
38
  class:list={[
39
+ "cursor-pointer",
39
40
  "tabs-tab",
40
41
  { "bg-[var(--themeColor)]": idx == 0 },
41
42
  { "text-white": idx == 0 },
@@ -38,6 +38,7 @@ const {base,url_suffix} = Astro.locals;
38
38
  group_plans.map((group: any, idx: number) => (
39
39
  <button
40
40
  class:list={[
41
+ "cursor-pointer",
41
42
  "tabs-tab",
42
43
  { "bg-[var(--themeColor)]": idx == 0 },
43
44
  { "text-white": idx == 0 },
@@ -107,7 +107,7 @@ switch (node_item_component) {
107
107
  </div>
108
108
  <div class="py-4 text-center">
109
109
  <button type="button"
110
- class="flex gap-2 items-center text-slate-400"
110
+ class="cursor-pointer flex gap-2 items-center text-slate-400"
111
111
  x-on:click="expanded = !expanded">
112
112
  <Icon name="fa6-solid:arrow-down" :class="{hidden:expanded}" />
113
113
  <Icon name="fa6-solid:arrow-up" class="hidden" :class="{hidden:!expanded}" /> Toggle Content</button>