Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(#292): update visualization image gallery #297

Merged
merged 7 commits into from
Mar 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/src/assets/css/modules/_button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ a.btn,
background-color: $primary;
color: $primary-white;

&::after {
&::after:not([disabled="disabled"]) {
background-color: $primary;
}
}
Expand Down
5 changes: 5 additions & 0 deletions app/src/assets/css/modules/_pages.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@
&-item-2 {
flex-grow: 1;
align-self: flex-start;
.md-field {
width: 40%;
margin: 0;
padding-top: 0;
}
}
&_btn {
display: block !important;
Expand Down
5 changes: 4 additions & 1 deletion app/src/assets/css/modules/_section.scss
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,10 @@
}

& .img {
max-height: 33rem;
max-height: 40rem;
@include respond(phone) {
max-height: none;
}
aswallace marked this conversation as resolved.
Show resolved Hide resolved
}
}
&__share {
Expand Down
4 changes: 4 additions & 0 deletions app/src/assets/css/modules/_utility.scss
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,10 @@
&_text {
text-align: center;
}
&_content {
justify-content: center;
display: flex;
}
&_other {
margin: 0 auto;
}
Expand Down
29 changes: 25 additions & 4 deletions app/src/assets/css/modules/_visualize.scss
Original file line number Diff line number Diff line change
Expand Up @@ -369,10 +369,12 @@
margin-top: .8rem;
@include respond(tab-port){
margin: 0 auto;
display: grid;
grid-template-rows: repeat(1, 100%);
grid-template-columns: repeat(4, 1fr);
grid-column-gap: 1rem;
&_grid-4 {
display: grid;
grid-template-rows: repeat(1, 100%);
grid-template-columns: repeat(4, 1fr);
grid-column-gap: 1rem;
}
margin: 1rem auto;
max-width: 70%;
}
Expand All @@ -381,6 +383,25 @@
max-width: 100%;
}

& > .pagination-label {
padding: 3.5rem 0.5rem 0rem 0.5rem;
}

& > .pagination-field {
margin-left: 0rem !important;
padding-top: 2.5rem;
@include respond(tab-land){
padding-top: 2.25rem;
}
.md-input {
font-size: 14px !important;
}
.md-error {
transform: translateZ(0) translateX(-2rem);
width: 9rem;
}
}

& > .pagination-button {
display: inline;
padding:10px 24px !important;
Expand Down
30 changes: 27 additions & 3 deletions app/src/components/explorer/Pagination.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
<template>
<div class="viz-pagination-container">
<span>Page {{ cpage }} of {{ tpages }}</span>
<div class="viz-pagination">
<span class="viz-pagination u_centralize_content">
<div class="pagination-label">
Page
</div>
<md-field :class="pgInputClass" class="pagination-field u_width--xs">
<md-input id="pageInput" v-model="pageInput" @change="goToPage($event.target.value)" required></md-input>
<span class="md-error">Out of range</span>
</md-field>
<div class="pagination-label">
of {{ tpages }}
</div>
</span>
<div class="viz-pagination viz-pagination_grid-4">
<button
:disabled="cpage <= 1"
@click.prevent="goToPage(1)"
Expand Down Expand Up @@ -32,10 +43,23 @@ export default {
cpage: Number,
tpages: Number
},
data () {
return {
pageInput: this.cpage
}
},
computed: {
pgInputClass () {
return {
'md-invalid': !this.pageExists(this.pageInput)
}
}
},
methods: {
goToPage (page) {
if (page !== this.cpage) {
if ((page !== this.cpage) && this.pageExists(page)) {
this.$emit('go-to-page', page)
this.pageInput = page
}
},
pageExists (page) {
Expand Down
1 change: 1 addition & 0 deletions app/src/modules/gql/image-gql.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export const SINGLE_IMAGE_QUERY = gql`
id
doi
keywords
authors
}
}
}
Expand Down
Loading