File size: 1,943 Bytes
37d7c88
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
const { createApp } = Vue

const app = createApp({
    data() {
        return {
            videoDescription: '',
            charCount: 0,
            selectedStyle: null,
            showProModal: false,
            generationCount: 0,
            videoStyles: [
                { id: 'mountain', name: 'Mountain Landscape' },
                { id: 'city', name: 'City Timelapse' },
                { id: 'ocean', name: 'Ocean Waves' },
                { id: 'dance', name: 'Dancing Performance' },
                { id: 'nature', name: 'Nature Wildlife' },
                { id: 'space', name: 'Space Journey' }
            ]
        }
    },
    methods: {
        updateCharCount() {
            this.charCount = this.videoDescription.length
            if (this.charCount > 1000) {
                this.videoDescription = this.videoDescription.slice(0, 1000)
                this.charCount = 1000
            }
        },
        selectStyle(styleId) {
            this.selectedStyle = styleId
        },
        enhanceText() {
            if (this.generationCount >= 3) {
                this.showProModal = true
                return
            }
            // Placeholder for text enhancement functionality
            console.log('Enhancing text...')
        },
        generateVideo() {
            if (this.generationCount >= 3) {
                this.showProModal = true
                return
            }
            this.generationCount++
            if (this.generationCount >= 3) {
                this.showProModal = true
            } else {
                // Placeholder for video generation functionality
                console.log('Generating video...')
                window.location.href = 'https://saifs.ai/text-to-video'
            }
        },
        closeProModal() {
            this.showProModal = false
        }
    }
})

app.mount('#app')