Skip to content

fix: アニメーションロジックを修正 #341

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions app/components/shapes/HeadCircle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,20 @@ export default defineComponent({

setup(props, setupContext) {
const { createAnimation, fadeAnimation, transformPosition } = useAnimationParts()
const shape = ref()
const refs = setupContext.refs

const KEY_FRAME = [0, 60]

const transform = transformPosition(props)

const createAnimations = () => {
setTimeout(() => {
createAnimation(shape.value, { r: KEY_FRAME[1] })
createAnimation(refs.value, { r: KEY_FRAME[1] })
}, 0)
}

const fadeAnimations = () => {
fadeAnimation(shape.value, { r: KEY_FRAME[0] })
fadeAnimation(refs.value, { r: KEY_FRAME[0] })
}

onMounted(() => {
Expand Down
21 changes: 9 additions & 12 deletions app/components/shapes/HeadCross.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@ export default defineComponent({

setup(props, setupContext) {
const { createAnimation, fadeAnimation, transformPosition } = useAnimationParts()
const shape1 = ref()
const shape2 = ref()
const shape3 = ref()
const shape4 = ref()
const refs = setupContext.refs

const KEY_FRAME1 = ['0 -60 0 -60 0 -60', '-54 -60 54 -60 0 -6']
const KEY_FRAME2 = ['-60 0 -60 0 -60 0', '-60 -54 -60 54 -6 0']
Expand All @@ -63,18 +60,18 @@ export default defineComponent({

const createAnimations = () => {
setTimeout(() => {
createAnimation(shape1.value, { points: KEY_FRAME1[1] })
createAnimation(shape2.value, { points: KEY_FRAME2[1] })
createAnimation(shape3.value, { points: KEY_FRAME3[1] })
createAnimation(shape4.value, { points: KEY_FRAME4[1] })
createAnimation(refs.shape1, { points: KEY_FRAME1[1] })
createAnimation(refs.shape2, { points: KEY_FRAME2[1] })
createAnimation(refs.shape3, { points: KEY_FRAME3[1] })
createAnimation(refs.shape4, { points: KEY_FRAME4[1] })
}, 0)
}

const fadeAnimations = () => {
fadeAnimation(shape1.value, { points:KEY_FRAME1[0] })
fadeAnimation(shape2.value, { points:KEY_FRAME2[0] })
fadeAnimation(shape3.value, { points:KEY_FRAME3[0] })
fadeAnimation(shape4.value, { points:KEY_FRAME4[0] })
fadeAnimation(refs.shape1, { points:KEY_FRAME1[0] })
fadeAnimation(refs.shape2, { points:KEY_FRAME2[0] })
fadeAnimation(refs.shape3, { points:KEY_FRAME3[0] })
fadeAnimation(refs.shape4, { points:KEY_FRAME4[0] })
}

onMounted(() => {
Expand Down
11 changes: 5 additions & 6 deletions app/components/shapes/HeadHorizontal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,21 @@ export default defineComponent({
},
setup(props, setupContext) {
const { createAnimation, fadeAnimation, transformPosition } = useAnimationParts()
const shape1 = ref()
const shape2 = ref()
const refs = setupContext.refs

const transform = transformPosition(props)


const createAnimations = () => {
setTimeout(() => {
createAnimation(shape1.value, { height: 55 })
createAnimation(shape2.value, { y: 5, height: 55 })
createAnimation(refs.shape1, { height: 55 })
createAnimation(refs.shape2, { y: 5, height: 55 })
}, 0)
}

const fadeAnimations = () => {
fadeAnimation(shape1.value, { y: -60, height: 0 })
fadeAnimation(shape2.value, { y: 60, height: 0 })
fadeAnimation(refs.shape1, { y: -60, height: 0 })
fadeAnimation(refs.shape2, { y: 60, height: 0 })
}

onMounted(() => {
Expand Down
30 changes: 15 additions & 15 deletions app/components/shapes/HeadPhoto.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@
cx="0"
cy="0"
r="0"
:clip-path="`url(${urlBasePath}#clip-boundary)`"
clip-path="url(#clip-boundary)"
/>
</clipPath>
<image
key="1"
:href="`${urlBasePath}/${imageSrc}`"
:href="imageSrc"
x="-60"
y="-60"
width="120"
height="120"
:clip-path="`url(${urlBasePath}#${CLIP_ID})`"
:clip-path="`url(#${CLIP_ID})`"
/>
</g>
</template>
Expand All @@ -33,12 +33,12 @@ import { urlBasePath } from '~/utils/constants'
import type { CustomPropType } from '~/types/shims-vue'
import { useAnimationParts } from '~/composables/useAnimationParts'

import Image01 from '!url-loader!~/assets/img/animation/image01.png'
import Image02 from '!url-loader!~/assets/img/animation/image02.png'
import Image03 from '!url-loader!~/assets/img/animation/image03.png'
import Image04 from '!url-loader!~/assets/img/animation/image04.png'
import Image05 from '!url-loader!~/assets/img/animation/image05.png'
import Image06 from '!url-loader!~/assets/img/animation/image06.png'
import Image01 from '~/assets/img/animation/image01.png'
import Image02 from '~/assets/img/animation/image02.png'
import Image03 from '~/assets/img/animation/image03.png'
import Image04 from '~/assets/img/animation/image04.png'
import Image05 from '~/assets/img/animation/image05.png'
import Image06 from '~/assets/img/animation/image06.png'

interface IPropParts {
type: string
Expand Down Expand Up @@ -69,12 +69,12 @@ export default defineComponent({

const imageSrc = computed(() => {
const images = {
'image01.png': Image01,
'image02.png': Image02,
'image03.png': Image03,
'image04.png': Image04,
'image05.png': Image05,
'image06.png': Image06,
'image01.png': Image01.default || Image01,
'image02.png': Image02.default || Image02,
'image03.png': Image03.default || Image03,
'image04.png': Image04.default || Image04,
'image05.png': Image05.default || Image05,
'image06.png': Image06.default || Image06,
}
return images[props.parts.src]
})
Expand Down
11 changes: 5 additions & 6 deletions app/components/shapes/HeadSlash.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ export default defineComponent({

setup(props, setupContext) {
const { createAnimation, fadeAnimation, transformPosition } = useAnimationParts()
const shape1 = ref()
const shape2 = ref()
const refs = setupContext.refs

const KEY_FRAME1 = ['-60 -60 -60 -60 -60 -60', '-60 -60 54 -60 -60 54']
const KEY_FRAME2 = ['60 60 60 60 60 60', '60 60 -54 60 60 -54']
Expand All @@ -59,14 +58,14 @@ export default defineComponent({

const createAnimations = () => {
setTimeout(() => {
createAnimation(shape1.value, { points: KEY_FRAME1[1] })
createAnimation(shape2.value, { points: KEY_FRAME2[1] })
createAnimation(refs.shape1, { points: KEY_FRAME1[1] })
createAnimation(refs.shape2, { points: KEY_FRAME2[1] })
}, 0)
}

const fadeAnimations = () => {
fadeAnimation(shape1.value, { points: KEY_FRAME1[0] })
fadeAnimation(shape2.value, { points: KEY_FRAME2[0] })
fadeAnimation(refs.shape1, { points: KEY_FRAME1[0] })
fadeAnimation(refs.shape2, { points: KEY_FRAME2[0] })
}

onMounted(() => {
Expand Down
6 changes: 3 additions & 3 deletions app/components/shapes/HeadTriangle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,20 @@ export default defineComponent({

setup(props, setupContext) {
const { createAnimation, fadeAnimation, transformPosition } = useAnimationParts()
const shape = ref()
const refs = setupContext.refs

const KEY_FRAME = ['60 60 60 60 60 60', '60 60 -52 60 60 -52']

const transform = transformPosition(props)

const createAnimations = () => {
setTimeout(() => {
createAnimation(shape.value, { points: KEY_FRAME[1] })
createAnimation(refs.shape, { points: KEY_FRAME[1] })
}, 0)
}

const fadeAnimations = () => {
fadeAnimation(shape.value, { points: KEY_FRAME[0] })
fadeAnimation(refs.shape, { points: KEY_FRAME[0] })
}

onMounted(() => {
Expand Down
2 changes: 1 addition & 1 deletion app/utils/feature.constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const SHOW_ANIMATION = false
export const SHOW_ANIMATION = true
export const SHOW_TICKET = true
export const SHOW_TEAM = true
export const SHOW_SPEAKER_LIST = true
Expand Down
5 changes: 5 additions & 0 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,10 @@ export default defineNuxtConfig({
},
build: {
extractCSS: true,
loaders: {
imgUrl: {
esModule: false,
},
},
},
})
Loading