slidev-theme-neversink 0.0.0
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/.github/workflows/deploy.yml +67 -0
- package/.prettierrc +15 -0
- package/.vscode/settings.json +4 -0
- package/LICENSE +21 -0
- package/README.md +112 -0
- package/assets/nyu_long_black_on_white.svg +41 -0
- package/components/Admonition.vue +80 -0
- package/components/AdmonitionType.vue +56 -0
- package/components/CreditScroll.vue +94 -0
- package/components/SpeechBubble.vue +294 -0
- package/components/StickyNote.vue +71 -0
- package/components/vue3-kawaii/README.md +5 -0
- package/components/vue3-kawaii/components/backpack/BackPack.vue +123 -0
- package/components/vue3-kawaii/components/backpack/backpackpaths.js +17 -0
- package/components/vue3-kawaii/components/browser/Browser.vue +56 -0
- package/components/vue3-kawaii/components/browser/browserpaths.js +9 -0
- package/components/vue3-kawaii/components/cat/Cat.vue +89 -0
- package/components/vue3-kawaii/components/cat/catpaths.js +8 -0
- package/components/vue3-kawaii/components/common/face/Face.vue +95 -0
- package/components/vue3-kawaii/components/common/face/facepaths.js +24 -0
- package/components/vue3-kawaii/components/common/wrapper/Wrapper.vue +24 -0
- package/components/vue3-kawaii/components/creditCard/CreditCard.vue +47 -0
- package/components/vue3-kawaii/components/creditCard/creditcardpaths.js +8 -0
- package/components/vue3-kawaii/components/ghost/Ghost.vue +48 -0
- package/components/vue3-kawaii/components/ghost/ghostpaths.js +8 -0
- package/components/vue3-kawaii/components/iceCream/IceCream.vue +49 -0
- package/components/vue3-kawaii/components/iceCream/icecreampaths.js +9 -0
- package/components/vue3-kawaii/components/mug/Mug.vue +48 -0
- package/components/vue3-kawaii/components/mug/mugpaths.js +7 -0
- package/components/vue3-kawaii/components/planet/Planet.vue +58 -0
- package/components/vue3-kawaii/components/planet/planetpaths.js +7 -0
- package/components/vue3-kawaii/components/speechBubble/SpeechBubbleGuy.vue +63 -0
- package/components/vue3-kawaii/components/speechBubble/speechbubblepaths.js +8 -0
- package/components/vue3-kawaii/utils/getUniqueId.js +10 -0
- package/docs/.vitepress/config.js +75 -0
- package/docs/.vitepress/theme/index.js +50 -0
- package/docs/.vitepress/theme/style.css +145 -0
- package/docs/api-examples.md +49 -0
- package/docs/branding.md +43 -0
- package/docs/colors.md +108 -0
- package/docs/components/admonitions.md +106 -0
- package/docs/components/creditscroll.md +1 -0
- package/docs/components/kawaii.md +26 -0
- package/docs/components/qrcode.md +24 -0
- package/docs/components/speechbubble.md +69 -0
- package/docs/components/stickynote.md +54 -0
- package/docs/components.md +19 -0
- package/docs/contributing.md +5 -0
- package/docs/customizing.md +38 -0
- package/docs/getting-started.md +32 -0
- package/docs/index.md +19 -0
- package/docs/layouts/cover.md +69 -0
- package/docs/layouts/credits.md +111 -0
- package/docs/layouts/default.md +88 -0
- package/docs/layouts/full.md +131 -0
- package/docs/layouts/intro.md +63 -0
- package/docs/layouts/quote.md +51 -0
- package/docs/layouts/section.md +67 -0
- package/docs/layouts/side-title.md +180 -0
- package/docs/layouts/top-title-two-cols.md +171 -0
- package/docs/layouts/top-title.md +103 -0
- package/docs/layouts/two-cols-title.md +273 -0
- package/docs/layouts.md +92 -0
- package/docs/markdown-examples.md +85 -0
- package/docs/markdown.md +87 -0
- package/docs/parts/columnsystem.md +18 -0
- package/docs/parts/layoutpicker.md +73 -0
- package/docs/public/deck.png +0 -0
- package/docs/public/layouts/side-title-12row.svg +27 -0
- package/docs/public/layouts/side-title-is-3.svg +7 -0
- package/docs/public/layouts/side-title-is-6.svg +7 -0
- package/docs/public/layouts/side-title-side.svg +13 -0
- package/docs/public/layouts/two-col-title-12row.svg +31 -0
- package/docs/public/layouts/two-col-title-align.svg +13 -0
- package/docs/public/layouts/two-col-title-is-4.svg +23 -0
- package/docs/public/layouts/two-col-title-is-6.svg +23 -0
- package/docs/public/layouts/two-col-title-titlepos.svg +31 -0
- package/docs/public/screenshots/1.png +0 -0
- package/docs/public/screenshots/10.png +0 -0
- package/docs/public/screenshots/11.png +0 -0
- package/docs/public/screenshots/12.png +0 -0
- package/docs/public/screenshots/13.png +0 -0
- package/docs/public/screenshots/14.png +0 -0
- package/docs/public/screenshots/15.png +0 -0
- package/docs/public/screenshots/16.png +0 -0
- package/docs/public/screenshots/17.png +0 -0
- package/docs/public/screenshots/18.png +0 -0
- package/docs/public/screenshots/19.png +0 -0
- package/docs/public/screenshots/2.png +0 -0
- package/docs/public/screenshots/20.png +0 -0
- package/docs/public/screenshots/21.png +0 -0
- package/docs/public/screenshots/22.png +0 -0
- package/docs/public/screenshots/23.png +0 -0
- package/docs/public/screenshots/24.png +0 -0
- package/docs/public/screenshots/25.png +0 -0
- package/docs/public/screenshots/26.png +0 -0
- package/docs/public/screenshots/27.png +0 -0
- package/docs/public/screenshots/28.png +0 -0
- package/docs/public/screenshots/29.png +0 -0
- package/docs/public/screenshots/3.png +0 -0
- package/docs/public/screenshots/30.png +0 -0
- package/docs/public/screenshots/31.png +0 -0
- package/docs/public/screenshots/32.png +0 -0
- package/docs/public/screenshots/33.png +0 -0
- package/docs/public/screenshots/34.png +0 -0
- package/docs/public/screenshots/35.png +0 -0
- package/docs/public/screenshots/36.png +0 -0
- package/docs/public/screenshots/37.png +0 -0
- package/docs/public/screenshots/38.png +0 -0
- package/docs/public/screenshots/4.png +0 -0
- package/docs/public/screenshots/5.png +0 -0
- package/docs/public/screenshots/6.png +0 -0
- package/docs/public/screenshots/7.png +0 -0
- package/docs/public/screenshots/8.png +0 -0
- package/docs/public/screenshots/9.png +0 -0
- package/example.md +1503 -0
- package/layoutHelper.ts +118 -0
- package/layouts/cover.vue +93 -0
- package/layouts/credits.vue +35 -0
- package/layouts/default.vue +18 -0
- package/layouts/four-cell.vue +210 -0
- package/layouts/full.vue +22 -0
- package/layouts/intro.vue +75 -0
- package/layouts/quote.vue +62 -0
- package/layouts/section.vue +84 -0
- package/layouts/side-title.vue +142 -0
- package/layouts/top-title-two-cols.vue +131 -0
- package/layouts/top-title.vue +63 -0
- package/layouts/two-cols-title.vue +176 -0
- package/layouts/two-cols.vue +141 -0
- package/package.json +54 -0
- package/public/images/photo.png +0 -0
- package/public/images/photo2.png +0 -0
- package/public/images/scatter1.png +0 -0
- package/public/images/scatter1.svg +20 -0
- package/screenshot.md +874 -0
- package/setup/main.ts +45 -0
- package/setup/shiki.ts +14 -0
- package/slide-bottom.vue +107 -0
- package/styles/base.css +240 -0
- package/styles/bubbles.css +4 -0
- package/styles/colors.css +12 -0
- package/styles/index.ts +11 -0
- package/styles/layouts.css +76 -0
- package/styles/stickynote.css +4 -0
- package/uno.config.ts +222 -0
- package/vite.config.ts +16 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
<script setup lang="js">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
color: {
|
|
6
|
+
default: 'white',
|
|
7
|
+
},
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
const colorscheme = computed(() => {
|
|
11
|
+
return `neversink-${props.color}-scheme`
|
|
12
|
+
})
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<div class="slidev-layout section slidecolor" :class="colorscheme">
|
|
17
|
+
<div class="my-auto">
|
|
18
|
+
<slot />
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<style>
|
|
24
|
+
.slidev-layout.section {
|
|
25
|
+
display: grid;
|
|
26
|
+
height: 100%;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.slidev-layout.section hr {
|
|
30
|
+
border: 0;
|
|
31
|
+
border-top: 1px solid var(--neversink-border-color);
|
|
32
|
+
margin: 0;
|
|
33
|
+
margin-bottom: 0.5rem;
|
|
34
|
+
margin-top: 0.5rem;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/* cover slide type */
|
|
38
|
+
.slidev-layout.section h1 {
|
|
39
|
+
font-family: var(--neversink-title-font);
|
|
40
|
+
font-weight: 500;
|
|
41
|
+
font-size: 1.8em;
|
|
42
|
+
padding-bottom: 0.3rem;
|
|
43
|
+
line-height: normal;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.slidev-layout.section h2 {
|
|
47
|
+
font-family: var(--neversink-title-font);
|
|
48
|
+
font-weight: 500;
|
|
49
|
+
font-size: 2.5em;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.slidev-layout.section h3 {
|
|
53
|
+
font-family: var(--neversink-title-font);
|
|
54
|
+
font-weight: 500;
|
|
55
|
+
font-size: 1.9em;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.slidev-layout.section {
|
|
59
|
+
font-family: var(--neversink-main-font);
|
|
60
|
+
font-weight: 300;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.slidev-layout.section strong {
|
|
64
|
+
font-weight: 500;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.slidev-layout.section h1 + p {
|
|
68
|
+
padding: 0;
|
|
69
|
+
margin: 0;
|
|
70
|
+
opacity: 1;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.slidev-layout.section h2 + p {
|
|
74
|
+
padding: 0;
|
|
75
|
+
margin: 0;
|
|
76
|
+
opacity: 1;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.slidev-layout.section h3 + p {
|
|
80
|
+
padding: 0;
|
|
81
|
+
margin: 0;
|
|
82
|
+
opacity: 1;
|
|
83
|
+
}
|
|
84
|
+
</style>
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, useSlots } from 'vue'
|
|
3
|
+
import { compute_alignment, compute_column_size } from '../layoutHelper'
|
|
4
|
+
|
|
5
|
+
const slots = useSlots()
|
|
6
|
+
|
|
7
|
+
const props = defineProps({
|
|
8
|
+
side: {
|
|
9
|
+
default: 'l',
|
|
10
|
+
},
|
|
11
|
+
color: {
|
|
12
|
+
default: 'light',
|
|
13
|
+
},
|
|
14
|
+
titlewidth: {
|
|
15
|
+
default: 'is-one-third',
|
|
16
|
+
},
|
|
17
|
+
align: {
|
|
18
|
+
default: 'auto',
|
|
19
|
+
},
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
const side = computed(() => {
|
|
23
|
+
if (props.side === 'left' || props.side === 'l') {
|
|
24
|
+
return 'left'
|
|
25
|
+
} else if (props.side === 'right' || props.side === 'r') {
|
|
26
|
+
return 'right'
|
|
27
|
+
} else {
|
|
28
|
+
return 'error'
|
|
29
|
+
}
|
|
30
|
+
})
|
|
31
|
+
const colwidth = computed(() => compute_column_size(props.titlewidth))
|
|
32
|
+
|
|
33
|
+
const alignment = computed(() => {
|
|
34
|
+
let aligncode = ''
|
|
35
|
+
if (props.align == 'auto' && (props.side === 'l' || props.side === 'left')) {
|
|
36
|
+
aligncode = 'rm-lt'
|
|
37
|
+
} else if (props.align == 'auto' && (props.side === 'r' || props.side === 'right')) {
|
|
38
|
+
aligncode = 'lt-lm'
|
|
39
|
+
} else {
|
|
40
|
+
aligncode = props.align
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const parts = aligncode.split('-')
|
|
44
|
+
return { l: compute_alignment(parts[0]), r: compute_alignment(parts[1]) }
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
const colorscheme = computed(() => {
|
|
48
|
+
return `neversink-${props.color}-scheme`
|
|
49
|
+
})
|
|
50
|
+
</script>
|
|
51
|
+
<template>
|
|
52
|
+
<div v-if="side == 'error' || colwidth == 'error'" class="slidev-layout default error">
|
|
53
|
+
<span class="warning"><b>Error</b>: invalid layout params.</span>
|
|
54
|
+
<hr />
|
|
55
|
+
<p>
|
|
56
|
+
There are three parameters: <code>color</code>, <code>columns</code> and <code>align</code>. Currently:
|
|
57
|
+
<code>color: {{ props.color }}</code
|
|
58
|
+
>, <code>columns: {{ props.columns }}</code> and <code>align: {{ props.align }}</code
|
|
59
|
+
>.
|
|
60
|
+
</p>
|
|
61
|
+
<p>The "slots" of the page are default and <code>:: content ::</code></p>
|
|
62
|
+
<p>
|
|
63
|
+
Options for <code>columns</code> are divided into 12 column units. So with <code>columns: is-1-11</code> the left
|
|
64
|
+
column is 1/12 wide and the the right columns is 11/12 wide. The component admits a short had of only specifying
|
|
65
|
+
the left column (<code>columns: is-1</code> does the same thing). In addition there are short hands like
|
|
66
|
+
<code>columns: is-one-quarter</code> which resolves to <code>is-3-9</code>, etc...
|
|
67
|
+
</p>
|
|
68
|
+
<p>
|
|
69
|
+
Here are a bunch of examples:
|
|
70
|
+
<code>
|
|
71
|
+
is-1, is-2, is-3, is-3-9, is-4-8, is-5-7, is-one-quarter, is-one-third, is-one-half, is-two-thirds,
|
|
72
|
+
is-three-quarters
|
|
73
|
+
</code>
|
|
74
|
+
</p>
|
|
75
|
+
|
|
76
|
+
<p>
|
|
77
|
+
The <code>align</code> parameter determines how the columns look. The notation is for example
|
|
78
|
+
<code>align: cm-cm</code>. The first part for the left column, and the third part is for the right column. The
|
|
79
|
+
first letter is (<code>c</code> for center, <code>l</code> for left, <code>r</code> for right). This applies to
|
|
80
|
+
all three second. For the columns the second letter is vertical alignment (<code>t</code> for top,
|
|
81
|
+
<code>m</code> for middle, <code>b</code> for bottom).
|
|
82
|
+
</p>
|
|
83
|
+
|
|
84
|
+
<p>The <code>color</code> parameter determines color of the title.</p>
|
|
85
|
+
</div>
|
|
86
|
+
<template v-else>
|
|
87
|
+
<div v-if="side === 'left'" class="flex h-full w-full">
|
|
88
|
+
<div class="slidecolor column-title" :class="colorscheme">
|
|
89
|
+
<div class="slidev-layout sidetitle w-full p-6" :class="alignment.l"><slot name="title" /></div>
|
|
90
|
+
</div>
|
|
91
|
+
<div class="column-content">
|
|
92
|
+
<div class="slidev-layout h-fit w-full" :class="alignment.r">
|
|
93
|
+
<slot name="content" />
|
|
94
|
+
<slot name="default" />
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
<div v-else class="flex h-full w-full">
|
|
99
|
+
<div class="column-content">
|
|
100
|
+
<div class="slidev-layout h-fit w-full" :class="alignment.l">
|
|
101
|
+
<slot name="content" />
|
|
102
|
+
<slot name="default" />
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
<div class="slidecolor column-title" :class="colorscheme">
|
|
106
|
+
<div class="slidev-layout sidetitle w-full p-6" :class="alignment.r"><slot name="title" /></div>
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
</template>
|
|
110
|
+
</template>
|
|
111
|
+
|
|
112
|
+
<style>
|
|
113
|
+
.slidev-layout.sidetitle {
|
|
114
|
+
height: fit-content;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.slidev-layout.sidetitle hr {
|
|
118
|
+
border: 0;
|
|
119
|
+
border-top: 1px solid var(--neversink-border-color);
|
|
120
|
+
margin: 0;
|
|
121
|
+
margin-bottom: 0.5rem;
|
|
122
|
+
margin-top: 0.5rem;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.slidev-layout.sidetitle code {
|
|
126
|
+
background: none;
|
|
127
|
+
}
|
|
128
|
+
.slidev-layout.sidetitle h1 {
|
|
129
|
+
margin-bottom: 5;
|
|
130
|
+
}
|
|
131
|
+
</style>
|
|
132
|
+
<style scoped>
|
|
133
|
+
.column-title {
|
|
134
|
+
flex: v-bind(colwidth.l); /* although this is mapped to 'left' it is reversed when needed in the template*/
|
|
135
|
+
display: flex;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.column-content {
|
|
139
|
+
flex: v-bind(colwidth.r); /* although this is mapped to 'right' it is reversed when needed in the template*/
|
|
140
|
+
display: flex;
|
|
141
|
+
}
|
|
142
|
+
</style>
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
import { compute_alignment, compute_column_size } from '../layoutHelper'
|
|
4
|
+
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
columns: {
|
|
7
|
+
default: 'is-one-half',
|
|
8
|
+
},
|
|
9
|
+
align: {
|
|
10
|
+
default: 'l-lt-lt',
|
|
11
|
+
},
|
|
12
|
+
color: {
|
|
13
|
+
default: 'light',
|
|
14
|
+
},
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
const colwidth = computed(() => compute_column_size(props.columns))
|
|
18
|
+
|
|
19
|
+
const alignment = computed(() => {
|
|
20
|
+
const parts = props.align.split('-')
|
|
21
|
+
return { t: compute_alignment(parts[0]), l: compute_alignment(parts[1]), r: compute_alignment(parts[2]) }
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
const colorscheme = computed(() => {
|
|
25
|
+
return `neversink-${props.color}-scheme`
|
|
26
|
+
})
|
|
27
|
+
</script>
|
|
28
|
+
<template>
|
|
29
|
+
<div
|
|
30
|
+
v-if="colwidth == 'error' || alignment.t == 'error' || alignment.l == 'error' || alignment.r == 'error'"
|
|
31
|
+
class="slidev-layout default error"
|
|
32
|
+
>
|
|
33
|
+
<span class="warning"><b>Error</b>: invalid layout params.</span>
|
|
34
|
+
<hr />
|
|
35
|
+
<p>
|
|
36
|
+
There are three parameters: <code>columns</code>, <code>align</code>, and <code>color</code>. Currently:
|
|
37
|
+
<code>columns: {{ props.columns }} </code>, <code>align: {{ props.align }} </code>, and
|
|
38
|
+
<code>color: {{ props.color }} </code>.
|
|
39
|
+
</p>
|
|
40
|
+
<p>
|
|
41
|
+
The "slots" of the page are default <code>:: title ::</code>, <code>:: left ::</code>, and
|
|
42
|
+
<code>:: right ::</code>
|
|
43
|
+
</p>
|
|
44
|
+
<p>
|
|
45
|
+
Options for <code>columns</code> are divided into 12 column units. So with <code>columns: is-1-11</code> the left
|
|
46
|
+
column is 1/12 wide and the the right columns is 11/12 wide. The component admits a short had of only specifying
|
|
47
|
+
the left column (<code>columns: is-1</code> does the same thing). In addition there are short hands like
|
|
48
|
+
<code>columns: is-one-quarter</code> which resolves to <code>is-3-9</code>, etc...
|
|
49
|
+
</p>
|
|
50
|
+
<p>
|
|
51
|
+
The <code>align</code> parameter determines how the columns look. The notation is for example
|
|
52
|
+
<code>align: c-cm-cm</code>. The first part is for the title, the second for the left column, and the third part
|
|
53
|
+
is for the right column. The first letter is (<code>c</code> for center, <code>l</code> for left,
|
|
54
|
+
<code>r</code> for right). This applies to all three second. For the columns the second letter is vertical
|
|
55
|
+
alignment (<code>t</code> for top, <code>m</code> for middle, <code>b</code> for bottom).
|
|
56
|
+
</p>
|
|
57
|
+
|
|
58
|
+
<p>The <code>color</code> parameter determines color of the title.</p>
|
|
59
|
+
</div>
|
|
60
|
+
<template v-else>
|
|
61
|
+
<div class="flex flex-col h-full w-full">
|
|
62
|
+
<div class="w-full h-fit min-h-14 pt-2 pb-2 slidecolor" :class="colorscheme">
|
|
63
|
+
<div class="slidev-layout toptitlebar p-0 ml-6 mr-6 mt-auto mb-auto" :class="alignment.t">
|
|
64
|
+
<slot name="title" />
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
<div class="slidev-layout toptitlecontent w-full">
|
|
68
|
+
<div class="flex flex-row h-full w-full">
|
|
69
|
+
<div class="col-left" :class="alignment.l">
|
|
70
|
+
<slot name="left" />
|
|
71
|
+
</div>
|
|
72
|
+
<div class="col-right" :class="alignment.r">
|
|
73
|
+
<slot name="right" />
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
<div class="slidev-layout toptitlecontent h-fit w-full">
|
|
78
|
+
<slot name="default" />
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
</template>
|
|
82
|
+
</template>
|
|
83
|
+
|
|
84
|
+
<style>
|
|
85
|
+
.slidev-layout.toptitlecontent {
|
|
86
|
+
padding-top: 1.3rem;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.toptitlebar {
|
|
90
|
+
padding: 0;
|
|
91
|
+
margin: 0;
|
|
92
|
+
margin-left: 20px;
|
|
93
|
+
margin-right: 20px;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.slidev-layout.toptitle h1 {
|
|
97
|
+
font-size: 1.8em;
|
|
98
|
+
font-family: var(--neversink-title-font);
|
|
99
|
+
font-weight: 500;
|
|
100
|
+
padding-left: 25px;
|
|
101
|
+
letter-spacing: 0.07em;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.slidev-layout.toptitle h2 {
|
|
105
|
+
font-size: 1.5em;
|
|
106
|
+
font-family: var(--neversink-title-font);
|
|
107
|
+
font-weight: 300;
|
|
108
|
+
padding-left: 25px;
|
|
109
|
+
letter-spacing: 0.07em;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.slidev-layout.toptitle h3 {
|
|
113
|
+
font-size: 1.1em;
|
|
114
|
+
font-family: var(--neversink-title-font);
|
|
115
|
+
font-weight: 300;
|
|
116
|
+
padding-left: 25px;
|
|
117
|
+
letter-spacing: 0.07em;
|
|
118
|
+
}
|
|
119
|
+
</style>
|
|
120
|
+
|
|
121
|
+
<style scoped>
|
|
122
|
+
.slidev-layout.toptitlecontent .col-left {
|
|
123
|
+
flex: v-bind(colwidth.l); /* Makes each column take up equal space */
|
|
124
|
+
margin-right: 15px;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.slidev-layout.toptitlecontent .col-right {
|
|
128
|
+
flex: v-bind(colwidth.r); /*Makes each column take up equal space */
|
|
129
|
+
margin-left: 15px;
|
|
130
|
+
}
|
|
131
|
+
</style>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, useSlots } from 'vue'
|
|
3
|
+
import { compute_alignment, compute_column_size } from '../layoutHelper'
|
|
4
|
+
|
|
5
|
+
const slots = useSlots()
|
|
6
|
+
|
|
7
|
+
const props = defineProps({
|
|
8
|
+
color: {
|
|
9
|
+
default: 'light',
|
|
10
|
+
},
|
|
11
|
+
align: {
|
|
12
|
+
default: 'l',
|
|
13
|
+
},
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
const alignment = computed(() => {
|
|
17
|
+
return compute_alignment(props.align)
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
const colorscheme = computed(() => {
|
|
21
|
+
return `neversink-${props.color}-scheme`
|
|
22
|
+
})
|
|
23
|
+
</script>
|
|
24
|
+
<template>
|
|
25
|
+
<div v-if="alignment == 'error'" class="slidev-layout default error">
|
|
26
|
+
<span class="warning"><b>Error</b>: invalid layout params.</span>
|
|
27
|
+
<hr />
|
|
28
|
+
<p>
|
|
29
|
+
There are two parameters: <code>color</code> <code>align</code>. Currently:
|
|
30
|
+
<code>color: {{ props.color }}</code> and <code>align: {{ props.align }}</code
|
|
31
|
+
>.
|
|
32
|
+
</p>
|
|
33
|
+
<p>
|
|
34
|
+
The "slots" of the page are <code>:: title ::</code>, <code>:: content ::</code>, and the implicit default slot
|
|
35
|
+
</p>
|
|
36
|
+
|
|
37
|
+
<p>
|
|
38
|
+
The <code>align</code> parameter determines how the title is aligned. The letter is (<code>c</code> for center,
|
|
39
|
+
<code>l</code> for left, <code>r</code> for right).
|
|
40
|
+
</p>
|
|
41
|
+
|
|
42
|
+
<p>The <code>color</code> parameter determines color of the title.</p>
|
|
43
|
+
</div>
|
|
44
|
+
<template v-else>
|
|
45
|
+
<div class="flex flex-col h-full w-full">
|
|
46
|
+
<div class="w-full h-fit min-h-14 pt-2 pb-2 slidecolor" :class="colorscheme">
|
|
47
|
+
<div class="slidev-layout toptitlebar p-0 pt-0 ml-6 mr-6 mt-auto mb-auto" :class="alignment">
|
|
48
|
+
<slot name="title" />
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
<div class="slidev-layout toptitlecontent h-fit w-full">
|
|
52
|
+
<slot name="content" />
|
|
53
|
+
</div>
|
|
54
|
+
<div class="slidev-layout toptitlecontent h-fit w-full">
|
|
55
|
+
<slot name="default" />
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
</template>
|
|
59
|
+
</template>
|
|
60
|
+
|
|
61
|
+
<style>
|
|
62
|
+
/* the style for this is coming from top-title-two-cols.vue*/
|
|
63
|
+
</style>
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, useSlots } from 'vue'
|
|
3
|
+
import { compute_alignment, compute_column_size } from '../layoutHelper'
|
|
4
|
+
|
|
5
|
+
const slots = useSlots()
|
|
6
|
+
|
|
7
|
+
const props = defineProps({
|
|
8
|
+
columns: {
|
|
9
|
+
default: 'is-one-half',
|
|
10
|
+
},
|
|
11
|
+
align: {
|
|
12
|
+
default: 'l-lt-lt',
|
|
13
|
+
},
|
|
14
|
+
color: {
|
|
15
|
+
default: 'white',
|
|
16
|
+
},
|
|
17
|
+
titlepos: {
|
|
18
|
+
default: 't',
|
|
19
|
+
validator: (value) => {
|
|
20
|
+
return ['t', 'b', 'n'].includes(value)
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
const alignment = computed(() => {
|
|
26
|
+
const parts = props.align.split('-')
|
|
27
|
+
return { t: compute_alignment(parts[0]), l: compute_alignment(parts[1]), r: compute_alignment(parts[2]) }
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
const colwidth = computed(() => compute_column_size(props.columns))
|
|
31
|
+
|
|
32
|
+
const colorscheme = computed(() => {
|
|
33
|
+
return `neversink-${props.color}-scheme`
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
const flexclass = computed(() => {
|
|
37
|
+
if (slots.title != undefined) {
|
|
38
|
+
if (props.titlepos == 't') {
|
|
39
|
+
return 'slidev-layout two-cols-header'
|
|
40
|
+
} else if (props.titlepos == 'b') {
|
|
41
|
+
return 'slidev-layout two-cols-footer'
|
|
42
|
+
} else {
|
|
43
|
+
return 'slidev-layout two-cols'
|
|
44
|
+
}
|
|
45
|
+
} else {
|
|
46
|
+
return 'slidev-layout two-cols'
|
|
47
|
+
}
|
|
48
|
+
})
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<!-- default.vue -->
|
|
52
|
+
<template>
|
|
53
|
+
<div
|
|
54
|
+
v-if="colwidth == 'error' || alignment.t == 'error' || alignment.l == 'error' || alignment.r == 'error'"
|
|
55
|
+
class="slidev-layout default error"
|
|
56
|
+
>
|
|
57
|
+
<span class="warning"><b>Error</b>: invalid layout params.</span>
|
|
58
|
+
<hr />
|
|
59
|
+
<p>
|
|
60
|
+
There are four parameters: <code>columns</code>, <code>align</code>, <code>color</code>, and
|
|
61
|
+
<code>titlepos</code>. Currently: <code>columns: {{ props.columns }}</code
|
|
62
|
+
>, <code>align: {{ props.align }} </code>, <code>color: {{ props.color }} </code>, and
|
|
63
|
+
<code>titlepos: {{ props.titlepos }} </code>.
|
|
64
|
+
</p>
|
|
65
|
+
<p>
|
|
66
|
+
Options for <code>columns</code> are divided into 12 column units. So with <code>columns: is-1-11</code> the left
|
|
67
|
+
column is 1/12 wide and the the right columns is 11/12 wide. The component admits a short had of only specifying
|
|
68
|
+
the left column (<code>columns: is-1</code> does the same thing). In addition there are short hands like
|
|
69
|
+
<code>columns: is-one-quarter</code> which resolves to <code>is-3-9</code>, etc...
|
|
70
|
+
</p>
|
|
71
|
+
<p>
|
|
72
|
+
Here are a bunch of examples:
|
|
73
|
+
<code>
|
|
74
|
+
is-1, is-2, is-3, is-4, is-5, is-6, is-7, is-8, is-9, is-10, is-11, is-1-11, is-2-10, is-3-9, is-4-8, is-5-7,
|
|
75
|
+
is-6-6, is-7-5, is-8-4, is-9-3, is-10-2, is-11-1, is-one-quarter, is-one-third, is-one-half, is-two-thirds,
|
|
76
|
+
is-three-quarters
|
|
77
|
+
</code>
|
|
78
|
+
</p>
|
|
79
|
+
<p>
|
|
80
|
+
In addition you can specify "slots" of the page with <code>:: title ::</code>, <code>:: left ::</code>, and
|
|
81
|
+
<code>:: right::</code>. Title is optional.
|
|
82
|
+
</p>
|
|
83
|
+
<p>
|
|
84
|
+
The <code>align</code> parameter determines how the columns look. The notation is for example
|
|
85
|
+
<code>align: c-cm-cm</code>. The first part is for the title, the second for the left column, and the third part
|
|
86
|
+
is for the right column. The first letter is (<code>c</code> for center, <code>l</code> for left,
|
|
87
|
+
<code>r</code> for right). This applies to all three second. For the columns the second letter is vertical
|
|
88
|
+
alignment (<code>t</code> for top, <code>m</code> for middle, <code>b</code> for bottom).
|
|
89
|
+
</p>
|
|
90
|
+
</div>
|
|
91
|
+
<div v-else class="slidecolor" :class="flexclass + ' ' + colorscheme">
|
|
92
|
+
<div v-if="$slots.title && props.titlepos != 'n'" class="title" :class="alignment.t">
|
|
93
|
+
<slot name="title" />
|
|
94
|
+
</div>
|
|
95
|
+
<div v-if="$slots.left" class="left-col" :class="alignment.l">
|
|
96
|
+
<slot name="left" />
|
|
97
|
+
</div>
|
|
98
|
+
|
|
99
|
+
<div v-if="$slots.right" class="right-col" :class="alignment.r">
|
|
100
|
+
<slot name="right" />
|
|
101
|
+
</div>
|
|
102
|
+
<div v-if="$slots.default" class="end">
|
|
103
|
+
<slot name="default" />
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
</template>
|
|
107
|
+
|
|
108
|
+
<style scoped>
|
|
109
|
+
.slidev-layout.two-cols-header,
|
|
110
|
+
.slidev-layout.two-cols-footer {
|
|
111
|
+
display: grid;
|
|
112
|
+
grid-template-columns: repeat(12, 1fr); /* 12 columns */
|
|
113
|
+
grid-template-rows: auto 1fr auto; /* top header and content */
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.slidev-layout.two-cols {
|
|
117
|
+
display: grid;
|
|
118
|
+
grid-template-columns: repeat(12, 1fr); /* 12 columns */
|
|
119
|
+
grid-template-rows: auto auto; /* top header and content */
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.slidev-layout.two-cols-header .title {
|
|
123
|
+
grid-area: 1 / 1 / 2 / span 12; /* full width */
|
|
124
|
+
margin-bottom: 1rem;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.slidev-layout.two-cols-footer .title {
|
|
128
|
+
grid-area: 3 / 1 / 4 / span 12; /* full width */
|
|
129
|
+
margin-bottom: 1rem;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.slidev-layout.two-cols .left-col,
|
|
133
|
+
.slidev-layout.two-cols-header .left-col,
|
|
134
|
+
.slidev-layout.two-cols-footer .left-col {
|
|
135
|
+
margin-right: 2rem;
|
|
136
|
+
display: flex;
|
|
137
|
+
flex-direction: column;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.slidev-layout.two-cols .right-col,
|
|
141
|
+
.slidev-layout.two-cols-header .right-col,
|
|
142
|
+
.slidev-layout.two-cols-footer .right-col {
|
|
143
|
+
display: flex;
|
|
144
|
+
flex-direction: column;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.slidev-layout.two-cols-header .end,
|
|
148
|
+
.slidev-layout.two-cols-footer .end {
|
|
149
|
+
grid-area: 4 / 1 / 5 / span 12; /* full width */
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.slidev-layout.two-cols .end {
|
|
153
|
+
grid-area: 3 / 1 / 4 / span 12; /* full width */
|
|
154
|
+
}
|
|
155
|
+
</style>
|
|
156
|
+
|
|
157
|
+
<style scoped>
|
|
158
|
+
/* 1-11 */
|
|
159
|
+
.two-cols-footer .left-col,
|
|
160
|
+
.two-cols-header .left-col {
|
|
161
|
+
grid-area: 2 / 1 / 3 / span v-bind(colwidth.l);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.two-cols-footer .right-col,
|
|
165
|
+
.two-cols-header .right-col {
|
|
166
|
+
grid-area: 2 / v-bind(colwidth.l + 1) / 3 / span v-bind(colwidth.r);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.two-cols .left-col {
|
|
170
|
+
grid-area: 1 / 1 / 2 / span v-bind(colwidth.l);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.two-cols .right-col {
|
|
174
|
+
grid-area: 1 / v-bind(colwidth.l + 1) / 2 / span v-bind(colwidth.r);
|
|
175
|
+
}
|
|
176
|
+
</style>
|