Skip to content

Commit a6bdee9

Browse files
committed
Implement minor slide editor redesign, improve 'full slide' functionality
1 parent 2f3e83f commit a6bdee9

17 files changed

+541
-364
lines changed

src/components/chart-editor.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="block">
2+
<div class="block mt-3">
33
<!-- Menu with option to add a new chart -->
44
<div class="flex items-center">
55
<span class="font-bold px-4">{{

src/components/dynamic-editor.vue

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<template>
2-
<div class="block">
2+
<div class="block mt-2">
33
<!-- left and right panel buttons for dynamic panels -->
44
<div class="flex">
55
<button
66
@click="() => changePanel('text')"
7-
class="editor-button border hover:bg-gray-100"
8-
:class="editingStatus === 'text' ? 'border-black' : 'border-gray-300'"
7+
class="editor-button rounded-none rounded-l border hover:bg-gray-100"
8+
:class="editingStatus === 'text' ? 'border-black font-bold' : 'border-gray-300'"
99
>
1010
{{ $t('dynamic.textSection') }}
1111
</button>
1212
<button
1313
@click="() => changePanel('panels')"
14-
class="editor-button border hover:bg-gray-100"
15-
:class="editingStatus !== 'text' ? 'border-black' : 'border-gray-300'"
14+
class="editor-button rounded-none rounded-r border hover:bg-gray-100"
15+
:class="editingStatus !== 'text' ? 'border-black font-bold' : 'border-gray-300'"
1616
>
1717
{{ $t('dynamic.panel.collection') }}
1818
</button>
@@ -61,7 +61,7 @@
6161
<p v-if="idUsed">{{ $t('dynamic.panel.idTaken') }}</p>
6262
</td>
6363
<td>
64-
<select v-model="newSlideType">
64+
<select v-model="newSlideType" class="editor-input rounded shadow">
6565
<option v-for="thing in Object.keys(editors)" :key="thing">
6666
{{ thing }}
6767
</option>
@@ -311,7 +311,7 @@ export default class DynamicEditorV extends Vue {
311311
width: 150px !important;
312312
text-align: center;
313313
font-weight: normal;
314-
border: 1px solid black;
314+
//border: 1px solid black;
315315
padding: 2px !important;
316316
margin-top: 0 !important;
317317
}

src/components/editor.vue

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@
154154
<!-- Save changes button -->
155155
<button
156156
@click="saveChanges"
157-
class="editor-button m-0 bg-black text-white hover:bg-gray-900"
157+
class="editor-button m-0 bg-black text-white hover:bg-gray-900 border border-black"
158158
:disabled="saving"
159159
>
160160
<span class="inline-block">{{
@@ -287,10 +287,10 @@
287287
></slide-toc>
288288
</div>
289289
<!-- Right side -->
290-
<div class="editor-area flex flex-col space-between w-full overflow-y-auto">
290+
<div class="w-full">
291291
<!-- Slide editor -->
292292
<slide-editor
293-
class="flex-1 w-full overflow-y-auto"
293+
class="editor-area w-full"
294294
ref="slide"
295295
:configFileStructure="configFileStructure"
296296
:currentSlide="currentSlide"
@@ -612,22 +612,22 @@ window.addEventListener('resize', () => {
612612
}
613613
614614
.editor-label {
615-
width: 10vw;
616-
text-align: right;
617-
margin-right: 15px;
618-
display: inline-block;
615+
font-weight: 600;
616+
text-align: left;
619617
}
620618
621619
.editor-h3 {
622620
font-size: larger;
623621
}
624622
625623
.editor-input {
626-
padding: 10px 10px;
627-
margin-top: 5px;
628-
border: 1px solid black;
629-
display: inline;
624+
padding: 7px 10px;
625+
margin-top: 3px;
626+
border: 1px solid #a1a1a1;
627+
//display: inline;
630628
border-radius: 5px;
629+
--tw-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
630+
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
631631
}
632632
633633
.editor-container .input-error {
@@ -636,13 +636,14 @@ window.addEventListener('resize', () => {
636636
}
637637
638638
.editor-button {
639+
border-radius: 3px;
639640
padding: 5px 12px;
640641
font-weight: 600;
641642
transition-duration: 0.2s;
642643
}
643644
644645
.editor-forms-button {
645-
padding: 11px 15px;
646+
padding: 8px 15px;
646647
border-radius: 5px;
647648
}
648649
@@ -651,8 +652,12 @@ window.addEventListener('resize', () => {
651652
color: black;
652653
}
653654
654-
.editor-button:focus {
655+
button:focus,
656+
.editor-button:focus,
657+
input:focus,
658+
select:focus {
655659
outline: 2px solid royalblue;
660+
z-index: 2;
656661
outline-offset: 2px;
657662
transition-duration: 0.075s;
658663
}
@@ -709,8 +714,8 @@ window.addEventListener('resize', () => {
709714
@media only screen and (min-width: 768px) {
710715
.editor-area {
711716
overflow-y: auto;
712-
height: calc(100vh - 63px);
713-
height: calc(calc(var(--vh, 1vh) * 100) - 63px);
717+
//height: calc(100vh - 80px);
718+
height: calc(calc(var(--vh, 1vh) * 100) - 100px);
714719
}
715720
}
716721
@@ -729,6 +734,7 @@ window.addEventListener('resize', () => {
729734
font-weight: 600;
730735
border: 1px solid black;
731736
transition: background-color 0.2s;
737+
border-radius: 3px;
732738
}
733739
734740
/* Main dropdown icon - required for positioning */

src/components/helpers/action-modal.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<template>
22
<vue-final-modal
33
:modalId="name"
4+
:clickToClose="false"
45
content-class="flex flex-col max-h-full overflow-y-auto max-w-xl mx-4 p-4 bg-white border rounded-lg space-y-2"
56
class="flex justify-center items-center"
67
>
@@ -65,6 +66,12 @@ button {
6566
color: black;
6667
}
6768
69+
.vfm__content button:focus {
70+
outline: 2px solid royalblue;
71+
outline-offset: 2px;
72+
transition-duration: 0.075s;
73+
}
74+
6875
.vfm__content button:disabled {
6976
border: 1px solid gray;
7077
color: gray;

src/components/helpers/chart-preview.vue

Lines changed: 22 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,20 @@
22
<li class="chart-item items-center mt-8 mx-5 overflow-hidden">
33
<div class="relative border-solid border-2 items-center justify-center text-center w-full">
44
<button
5-
class="editor-button bg-white absolute h-6 w-6 leading-5 rounded-full top-2 left-0 p-0 z-10 cursor-pointer"
5+
class="editor-button bg-white absolute h-6 w-6 leading-5 rounded-full top-2 left-2 p-0 z-10 cursor-pointer"
66
@click="() => $emit('delete', chart)"
77
:content="$t('editor.chart.delete')"
88
v-tippy="{ placement: 'top', hideOnClick: false, animateFill: true }"
99
:aria-label="$t('editor.chart.delete')"
1010
>
11-
<svg
12-
class="absolute transform -translate-x-1/2 -translate-y-1/2"
13-
height="22px"
14-
width="22px"
15-
viewBox="0 0 352 512"
16-
xmlns="http://www.w3.org/2000/svg"
17-
>
11+
<svg height="22px" width="22px" viewBox="0 0 352 512" xmlns="http://www.w3.org/2000/svg">
1812
<path
1913
d="M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"
2014
/>
2115
</svg>
2216
</button>
2317
<button
24-
class="editor-button bg-white absolute h-6 w-6 leading-5 rounded-full bottom-2 -right-1 p-0 z-10 handle"
18+
class="editor-button bg-white absolute h-6 w-6 leading-5 rounded-full bottom-2 right-2 p-0 z-10 handle"
2519
:aria-label="$t('editor.chart.delete')"
2620
>
2721
<svg xmlns="http://www.w3.org/2000/svg" fill="#000000" width="22px" height="22px" viewBox="0 0 24 24">
@@ -42,32 +36,29 @@
4236
></storylines-chart>
4337
</div>
4438
<!-- chart description and edit -->
45-
<div class="flex mt-4 items-center flex-wrap">
46-
<div class="flex flex-2 w-4/5" style="min-width: 130px">
47-
<div class="flex flex-col mr-2 justify-between">
48-
<label class="name-label font-bold"> {{ $t('editor.chart.label.name') }}: </label>
49-
<label :for="'chartPreviewCaption' + index" class="name-label font-bold pb-2">
50-
{{ $t('editor.image.label.caption') }}:
51-
</label>
52-
</div>
53-
<div class="flex flex-col justify-between">
54-
<label class="name-label font-bold">
55-
<span class="font-normal break-all">{{ chartName }}</span>
56-
</label>
57-
<input
58-
:id="'chartPreviewCaption' + index"
59-
class="editor-input w-5/6"
60-
type="text"
61-
v-model="chart.caption"
62-
:placeholder="$t('editor.caption.placeholder')"
63-
@input="$emit('captionEdit')"
64-
/>
65-
</div>
39+
<div class="flex flex-col-reverse lg:flex-row mt-4 items-start flex-wrap gap-2 gap-x-2 px-1 pb-1">
40+
<div class="flex-1 flex flex-col w-full">
41+
<label class="editor-label"> {{ $t('editor.chart.label.name') }}</label>
42+
<label class="name-label font-bold">
43+
<span class="font-normal break-all">{{ chartName }}</span>
44+
</label>
45+
46+
<label :for="'chartPreviewCaption' + index" class="editor-label mt-2">
47+
{{ $t('editor.image.label.caption') }}
48+
</label>
49+
<input
50+
:id="'chartPreviewCaption' + index"
51+
class="editor-input w-full"
52+
type="text"
53+
v-model="chart.caption"
54+
:placeholder="$t('editor.caption.placeholder')"
55+
@input="$emit('captionEdit')"
56+
/>
6657
</div>
6758

6859
<!-- edit button -->
6960
<button
70-
class="editor-button chart-btn bg-gray-100 cursor-pointer hover:bg-gray-200 m-0 mt-4"
61+
class="editor-button chart-btn bg-gray-100 cursor-pointer hover:bg-gray-200"
7162
:id="`edit-${chart.name}-btn`"
7263
>
7364
<div class="flex items-center">

src/components/helpers/image-preview.vue

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ export default class ImagePreviewV extends Vue {
3939
<style lang="scss" scoped>
4040
.image-item {
4141
width: 30%;
42-
4342
cursor: move; // fallback
4443
cursor: grab;
4544
cursor: -moz-grab;
@@ -61,4 +60,16 @@ export default class ImagePreviewV extends Vue {
6160
padding: 0 !important;
6261
}
6362
}
63+
64+
@media only screen and (max-width: 1500px) {
65+
.image-item {
66+
width: 41%;
67+
}
68+
}
69+
70+
@media only screen and (max-width: 900px) {
71+
.image-item {
72+
width: 90%;
73+
}
74+
}
6475
</style>

0 commit comments

Comments
 (0)