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