You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

264 lines
5.5 KiB

1 month ago
<script setup>
const config1 = {
dir: 'ttb', // This makes the carousel vertical
itemsToShow: 4,
1 month ago
snapAlign: 'center',
height: '600px',
1 month ago
wrapAround: true,
// touchDrag: false,
1 month ago
gap: 50,
breakpoints: {
300: {
itemsToShow: 2,
snapAlign: 'center',
height: '200px',
gap: 20,
},
419: {
itemsToShow: 3,
snapAlign: 'start',
height: '400px',
gap: 20,
},
768: {
itemsToShow: 4,
snapAlign: 'center',
height: '800px',
gap: 100,
},
1440: {
itemsToShow: 4,
snapAlign: 'center',
height: '1000px',
gap: 100,
},
1 month ago
}
1 month ago
}
</script>
<template>
<section id="projects">
<div class="text-container">
1 month ago
<h1>Projects</h1>
<p>Nisi anim occaecat aliqua sunt sint elit commodo sit consequat ullamco mollit commodo.</p>
</div>
<div class="grid-container">
<div class="carousel-container">
<Carousel v-bind="config1" class="carousel" ref="mainCarousel" @beforeChange="updateTitleCarousel">
1 month ago
<Slide v-for="slide in img" :key="slide" class="slide">
<img :src="slide" alt="l" class="carousel-item" style="width: 100%;">
1 month ago
</Slide>
<template #addons>
<Navigation />
</template>
</Carousel>
</div>
<div class="title-container">
<div class="project-container">
<div v-for="test in projects" :key="test" class="title" @click="test2(1)" tabindex="0">
<div class="img-container">
<img :src="test.image[0]" alt="l" class="carousel-item">
</div>
<div class="title-text">
<h1>{{ test.name }}</h1>
<!-- <h3>zzzz</h3> -->
<span id="line"></span>
<p>{{ test.text[0] }}</p>
<!-- <h3>lllll</h3> -->
</div>
1 month ago
</div>
</div>
</div>
</div>
</section>
</template>
<script>
import { Carousel, Slide, Navigation } from 'vue3-carousel';
import Data from '../data/projects.json';
1 month ago
import 'vue3-carousel/dist/carousel.css';
export default {
components: { Carousel, Slide, Navigation },
1 month ago
data() {
return {
config: {},
1 month ago
currentSlide: 0,
projects: Data,
1 month ago
img: null,
detail: null
1 month ago
};
},
methods: {
test2(p) {
const id = p - 1;
console.log(id);
this.img = this.projects[id]?.image;
1 month ago
},
detail(T) {
1 month ago
const id = T - 1;
this.detail = this.projects[id]?.text;
console.log(this.detail);
1 month ago
}
},
};
</script>
<style scoped>
.projects {
margin-bottom: 800px;
}
1 month ago
#projects {
margin-bottom: 0vw;
1 month ago
}
.carousel .carousel__pagination {
display: flex;
flex-direction: row;
position: absolute;
bottom: 0;
}
.carousel__pagination-button {
/* background-color: aqua; */
1 month ago
width: 0;
}
#projects>.text-container {
1 month ago
width: 40%;
padding: 10%;
}
#line {
1 month ago
display: block;
background-color: black;
width: 40%;
height: 3px;
margin-top: 3%;
}
.title {
border-radius: 5px;
display: grid;
grid-template-columns: 1fr 1fr;
1 month ago
/* height: 15%; */
/* width: 100%; */
transition: all 0.2s ease-in;
gap: 5%;
1 month ago
}
.text {
1 month ago
border-radius: 5px;
width: 100%;
height: 15%;
1 month ago
}
.text h3 {
font-size: 16px;
1 month ago
font-weight: 100;
}
.grid-container {
1 month ago
width: 100%;
display: grid;
grid-template-columns: 1fr 1fr;
1 month ago
justify-content: center;
align-items: center;
/* height: 60vw; */
gap: 5px;
1 month ago
}
.title-container {
1 month ago
cursor: pointer;
/* display: grid; */
/* grid-template-columns: 1fr 1fr; */
1 month ago
align-items: center;
justify-content: center;
flex-direction: row;
height: 100%;
/* max-width: 70%; */
1 month ago
gap: 1vw;
}
.title:focus {
border-bottom: solid 5px;
border-color: black;
border-radius: 0;
1 month ago
}
.project-container {
1 month ago
height: 100%;
width: 100%;
1 month ago
display: flex;
align-items: center;
justify-content: start;
1 month ago
gap: 5%;
flex-direction: column;
}
.title-text {
1 month ago
height: 100%;
display: flex;
flex-direction: column;
/* align-items: center; */
justify-content: start;
1 month ago
gap: 5%;
}
.carousel-container {
1 month ago
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
1 month ago
}
.carousel {
1 month ago
width: 50%;
min-width: 50%;
1 month ago
height: 100%;
}
.slide {
background-color: var(--cool-gray);
/* width: 100%; */
/* height: 500px; */
1 month ago
border-radius: 10px;
overflow: hidden;
}
.img-container {
display: flex;
justify-content: center;
align-items: center;
height: 100%;
width: 100%;
background-color: var(--light-pink);
}
.carousel-item {
max-width: 80%;
overflow: hidden;
/* height: 100%; */
}
@media (max-width: 425px) {
.title {
/* background-color: aqua; */
grid-template-rows: 1fr 1fr;
grid-template-columns: none;
}
.carousel-item {
max-width: 50%;
}
}
</style>