Files
photobooth/src/views/SelectSourceView.vue
mrkad@rpi e90c06230b feat: add photo booth functionality with shooting, uploading, and printing steps
- Implemented PrintStepView for displaying countdown and photo results.
- Created SelectSourceView for choosing between shooting new photos or uploading existing ones.
- Developed ShootingView for capturing photos using the device camera.
- Added UploadView for selecting and previewing uploaded photos.
- Configured TypeScript settings with tsconfig files for app and node environments.
- Set up Vite configuration with PWA support for the application.
2026-01-17 11:41:46 +07:00

150 lines
2.7 KiB
Vue
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<script setup lang="ts">
import { useRouter } from 'vue-router'
const router = useRouter()
const goToShooting = () => {
router.push('/shooting')
}
const goToUpload = () => {
router.push('/upload')
}
const goBack = () => {
router.push('/frame')
}
</script>
<template>
<div class="source-container">
<header class="header">
<button @click="goBack" class="back-button"> กล</button>
<h1>เลอกแหลงภาพ</h1>
</header>
<section class="options-section">
<div class="option-card" @click="goToShooting">
<div class="option-icon">
📷
</div>
<h3>ายภาพใหม</h3>
<p>ายภาพ 4 ปจากกลองหรอเวบแคม</p>
<div class="arrow"></div>
</div>
<div class="option-card" @click="goToUpload">
<div class="option-icon">
🖼
</div>
<h3>พโหลดภาพ</h3>
<p>เลอกภาพ 4 ปจากคลงภาพในอปกรณ</p>
<div class="arrow"></div>
</div>
</section>
</div>
</template>
<style scoped>
.source-container {
min-height: 100vh;
padding: 2rem;
background: #f8f9fa;
display: flex;
flex-direction: column;
}
.header {
display: flex;
align-items: center;
gap: 1rem;
margin-bottom: 3rem;
}
.back-button {
background: #6c757d;
color: white;
border: none;
padding: 0.5rem 1rem;
border-radius: 8px;
cursor: pointer;
font-size: 1rem;
}
.header h1 {
margin: 0;
color: #333;
font-size: 2rem;
}
.options-section {
display: flex;
flex-direction: column;
gap: 2rem;
max-width: 600px;
margin: 0 auto;
width: 100%;
}
.option-card {
background: white;
border-radius: 16px;
padding: 2rem;
cursor: pointer;
transition: all 0.3s ease;
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
display: flex;
align-items: center;
gap: 1.5rem;
position: relative;
}
.option-card:hover {
transform: translateY(-4px);
box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}
.option-icon {
font-size: 3rem;
width: 80px;
height: 80px;
display: flex;
align-items: center;
justify-content: center;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border-radius: 50%;
color: white;
}
.option-card h3 {
margin: 0 0 0.5rem 0;
color: #333;
font-size: 1.5rem;
}
.option-card p {
margin: 0;
color: #666;
flex: 1;
}
.arrow {
font-size: 1.5rem;
color: #007bff;
font-weight: bold;
}
@media (max-width: 768px) {
.option-card {
flex-direction: column;
text-align: center;
gap: 1rem;
}
.option-icon {
width: 60px;
height: 60px;
font-size: 2rem;
}
}
</style>