Last active
February 8, 2022 12:25
-
-
Save cp-sumi-k/eece9cd98d22ec6d4a3c24f938f112f9 to your computer and use it in GitHub Desktop.
https://blog.canopas.com/animations-with-css-and-vue-transitions-fdb53dbb21e7 - continous-horizontal-animation-1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div class="horizontal-grid"> | |
<div class="horizontal-grid-1"> | |
<div v-for="element in grid1" :key="element.id" class="elements"> | |
{{ element.name }} | |
</div> | |
</div> | |
<div class="horizontal-grid-2"> | |
<div v-for="element in grid2" :key="element.id" class="elements"> | |
{{ element.name }} | |
</div> | |
</div> | |
</div> | |
</template> | |
<script> | |
export default { | |
data() { | |
return { | |
grid1: [ | |
{ | |
id: 1, | |
name: "element1", | |
}, | |
{ | |
id: 2, | |
name: "element2", | |
}, | |
{ | |
id: 3, | |
name: "element3", | |
}, | |
{ | |
id: 4, | |
name: "element4", | |
}, | |
{ | |
id: 5, | |
name: "element5", | |
}, | |
], | |
grid2: [ | |
{ | |
id: 1, | |
name: "element1", | |
}, | |
{ | |
id: 2, | |
name: "element2", | |
}, | |
{ | |
id: 3, | |
name: "element3", | |
}, | |
{ | |
id: 4, | |
name: "element4", | |
}, | |
{ | |
id: 5, | |
name: "element5", | |
}, | |
], | |
}; | |
}, | |
}; | |
</script> | |
<style scoped> | |
.horizontal-grid { | |
overflow-x: hidden; | |
overflow-y: auto; | |
height: 500px; | |
} | |
.horizontal-grid-1, | |
.horizontal-grid-2 { | |
display: flex; | |
} | |
// for triangle view of elements | |
.horizontal-grid-1 { | |
margin-left: 160px; | |
} | |
.elements { | |
border: 1px solid #e2e2e2; | |
border-radius: 16px; | |
padding: 16px; | |
margin: 32px 0 0 32px; | |
flex: 0 0 320px; | |
display: flex; | |
flex-direction: column; | |
justify-content: center; | |
} | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment