themekit-js 1.48.818 → 1.48.820

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.
@@ -49,6 +49,18 @@ const VitePressApp = defineComponent({
49
49
  link.rel = "stylesheet";
50
50
  document.head.appendChild(link);
51
51
  }
52
+ const hbgs = document.querySelectorAll(".block-hero-background-img");
53
+ for (var i = 0; i < hbgs.length; i++) {
54
+ const img = hbgs[i];
55
+ img.addEventListener("load", function () {
56
+ if (img.parentElement != null) {
57
+ var p1 = img.parentElement;
58
+ if (p1.parentElement != null) {
59
+ p1.parentElement.style.minHeight = img.clientHeight + "px";
60
+ }
61
+ }
62
+ });
63
+ }
52
64
  /*
53
65
  for(var scriptSrc in scripts){
54
66
  const script = document.createElement('script');
@@ -96,5 +96,5 @@ provide('hero-image-slot-exists', heroImageSlotExists)
96
96
  display: flex;
97
97
  flex-direction: column;
98
98
  min-height: 100vh;
99
- }
99
+ }
100
100
  </style>
@@ -34,7 +34,7 @@ watchEffect(() => {
34
34
  <template #nav-screen-content-before><slot name="nav-screen-content-before" /></template>
35
35
  <template #nav-screen-content-after><slot name="nav-screen-content-after" /></template>
36
36
  </VPNavScreen>
37
- </header>
37
+ </header>
38
38
  </template>
39
39
 
40
40
  <style scoped>
@@ -48,6 +48,7 @@ watchEffect(() => {
48
48
  pointer-events: none;
49
49
  transition: background-color 0.5s;
50
50
  }
51
+
51
52
 
52
53
  @media (min-width: 960px) {
53
54
  .VPNav {
@@ -55,10 +55,7 @@ const props = withDefaults(defineProps<Props>(), {
55
55
  return HeroImg!==null&& HeroImg.src!=""
56
56
  })
57
57
 
58
- const hasBgImg =computed(()=>{
59
- return props.block['nav-color']!==null
60
- })
61
-
58
+
62
59
 
63
60
  import { useData } from 'themekit-js'
64
61
  const { base } = useData()
@@ -86,19 +83,19 @@ const styles= computed(() => {
86
83
  </script>
87
84
 
88
85
  <template>
89
- <div class="VPHero block-hero" :class="[{ 'has-image':hasImg},block.class?block.class:'']" :style="styles">
90
- <template v-for="(item) in block.children" >
91
-
86
+
87
+ <div class="hero-frame">
88
+ <template v-for="(item) in block.children" >
92
89
  <template v-if="item.block_type=='p'">
93
90
  <template v-for="(pItem) in item.children" >
94
91
  <div class="block-hero-background" v-if="pItem.block_type=='img'&&pItem.alt=='background' ">
95
- <Image :block="pItem" ></Image>
92
+ <img class="block-hero-background-img" :src="pItem.src" alt="IMG" >
96
93
  </div>
97
94
  </template>
98
95
  </template>
99
- </template>
100
- <div v-if="hasBgImg" class="hero-bgi-nav" :style="{'background-color':block['nav-color']}"></div>
101
- <div class="container">
96
+ </template>
97
+ <div class="VPHero block-hero" :class="[{ 'has-image':hasImg},block.class?block.class:'']" :style="styles">
98
+
102
99
  <div class="main">
103
100
  <template v-for="(item) in block.children" >
104
101
  <template v-if="item.block_type=='h1'">
@@ -141,59 +138,54 @@ const styles= computed(() => {
141
138
  </div>
142
139
  </div>
143
140
  </div>
144
- </div>
141
+ </div>
145
142
  </template>
146
143
 
147
144
  <style scoped>
148
- .VPHero {
149
- position: relative;
150
- margin-top: calc((var(--vp-nav-height) + var(--vp-layout-top-height, 0px)) * -1);
151
- padding: calc(var(--vp-nav-height) + var(--vp-layout-top-height, 0px) + 48px) 24px 48px;
152
- background-size: cover;
153
- background-position: center;
154
- position: relative;
155
- }
156
145
 
146
+ .hero-frame{ display: flex; position: relative; }
147
+ .VPHero {
148
+ padding: 64px 24px;
149
+ background-size: cover;
150
+ background-position: center;
151
+ margin: 0 auto;
152
+ max-width: 1152px;
153
+ flex: 1 ;align-self: center
154
+ }
155
+
157
156
  .block-hero-background{
158
- position: absolute;
157
+ position: absolute;
159
158
  left: 0;
160
159
  top: 0;
160
+ overflow-y: auto;
161
+ max-width: 100%;
162
+ display: flex;
163
+ justify-content: center;
161
164
  }
162
- .hero-bgi-nav{
163
- height:var(--vp-nav-height) ;
164
- position: absolute;
165
- left:0;
166
- right:0;
167
- top:0;
168
- }
169
-
170
- .dark .hero-bgi-nav{
171
- background-color: var(--vp-c-bg) !important;
165
+ .block-hero-background img{
166
+ max-width: none;
167
+ width: auto !important;
168
+ height: 100% !important;
172
169
  }
170
+
173
171
  @media (min-width: 640px) {
174
172
  .VPHero {
175
- padding: calc(var(--vp-nav-height) + var(--vp-layout-top-height, 0px) + 80px) 48px 64px;
173
+ padding: 64px 0;
176
174
  }
175
+ .block-hero-background{
176
+ overflow: hidden;}
177
177
  }
178
178
 
179
179
  @media (min-width: 960px) {
180
- .VPHero {
181
- padding: calc(var(--vp-nav-height) + var(--vp-layout-top-height, 0px) + 80px) 64px 64px;
182
- }
183
- }
184
-
185
- .container {
186
- display: flex;
187
- flex-direction: column;
188
- margin: 0 auto;
189
- max-width: 1152px;
190
- }
191
180
 
192
- @media (min-width: 960px) {
193
- .container {
194
- flex-direction: row;
181
+ .VPHero {
182
+ padding: 64px 0;
195
183
  }
184
+ .block-hero-background{
185
+ overflow: hidden;}
196
186
  }
187
+
188
+
197
189
 
198
190
  .main {
199
191
  position: relative;
package/dist/node/cli.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as getDefaultExportFromCjs, q as c, t as clearCache, n as init, b as build, o as serve, v as version, p as createServer } from './serve-DfnJGoZX.js';
1
+ import { a as getDefaultExportFromCjs, q as c, t as clearCache, n as init, b as build, o as serve, v as version, p as createServer } from './serve-ICa4jpBf.js';
2
2
  import { createLogger } from 'vite';
3
3
  import 'path';
4
4
  import 'shiki';
@@ -1,7 +1,7 @@
1
1
  import { normalizePath } from 'vite';
2
2
  export { loadEnv } from 'vite';
3
- import { g as glob, c as createMarkdownRenderer, f as fs, m as matter, a as getDefaultExportFromCjs } from './serve-DfnJGoZX.js';
4
- export { S as ScaffoldThemeType, b as build, p as createServer, e as defineConfig, h as defineConfigWithTheme, d as defineLoader, n as init, j as mergeConfig, r as resolveConfig, l as resolvePages, k as resolveSiteData, i as resolveUserConfig, s as scaffold, o as serve } from './serve-DfnJGoZX.js';
3
+ import { g as glob, c as createMarkdownRenderer, f as fs, m as matter, a as getDefaultExportFromCjs } from './serve-ICa4jpBf.js';
4
+ export { S as ScaffoldThemeType, b as build, p as createServer, e as defineConfig, h as defineConfigWithTheme, d as defineLoader, n as init, j as mergeConfig, r as resolveConfig, l as resolvePages, k as resolveSiteData, i as resolveUserConfig, s as scaffold, o as serve } from './serve-ICa4jpBf.js';
5
5
  import path from 'path';
6
6
  import 'crypto';
7
7
  import 'module';
@@ -46744,7 +46744,7 @@ function escapeHtml(string) {
46744
46744
 
46745
46745
  var escape$1 = /*@__PURE__*/getDefaultExportFromCjs(escapeHtml_1);
46746
46746
 
46747
- var version = "1.48.0818";
46747
+ var version = "1.48.0820";
46748
46748
 
46749
46749
  async function renderPage(render, config, page, result, appChunk, cssChunk, assets, pageToHashMap, metadataScript, additionalHeadTags) {
46750
46750
  const routePath = `/${page.replace(/\.md$/, "")}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "themekit-js",
3
- "version": "1.48.0818",
3
+ "version": "1.48.0820",
4
4
  "description": "基于VitePress开发的Markdown静态网站生成器",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@8.15.6",