fixed card sizes and update Library views

This commit is contained in:
axolotle
2021-06-28 16:50:39 +02:00
parent c33a4cfce5
commit 60d239450c
8 changed files with 130 additions and 47 deletions
@@ -56,6 +56,7 @@ $grid-breakpoints: (
md: 1024px, md: 1024px,
lg: 1200px, lg: 1200px,
xl: 1440px, xl: 1440px,
xxl: 1920px,
); );
$layout-bp: md; $layout-bp: md;
@@ -173,8 +174,11 @@ $node-card-spacer-sm-x: 8px;
$node-card-spacer-sm-y: 8px; $node-card-spacer-sm-y: 8px;
$node-card-spacer-x: 15px; $node-card-spacer-x: 15px;
$node-card-spacer-y: 10px; $node-card-spacer-y: 10px;
$node-card-width: 560px; $node-card-width: 560px;
$node-card-height: 350px; $node-card-height: 350px;
$node-card-width-sm: $node-card-width / 1.5;
$node-card-height-sm: $node-card-height / 1.5;
// MISC // MISC
$btn-size: 26px; $btn-size: 26px;
@@ -63,5 +63,23 @@ export default {
.popover-body { .popover-body {
padding: 0; padding: 0;
} }
.node-view {
width: $node-card-width-sm;
max-width: 100%;
max-height: 100%;
@include media-breakpoint-up($size-bp) {
width: $node-card-width;
}
&-wrapper {
height: $node-card-height-sm;
@include media-breakpoint-up($size-bp) {
height: $node-card-height;
}
}
}
} }
</style> </style>
+6 -4
View File
@@ -1,7 +1,7 @@
<template> <template>
<article <article
class="node-view" class="node-view"
:class="['node-view-' + mode, 'node-view-' + type, 'node-view-' + nodeVariant]" :class="['node-view-' + mode, 'node-view-' + type, 'node-view-' + nodeVariant, { 'preview': preview }]"
> >
<div v-if="!loading" class="node-view-wrapper" :id="'node-' + node.id"> <div v-if="!loading" class="node-view-wrapper" :id="'node-' + node.id">
<component <component
@@ -78,7 +78,7 @@ export default {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss">
.node-view { .node-view {
position: relative; position: relative;
@@ -93,19 +93,21 @@ export default {
// ╰─╴╵ ╵╵ ╰└─╯ // ╰─╴╵ ╵╵ ╰└─╯
&-card { &-card {
max-width: $node-card-width;
width: 100%; width: 100%;
.node-view-wrapper { .node-view-wrapper {
pointer-events: none; pointer-events: none;
width: 100%; width: 100%;
max-height: $node-card-height;
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
} }
&.node-view-depart { &.node-view-depart {
box-shadow: .5rem .5rem 1rem rgba($black, .25); box-shadow: .5rem .5rem 1rem rgba($black, .25);
.node-view-child-list-group {
box-shadow: .5rem .5rem 1rem rgba($black, .25);
}
} }
} }
+6
View File
@@ -99,6 +99,10 @@ export default {
.node-view-body { .node-view-body {
width: 100%; width: 100%;
img {
max-width: 100%;
}
font: { font: {
family: $font-family-text; family: $font-family-text;
line-height: inherit; line-height: inherit;
@@ -111,6 +115,7 @@ export default {
&-view { &-view {
padding: 0 $node-view-spacer-sm-x; padding: 0 $node-view-spacer-sm-x;
font-size: 1.25rem; font-size: 1.25rem;
word-wrap: break-word;
@include media-breakpoint-up($size-bp) { @include media-breakpoint-up($size-bp) {
padding: 0 $node-view-spacer-x; padding: 0 $node-view-spacer-x;
@@ -128,6 +133,7 @@ export default {
&-card { &-card {
padding: 0 $node-card-spacer-sm-x; padding: 0 $node-card-spacer-sm-x;
font-size: 1.1rem; font-size: 1.1rem;
word-wrap: anywhere;
@include media-breakpoint-up($size-bp) { @include media-breakpoint-up($size-bp) {
font-size: 2rem; font-size: 2rem;
+9
View File
@@ -90,10 +90,19 @@ export default {
.node-view-footer { .node-view-footer {
margin-top: auto; margin-top: auto;
font-family: $font-family-base; font-family: $font-family-base;
font-size: 0.9rem;
@include media-breakpoint-up($size-bp) {
font-size: 1rem;
}
.btn-read { .btn-read {
pointer-events: auto; pointer-events: auto;
} }
.btn {
font-size: inherit;
}
} }
.popover-siblings { .popover-siblings {
+3 -3
View File
@@ -90,7 +90,7 @@ export default {
font-size: 0.65rem; font-size: 0.65rem;
} }
@include media-breakpoint-up(sm) { @include media-breakpoint-up($size-bp) {
font-size: 2rem; font-size: 2rem;
.edition { .edition {
@@ -113,7 +113,7 @@ export default {
font-size: 0.75rem; font-size: 0.75rem;
} }
@include media-breakpoint-up(sm) { @include media-breakpoint-up($size-bp) {
font-size: 2.625rem; font-size: 2.625rem;
.edition { .edition {
@@ -125,7 +125,7 @@ export default {
.node-view-child-list { .node-view-child-list {
display: none; display: none;
@include media-breakpoint-up(md) { @include media-breakpoint-up($layout-bp) {
display: block; display: block;
} }
} }
+39 -21
View File
@@ -77,39 +77,57 @@ export default {
.library-list { .library-list {
overflow-y: auto; overflow-y: auto;
height: 100%; height: 100%;
padding: 0 1.15rem;
@include media-breakpoint-up($size-bp) {
padding: 0 2.15rem;
}
h3 { h3 {
font-family: $font-family-text; font-family: $font-family-text;
line-height: 1; line-height: 1;
font-size: 16.5rem; font-size: 6.25rem;
margin-top: 2rem;
@include media-breakpoint-up($size-bp) {
margin-top: 2rem;
font-size: 16.5rem;
}
} }
&-nodes-group { &-nodes-group {
display: flex; display: grid;
flex-wrap: wrap; grid-gap: 2.2rem;
grid-template-columns: 1fr;
grid-template-rows: auto;
@include media-breakpoint-up(lg) {
grid-gap: 3.4rem;
}
@media (min-width: 650px) {
grid-template-columns: repeat(2, 1fr);
}
@include media-breakpoint-up(lg) {
grid-template-columns: repeat(3, 1fr);
}
@include media-breakpoint-up(xxl) {
grid-template-columns: repeat(4, 1fr);
}
.node-view { .node-view {
margin-bottom: 3.4375rem; max-width: 100%;
$marg: 4.6875rem; height: $node-card-height-sm;
width: 100%;
height: $node-card-height;
@include media-breakpoint-only(md) { @include media-breakpoint-up($size-bp) {
max-width: calc(50% - #{($marg / 2)}); max-width: $node-card-width;
margin-right: $marg; height: $node-card-height;
&:nth-of-type(2n) {
margin-right: 0;
}
} }
@include media-breakpoint-up(lg) { &.preview {
margin-right: $marg; top: -2rem;
max-width: calc(33.33% - #{(($marg * 2) / 3)});
&:nth-of-type(3n) {
margin-right: 0;
}
} }
} }
} }
+45 -19
View File
@@ -84,44 +84,70 @@ export default {
onPreviewNodeClick (ids) { onPreviewNodeClick (ids) {
this.$root.$emit('bv::hide::popover', 'preview-node-' + this.previewNode.id) this.$root.$emit('bv::hide::popover', 'preview-node-' + this.previewNode.id)
this.$emit('open-node', ids) this.$emit('open-node', ids)
this.previewNode = null
} }
}, },
created () { created () {
// JS-BP
const radius = window.innerWidth < 769 ? 700 / 1.5 : 700
this.$store.dispatch('INIT_LIBRARY_MAP').then(nodes => { this.$store.dispatch('INIT_LIBRARY_MAP').then(nodes => {
this.nodes = nodes.map((node, i) => { this.nodes = nodes.map((node, i) => {
return { x: i, rotate: randomUniform(-25, 25)(), data: node } return { x: i, rotate: randomUniform(-25, 25)(), data: node }
}) })
this.simulation.nodes(this.nodes) this.simulation.nodes(this.nodes)
.force('attract', forceManyBody().strength(10)) .force('attract', forceManyBody().strength(10))
.force('collision', forceCollide().radius(650 / 2)) .force('collision', forceCollide().radius(radius / 2))
}) })
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss">
foreignObject { #library-map {
width: $node-card-width; foreignObject {
height: $node-card-height; width: $node-card-width-sm;
x: var(--x); height: $node-card-height-sm;
y: var(--y); x: var(--x);
transform-origin: var(--x) var(--y); y: var(--y);
transform: rotate(var(--r)) translate(-#{$node-card-width / 2}, -#{$node-card-height / 2}); transform-origin: var(--x) var(--y);
overflow: visible; transform: rotate(var(--r)) translate(-#{$node-card-width / 2}, -#{$node-card-height / 2});
overflow: visible;
@include media-breakpoint-up($size-bp) {
width: $node-card-width;
height: $node-card-height;
}
.node-view {
cursor: pointer;
}
}
.node-view { .node-view {
cursor: pointer; width: $node-card-width-sm;
}
}
.node-view.hidden { @include media-breakpoint-up($size-bp) {
border: $line; width: $node-card-width;
border-style: dashed; }
background-color: transparent;
::v-deep .node-view-wrapper { &-wrapper {
opacity: 0; height: $node-card-height-sm;
@include media-breakpoint-up($size-bp) {
height: $node-card-height;
}
}
&.hidden {
border: $line;
border-style: dashed;
background-color: transparent;
.node-view-wrapper {
opacity: 0;
}
}
} }
} }
</style> </style>