slidev-theme-tud-db 0.0.2 → 0.0.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/global-bottom.vue CHANGED
@@ -1,23 +1,45 @@
1
1
  <script setup lang="ts">
2
2
  import { useSlideContext } from '@slidev/client'
3
3
  import { computed } from 'vue'
4
+ import { slideLogos } from './scripts/logo'
4
5
 
5
6
  import ddrgColor from './assets/ddrg-color.svg'
7
+ import ddrgWhite from './assets/ddrg-white.svg'
8
+ import tudWhite from './assets/tud-white.svg'
6
9
  import tudBlack from './assets/tud-black.svg'
7
10
 
8
11
  const { $nav } = useSlideContext()
9
- const showChrome = computed(() => $nav.value?.currentLayout !== 'cover' && $nav.value?.currentLayout !== 'section-num')
12
+ const logos = computed(() => slideLogos[$nav.value.currentPage] ?? {})
10
13
  </script>
11
14
 
12
15
  <template>
13
- <div
14
- :class="{ 'opacity-0': !showChrome }"
15
- class="db-global-chrome absolute inset-0 z-100 pointer-events-none transition-opacity duration-500"
16
- >
17
- <img class="absolute top-[25px] right-[35px] h-[45px]" :src="ddrgColor" alt="Dresden Database Research Group" />
16
+ <div class="absolute inset-0 z-100 pointer-events-none">
17
+ <div class="absolute flex flex-row-reverse items-start gap-[45px] top-[25px] right-[35px]">
18
+ <div class="relative h-[45px]">
19
+ <img
20
+ :class="{ 'opacity-0': logos.ddrg !== 'color' }"
21
+ class="h-full transition-opacity duration-500"
22
+ :src="ddrgColor"
23
+ alt="Dresden Database Research Group"
24
+ />
25
+ <img
26
+ :class="{ 'opacity-0': logos.ddrg !== 'white' }"
27
+ class="absolute inset-0 h-full transition-opacity duration-500"
28
+ :src="ddrgWhite"
29
+ alt="Dresden Database Research Group"
30
+ />
31
+ </div>
32
+ <img
33
+ :class="{ 'opacity-0': !logos.tud }"
34
+ class="h-[45px] transition-opacity duration-500"
35
+ :src="tudWhite"
36
+ alt="TU Dresden"
37
+ />
38
+ </div>
18
39
 
19
40
  <footer
20
- class="db-footer absolute inset-x-0 bottom-0 h-[40px] px-[30px] flex items-center justify-between bg-[var(--db-footer-bg)] pointer-events-auto"
41
+ :class="{ 'opacity-0': !logos.footer }"
42
+ class="db-footer absolute inset-x-0 bottom-0 h-[40px] px-[30px] flex items-center justify-between bg-[var(--db-footer-bg)] pointer-events-auto transition-opacity duration-500"
21
43
  >
22
44
  <img class="h-[25px]" :src="tudBlack" alt="TU Dresden" />
23
45
  <span class="text-[12px] text-[var(--db-text)]">
package/layouts/cover.vue CHANGED
@@ -1,32 +1,15 @@
1
1
  <script setup lang="ts">
2
- // "Titelfolie" — navy band (top, with the DDRG mosaic + both logos) + white
3
- // title area below. Reconstructed as pure vector: the navy is a CSS fill, the
4
- // corner mosaic is `cover-mosaic.svg` (rebuilt from the original DB_template.potx
5
- // title-slide tiles), and the logos are the theme's own white SVGs. No raster.
6
- // Geometry (positions/sizes in pt == px on the 720-wide canvas) is taken from
7
- // slideLayout1.xml ("Titelfolie") so it matches the source template.
2
+ import { useLogo } from '../scripts/logo'
8
3
  import mosaic from '../assets/mosaic.svg'
9
- import tudWhite from '../assets/tud-white.svg'
10
- import ddrgWhite from '../assets/ddrg-white.svg'
4
+
5
+ useLogo({ ddrg: 'white', tud: true })
11
6
  </script>
12
7
 
13
8
  <template>
14
9
  <div class="slidev-layout db-cover p-0">
15
- <!-- navy band: solid fill + vector mosaic + logos, all overlaid -->
10
+ <!-- navy band: solid fill + vector mosaic, logos handled by global-bottom -->
16
11
  <div class="relative w-full h-[345px] bg-[var(--db-navy)] overflow-hidden">
17
12
  <img class="absolute h-full scale-[1.01]" :src="mosaic" alt="" />
18
- <div class="absolute flex gap-[45px] top-[25px] right-[35px]">
19
- <img
20
- class="h-[45px]"
21
- :src="tudWhite"
22
- alt="TU Dresden"
23
- />
24
- <img
25
- class="h-[45px]"
26
- :src="ddrgWhite"
27
- alt="Dresden Database Research Group"
28
- />
29
- </div>
30
13
  </div>
31
14
 
32
15
  <!-- white area: title (#) + subtitle (following text) -->
@@ -1,9 +1,13 @@
1
1
  <script setup lang="ts">
2
+ import { useLogo } from '../scripts/logo'
3
+
2
4
  // "Titel und Inhalt": title + single content column. Chrome via DbFrame.
3
5
  // `codeSize` frontmatter (optional) overrides the code font size for the slide.
4
6
  const props = defineProps({
5
7
  codeSize: { type: String, default: '' },
6
8
  })
9
+
10
+ useLogo({ ddrg: 'color', footer: true })
7
11
  </script>
8
12
 
9
13
  <template>
@@ -2,9 +2,9 @@
2
2
  import { useSlideContext } from '@slidev/client'
3
3
  import { computed } from 'vue'
4
4
 
5
- import mosaic from '../assets/section-mosaic.svg'
6
- import tudWhite from '../assets/tud-white.svg'
7
- import ddrgWhite from '../assets/ddrg-white.svg'
5
+ import { useLogo } from '../scripts/logo'
6
+
7
+ useLogo({ ddrg: 'white', tud: true })
8
8
 
9
9
  // The large glyph in the blue area can be overridden per slide via the `num`
10
10
  // frontmatter, e.g.
@@ -49,18 +49,6 @@ const num = computed(() => {
49
49
  v-if="num !== ''"
50
50
  class="absolute font-700 text-[24rem]/[24rem] pt-8 px-4 bg-white bg-clip-text text-transparent"
51
51
  >{{ num }}</div>
52
- <div class="absolute flex gap-[45px] top-[25px] right-[35px]">
53
- <img
54
- class="h-[45px]"
55
- :src="tudWhite"
56
- alt="TU Dresden"
57
- />
58
- <img
59
- class="h-[45px]"
60
- :src="ddrgWhite"
61
- alt="Dresden Database Research Group"
62
- />
63
- </div>
64
52
  </div>
65
53
 
66
54
  <!-- white area: title (#) + subtitle (following text) -->
@@ -1,18 +1,13 @@
1
1
  <script setup lang="ts">
2
- // "Titelfolie" — navy band (top, with the DDRG mosaic + both logos) + white
3
- // title area below. Reconstructed as pure vector: the navy is a CSS fill, the
4
- // corner mosaic is `cover-mosaic.svg` (rebuilt from the original DB_template.potx
5
- // title-slide tiles), and the logos are the theme's own white SVGs. No raster.
6
- // Geometry (positions/sizes in pt == px on the 720-wide canvas) is taken from
7
- // slideLayout1.xml ("Titelfolie") so it matches the source template.
2
+ import { useLogo } from '../scripts/logo'
8
3
  import mosaic from '../assets/section-mosaic.svg'
9
- import tudWhite from '../assets/tud-white.svg'
10
- import ddrgWhite from '../assets/ddrg-white.svg'
4
+
5
+ useLogo({ ddrg: 'color', footer: true })
11
6
  </script>
12
7
 
13
8
  <template>
14
9
  <div class="slidev-layout db-cover p-0">
15
- <!-- navy band: solid fill + vector mosaic + logos, all overlaid -->
10
+ <!-- blue band: solid fill + vector mosaic -->
16
11
  <div class="relative w-full mt-[95px] h-[250px] bg-[#97c6ff] overflow-hidden">
17
12
  <img class="absolute h-full scale-[1.01]" :src="mosaic" alt="" />
18
13
  </div>
@@ -1,4 +1,6 @@
1
1
  <script setup lang="ts">
2
+ import { useLogo } from '../scripts/logo'
3
+
2
4
  // Like two-cols-header, but the two columns are laid out as a ROW GRID: every
3
5
  // top-level <div> in the `::grid::` slot becomes a cell, filling left, right,
4
6
  // left, right… Because CSS grid rows align across columns, paired items (e.g. a
@@ -19,6 +21,8 @@ const props = defineProps({
19
21
  columns: { type: String, default: '1fr 1fr' },
20
22
  codeSize: { type: String, default: '' },
21
23
  })
24
+
25
+ useLogo({ ddrg: 'color', footer: true })
22
26
  </script>
23
27
 
24
28
  <template>
@@ -1,4 +1,6 @@
1
1
  <script setup lang="ts">
2
+ import { useLogo } from '../scripts/logo'
3
+
2
4
  // "Zwei Inhalte": full-width title (default slot) + two columns. Chrome via DbFrame.
3
5
  // Column ratio is configurable per slide via the `columns` frontmatter, e.g.
4
6
  // layout: two-cols-header
@@ -7,6 +9,8 @@ const props = defineProps({
7
9
  columns: { type: String, default: '1fr 1fr' },
8
10
  codeSize: { type: String, default: '' },
9
11
  })
12
+
13
+ useLogo({ ddrg: 'color', footer: true })
10
14
  </script>
11
15
 
12
16
  <template>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "slidev-theme-tud-db",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "type": "module",
5
5
  "description": "Slidev theme cloning the TU Dresden / Dresden Database Research Group PowerPoint template",
6
6
  "license": "GPL-3.0-or-later",
@@ -24,6 +24,7 @@
24
24
  "components",
25
25
  "global-bottom.vue",
26
26
  "layouts",
27
+ "scripts",
27
28
  "markdown.ts",
28
29
  "setup",
29
30
  "styles",
@@ -0,0 +1,29 @@
1
+ import { reactive, toValue, watchEffect } from 'vue'
2
+ import type { MaybeRefOrGetter } from 'vue'
3
+ import { useSlideContext } from '@slidev/client'
4
+
5
+ function createRegistry<T>() {
6
+ const store = reactive<Record<number, T>>({})
7
+
8
+ function publish(value: MaybeRefOrGetter<T>) {
9
+ const page = toValue(useSlideContext().$page)
10
+ watchEffect(() => {
11
+ store[page] = toValue(value)
12
+ })
13
+ }
14
+
15
+ return { store, publish }
16
+ }
17
+
18
+ export interface SlideLogos {
19
+ ddrg?: 'color' | 'white'
20
+ tud?: boolean
21
+ footer?: boolean
22
+ }
23
+
24
+ const slideLogosReg = createRegistry<SlideLogos>()
25
+ export const slideLogos = slideLogosReg.store
26
+
27
+ export function useLogo(logos: MaybeRefOrGetter<SlideLogos>) {
28
+ slideLogosReg.publish(logos)
29
+ }