Updated styles

This commit is contained in:
Kamil Niemczycki 2021-09-07 14:36:38 +02:00
parent 8d4f9985e2
commit 651169c232
4 changed files with 69 additions and 46 deletions

View File

@ -11,12 +11,27 @@ h2 {
p { p {
font-size: 1.1em; font-size: 1.1em;
line-height: 1.4em; line-height: 1.4em;
padding-bottom: 10px; &:not(&:last-of-type) {
padding-bottom: 10px;
}
} }
.container { .container {
max-width: 1200px; max-width: 1200px;
margin: 0 auto; margin: 0 auto;
} }
.loading {
height: 300px;
.loading-animation {
margin: 20px auto;
width: 50px;
height: 50px;
border: 5px solid #f3f3f3;
border-top: 10px #A2CF00 solid;
border-radius: 50%;
animation: loading-animation 1s linear infinite;
}
}
@media screen and (max-width: 1200px) { @media screen and (max-width: 1200px) {
.container { .container {
padding: 0 20px; padding: 0 20px;

View File

@ -56,35 +56,33 @@
.buttons { .buttons {
display: flex; display: flex;
justify-content: flex-start; justify-content: flex-start;
padding: 10px 0; padding: 25px 0;
.btn { .btn {
margin-right: 20px; margin-right: 20px;
&:last-of-type {
&:last-child {
margin-right: 0; margin-right: 0;
} }
}
}
@media screen and (max-width: 900px) { @media screen and (max-width: 600px) {
.buttons { margin: 0 auto 15px;
justify-content: center;
margin-bottom: 25px;
}
}
@media screen and (max-width: 600px) {
.buttons {
display: block;
margin-bottom: 25px;
.btn {
margin: 0 auto 20px;
&:last-child { &:last-child {
margin: 0 auto; margin: 0 auto;
} }
} }
} }
@media screen and (max-width: 900px) {
justify-content: center;
margin-bottom: 25px;
}
@media screen and (max-width: 600px) {
display: block;
margin-bottom: 25px;
}
} }
@media screen and (max-width: 400px) { @media screen and (max-width: 400px) {

View File

@ -32,6 +32,9 @@
</div> </div>
</div> </div>
</section> </section>
<div v-else class="loading">
<div class="loading-animation"></div>
</div>
</template> </template>
<script> <script>
@ -78,6 +81,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
@import "scss/default"; @import "scss/default";
.project { .project {
.project-header { .project-header {
@extend .container; @extend .container;
@ -129,21 +133,30 @@ export default {
.project-photo { .project-photo {
box-shadow: 5px 5px 10px rgba(0, 0, 0, .3); box-shadow: 5px 5px 10px rgba(0, 0, 0, .3);
} }
.project-photo, .project-photo img { .project-photo, .project-photo img {
width: 100%; width: 100%;
} }
.project-photo img { .project-photo img {
display: block; display: block;
object-fit: cover; object-fit: cover;
max-height: 500px; max-height: 500px;
} }
.content { .content {
margin: 25px 0; margin: 35px 0;
font-weight: lighter;
font-size: .9em; p {
} text-align: justify;
p::first-line { text-indent: 1.5em;
text-indent: 5px; line-height: 1.8em;
@media screen and (max-width: 600px) {
font-size: 1em;
line-height: 1.5em;
}
}
} }
} }
} }

View File

@ -26,6 +26,7 @@
display: flex; display: flex;
justify-content: center; justify-content: center;
list-style: none; list-style: none;
.category { .category {
position: relative; position: relative;
cursor: pointer; cursor: pointer;
@ -37,9 +38,11 @@
color: black; color: black;
} }
} }
&:last-child { &:last-child {
margin-right: 0; margin-right: 0;
} }
&-active { &-active {
&::after { &::after {
content: ''; content: '';
@ -62,22 +65,12 @@
} }
} }
} }
.projects { .projects {
padding-top: 25px; padding-top: 25px;
padding-bottom: 25px; padding-bottom: 25px;
} }
.loading {
height: 300px;
.loading-animation {
margin: 20px auto;
width: 50px;
height: 50px;
border: 5px solid #f3f3f3;
border-top: 10px #A2CF00 solid;
border-radius: 50%;
animation: loading-animation 1s linear infinite;
}
}
@keyframes loading-animation { @keyframes loading-animation {
0% { 0% {
transform: rotate(0); transform: rotate(0);
@ -86,6 +79,7 @@
transform: rotate(360deg); transform: rotate(360deg);
} }
} }
@keyframes load-underline { @keyframes load-underline {
from { from {
width: 0; width: 0;
@ -115,22 +109,25 @@ export default {
return this.$store.getters.getCategories return this.$store.getters.getCategories
} }
}, },
async mounted () { mounted () {
await this.$store.dispatch('fetchCategories') this.loadAllData()
await this.$store.dispatch('fetchProjects').then(projects => {
projects.sort((firstProduct, secondProduct) => {
return secondProduct.id - firstProduct.id
})
this.projects = projects
}).catch(error => {
console.log(error)
})
}, },
destroyed () { destroyed () {
this.$store.commit('resetHeaderTitle') this.$store.commit('resetHeaderTitle')
this.$store.commit('resetHeaderDescription') this.$store.commit('resetHeaderDescription')
}, },
methods: { methods: {
async loadAllData () {
await this.$store.dispatch('fetchCategories')
await this.$store.dispatch('fetchProjects').then(projects => {
projects.sort((firstProduct, secondProduct) => {
return secondProduct.id - firstProduct.id
})
this.projects = projects
}).catch(error => {
console.log(error)
})
},
loadListWhereCategory (category) { loadListWhereCategory (category) {
this.projects = [] this.projects = []
setTimeout(() => { setTimeout(() => {