mirror of
https://gitcode.com/leisileken/cloud-smart.git
synced 2026-09-11 10:27:20 +08:00
fix: 修复首页路由和构建错误
This commit is contained in:
@@ -20,7 +20,6 @@ const particlesContainer = ref<HTMLDivElement | null>(null)
|
||||
const particles: Particle[] = []
|
||||
const mousePos = { x: 0, y: 0 }
|
||||
let animationFrameId: number | null = null
|
||||
let time = 0
|
||||
|
||||
const nebulaColors = [
|
||||
'#6366f1',
|
||||
|
||||
@@ -7,8 +7,13 @@ interface ActivatePoint {
|
||||
progress: number
|
||||
}
|
||||
|
||||
type NeuralCardElement = HTMLElement & {
|
||||
_neuralAnimationId?: number | null
|
||||
}
|
||||
|
||||
const vNeuralCard: Directive = {
|
||||
mounted(el: HTMLElement) {
|
||||
const neuralEl = el as NeuralCardElement
|
||||
const points: ActivatePoint[] = []
|
||||
let pointId = 0
|
||||
let animationId: number | null = null
|
||||
@@ -107,12 +112,13 @@ const vNeuralCard: Directive = {
|
||||
|
||||
animate()
|
||||
|
||||
el._neuralAnimationId = animationId
|
||||
neuralEl._neuralAnimationId = animationId
|
||||
},
|
||||
|
||||
unmounted(el: HTMLElement) {
|
||||
if (el._neuralAnimationId) {
|
||||
cancelAnimationFrame(el._neuralAnimationId)
|
||||
const neuralEl = el as NeuralCardElement
|
||||
if (neuralEl._neuralAnimationId) {
|
||||
cancelAnimationFrame(neuralEl._neuralAnimationId)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
import type { Directive, DirectiveBinding } from 'vue'
|
||||
import type { Directive } from 'vue'
|
||||
|
||||
interface RippleEvent extends MouseEvent {
|
||||
_ripple?: HTMLElement
|
||||
}
|
||||
|
||||
type RippleElement = HTMLElement & {
|
||||
_rippleHandler?: (e: MouseEvent) => void
|
||||
}
|
||||
|
||||
const vRipple: Directive = {
|
||||
mounted(el: HTMLElement, binding: DirectiveBinding) {
|
||||
mounted(el: HTMLElement) {
|
||||
const rippleEl = el as RippleElement
|
||||
el.style.position = 'relative'
|
||||
el.style.overflow = 'hidden'
|
||||
|
||||
@@ -81,12 +86,13 @@ const vRipple: Directive = {
|
||||
}
|
||||
|
||||
el.addEventListener('click', handleClick)
|
||||
el._rippleHandler = handleClick
|
||||
rippleEl._rippleHandler = handleClick
|
||||
},
|
||||
|
||||
unmounted(el: HTMLElement) {
|
||||
if (el._rippleHandler) {
|
||||
el.removeEventListener('click', el._rippleHandler)
|
||||
const rippleEl = el as RippleElement
|
||||
if (rippleEl._rippleHandler) {
|
||||
el.removeEventListener('click', rippleEl._rippleHandler)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,8 +5,7 @@ const router = createRouter({
|
||||
routes: [
|
||||
{
|
||||
path: '/',
|
||||
name: 'Landing',
|
||||
component: () => import('@/views/LandingPage.vue')
|
||||
redirect: '/home'
|
||||
},
|
||||
{
|
||||
path: '/home',
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<script setup lang="ts">
|
||||
import { images } from '@/assets/images'
|
||||
import { ref } from 'vue'
|
||||
|
||||
|
||||
|
||||
@@ -123,14 +123,9 @@ const testimonials = [
|
||||
]
|
||||
|
||||
const activeTestimonial = ref(0)
|
||||
const expandedProduct = ref<number | null>(null)
|
||||
const showProductModal = ref(false)
|
||||
const selectedProduct = ref<any>(null)
|
||||
|
||||
const toggleProduct = (index: number) => {
|
||||
expandedProduct.value = expandedProduct.value === index ? null : index
|
||||
}
|
||||
|
||||
const openProductDetail = (product: any) => {
|
||||
selectedProduct.value = product
|
||||
showProductModal.value = true
|
||||
|
||||
@@ -88,11 +88,7 @@ const handleMouseMove = (e: MouseEvent) => {
|
||||
const enterWebsite = () => {
|
||||
isEntering.value = true
|
||||
setTimeout(() => {
|
||||
<<<<<<< HEAD
|
||||
router.push('/')
|
||||
=======
|
||||
router.push('/home')
|
||||
>>>>>>> b71fd0336a7a487dac3c305e8fdde42fe63de6f4
|
||||
}, 1500)
|
||||
}
|
||||
|
||||
|
||||
@@ -143,7 +143,6 @@ onMounted(() => {
|
||||
scrollInterval = window.setInterval(() => {
|
||||
if (!isPaused.value) {
|
||||
const totalCases = successCases.length
|
||||
const itemWidth = 100 / 3
|
||||
const maxScroll = (totalCases / 3) * 100
|
||||
scrollPosition.value = (scrollPosition.value + scrollSpeed) % maxScroll
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user