update
This commit is contained in:
67
frontend/src/components/WorkedExampleBlock.vue
Normal file
67
frontend/src/components/WorkedExampleBlock.vue
Normal file
@@ -0,0 +1,67 @@
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { renderMarkdownInline } from '../markdown.js'
|
||||
|
||||
defineProps({ beispiele: { type: Array, default: () => [] } })
|
||||
const offen = ref(false)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div v-if="beispiele.length" class="worked">
|
||||
<button class="art-head" @click="offen = !offen">
|
||||
<span class="art-icon">📝</span> Beispiele
|
||||
<span class="art-count">{{ beispiele.length }}</span>
|
||||
<span class="art-toggle">{{ offen ? '▾' : '▸' }}</span>
|
||||
</button>
|
||||
<div v-if="offen" class="we-body">
|
||||
<div v-for="(b, i) in beispiele" :key="i" class="we-card">
|
||||
<div v-if="b.subbaustein" class="we-sub">{{ b.subbaustein }}</div>
|
||||
<div class="we-problem" v-html="renderMarkdownInline(b.problem)"></div>
|
||||
<ol class="we-schritte">
|
||||
<li v-for="(s, j) in b.schritte" :key="j" v-html="renderMarkdownInline(s)"></li>
|
||||
</ol>
|
||||
<div v-if="b.ergebnis" class="we-ergebnis">
|
||||
<span class="we-label">Ergebnis</span>
|
||||
<span v-html="renderMarkdownInline(b.ergebnis)"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.worked { margin-top: 0.5rem; }
|
||||
.art-head {
|
||||
display: flex; align-items: center; gap: 8px; width: 100%;
|
||||
background: none; border: none; cursor: pointer; padding: 0.35rem 0;
|
||||
font-size: 0.82rem; font-weight: 600; color: var(--text-muted);
|
||||
}
|
||||
.art-icon { font-size: 0.95rem; }
|
||||
.art-count {
|
||||
background: var(--panel-soft); border: 1px solid var(--border);
|
||||
border-radius: 999px; padding: 0 0.45rem; font-size: 0.72rem;
|
||||
}
|
||||
.art-toggle { margin-left: auto; color: var(--text-faint); }
|
||||
|
||||
.we-body { margin-top: 0.4rem; display: flex; flex-direction: column; gap: 0.6rem; }
|
||||
.we-card {
|
||||
border: 1px solid var(--border); border-left: 3px solid var(--accent);
|
||||
border-radius: 8px; padding: 0.7rem 0.9rem; background: var(--panel-soft);
|
||||
font-size: 0.92rem; line-height: 1.5;
|
||||
}
|
||||
.we-sub {
|
||||
font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em;
|
||||
color: var(--text-faint); font-weight: 700; margin-bottom: 0.3rem;
|
||||
}
|
||||
.we-problem { font-weight: 600; margin-bottom: 0.4rem; }
|
||||
.we-schritte { margin: 0 0 0.4rem 1.1rem; padding: 0; }
|
||||
.we-schritte li { margin: 0.2rem 0; }
|
||||
.we-ergebnis {
|
||||
display: flex; gap: 6px; align-items: baseline;
|
||||
padding-top: 0.35rem; border-top: 1px dashed var(--border);
|
||||
}
|
||||
.we-label {
|
||||
font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.05em;
|
||||
color: var(--success); font-weight: 700;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user