slidev-theme-neversink 0.3.1 → 0.3.3
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/components/Thumb.vue
CHANGED
package/layoutHelper.ts
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
import type { CSSProperties } from 'vue'
|
|
2
|
-
import { colors } from '@unocss/preset-mini'
|
|
2
|
+
// import { colors } from '@unocss/preset-mini'
|
|
3
3
|
|
|
4
|
-
export function resolveColor(colorName: string, defaultColor: string = '#000000'): string {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
// export function resolveColor(colorName: string, defaultColor: string = '#000000'): string {
|
|
5
|
+
// // If the input is already a hex code, return it
|
|
6
|
+
// if (/^#([0-9A-F]{3}){1,2}$/i.test(colorName)) {
|
|
7
|
+
// return colorName
|
|
8
|
+
// }
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
// // Split the color name into base and shade
|
|
11
|
+
// const [baseColor, shade] = colorName.toLowerCase().split('-')
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
// // Function to find the color in the colors object
|
|
14
|
+
// function findColor(obj: any, base: string, shade?: string): string | null {
|
|
15
|
+
// if (base in obj) {
|
|
16
|
+
// if (shade && typeof obj[base] === 'object' && shade in obj[base]) {
|
|
17
|
+
// return obj[base][shade]
|
|
18
|
+
// } else if (!shade && typeof obj[base] === 'string') {
|
|
19
|
+
// return obj[base]
|
|
20
|
+
// }
|
|
21
|
+
// }
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
// for (const value of Object.values(obj)) {
|
|
24
|
+
// if (typeof value === 'object' && value !== null) {
|
|
25
|
+
// const result = findColor(value, base, shade)
|
|
26
|
+
// if (result) return result
|
|
27
|
+
// }
|
|
28
|
+
// }
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
// return null
|
|
31
|
+
// }
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
// // Search for the color in the UnoCSS colors object
|
|
34
|
+
// const hexCode = findColor(colors, baseColor, shade)
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
36
|
+
// // If a valid color is found, return its hex code; otherwise, return the default color
|
|
37
|
+
// return hexCode || defaultColor
|
|
38
|
+
// }
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
41
|
* Resolve urls from frontmatter and append with the base url
|
package/layouts/side-title.vue
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
<script setup lang="
|
|
2
|
-
import { computed
|
|
1
|
+
<script setup lang="js">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
3
|
import { compute_alignment, compute_column_size } from '../layoutHelper'
|
|
4
4
|
|
|
5
|
-
const slots = useSlots()
|
|
6
|
-
|
|
7
5
|
const props = defineProps({
|
|
8
6
|
side: {
|
|
9
7
|
default: 'l',
|
|
@@ -55,15 +53,15 @@ const colorscheme = computed(() => {
|
|
|
55
53
|
<p>
|
|
56
54
|
There are three parameters: <code>color</code>, <code>columns</code> and <code>align</code>. Currently:
|
|
57
55
|
<code>color: {{ props.color }}</code
|
|
58
|
-
>, <code>columns: {{ props.
|
|
56
|
+
>, <code>columns: {{ props.titlewidth }}</code> and <code>align: {{ props.align }}</code
|
|
59
57
|
>.
|
|
60
58
|
</p>
|
|
61
59
|
<p>The "slots" of the page are default and <code>:: content ::</code></p>
|
|
62
60
|
<p>
|
|
63
|
-
Options for <code>
|
|
64
|
-
column is 1/12 wide and the the right columns is 11/12 wide. The component admits a short had of only
|
|
65
|
-
the left column (<code>
|
|
66
|
-
<code>
|
|
61
|
+
Options for <code>titlewidth</code> are divided into 12 column units. So with <code>titlewidth: is-1-11</code> the
|
|
62
|
+
left column is 1/12 wide and the the right columns is 11/12 wide. The component admits a short had of only
|
|
63
|
+
specifying the left column (<code>titlewidth: is-1</code> does the same thing). In addition there are short hands
|
|
64
|
+
like <code>titlewidth: is-one-quarter</code> which resolves to <code>is-3-9</code>, etc...
|
|
67
65
|
</p>
|
|
68
66
|
<p>
|
|
69
67
|
Here are a bunch of examples:
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
<script setup lang="
|
|
2
|
-
import { computed
|
|
1
|
+
<script setup lang="js">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
3
|
import { compute_alignment, compute_column_size } from '../layoutHelper'
|
|
4
4
|
|
|
5
|
-
const slots = useSlots()
|
|
6
|
-
|
|
7
5
|
const props = defineProps({
|
|
8
6
|
columns: {
|
|
9
7
|
default: 'is-one-half',
|
|
@@ -59,7 +57,7 @@ const colorscheme = computed(() => {
|
|
|
59
57
|
|
|
60
58
|
<p>The <code>color</code> parameter determines color of the title.</p>
|
|
61
59
|
</div>
|
|
62
|
-
<
|
|
60
|
+
<div v-else>
|
|
63
61
|
<div class="flex flex-col h-full w-full">
|
|
64
62
|
<div class="w-full h-fit min-h-13 pt-2 pb-2 slidecolor" :class="colorscheme">
|
|
65
63
|
<div class="slidev-layout toptitle title p-0 ml-6 mr-6 mt-auto mb-auto" :class="alignment.t">
|
|
@@ -80,7 +78,7 @@ const colorscheme = computed(() => {
|
|
|
80
78
|
<slot name="default" />
|
|
81
79
|
</div>
|
|
82
80
|
</div>
|
|
83
|
-
</
|
|
81
|
+
</div>
|
|
84
82
|
</template>
|
|
85
83
|
|
|
86
84
|
<style>
|
package/layouts/top-title.vue
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
<script setup lang="
|
|
2
|
-
import { computed
|
|
3
|
-
import { compute_alignment
|
|
4
|
-
|
|
5
|
-
const slots = useSlots()
|
|
1
|
+
<script setup lang="js">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
import { compute_alignment } from '../layoutHelper'
|
|
6
4
|
|
|
7
5
|
const props = defineProps({
|
|
8
6
|
color: {
|
|
@@ -41,7 +39,7 @@ const colorscheme = computed(() => {
|
|
|
41
39
|
|
|
42
40
|
<p>The <code>color</code> parameter determines color of the title.</p>
|
|
43
41
|
</div>
|
|
44
|
-
<
|
|
42
|
+
<div v-else>
|
|
45
43
|
<div class="flex flex-col h-full w-full">
|
|
46
44
|
<div class="w-full h-fit min-h-13 pt-2 pb-2 slidecolor" :class="colorscheme">
|
|
47
45
|
<div class="slidev-layout toptitle title p-0 pt-0 ml-6 mr-6 mt-auto mb-auto" :class="alignment">
|
|
@@ -55,7 +53,7 @@ const colorscheme = computed(() => {
|
|
|
55
53
|
<slot name="default" />
|
|
56
54
|
</div>
|
|
57
55
|
</div>
|
|
58
|
-
</
|
|
56
|
+
</div>
|
|
59
57
|
</template>
|
|
60
58
|
|
|
61
59
|
<style>
|
package/layouts/two-cols.vue
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
<script setup lang="
|
|
2
|
-
import { computed
|
|
1
|
+
<script setup lang="js">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
3
|
import { compute_alignment, compute_column_size } from '../layoutHelper'
|
|
4
4
|
|
|
5
|
-
const slots = useSlots()
|
|
6
|
-
|
|
7
5
|
const props = defineProps({
|
|
8
6
|
columns: {
|
|
9
7
|
default: 'is-one-half',
|