feat: serve frames & video from CDN (media.ayris.tech)
This commit is contained in:
@@ -11,9 +11,10 @@ import {
|
|||||||
} from 'framer-motion'
|
} from 'framer-motion'
|
||||||
import UnitRevealOverlay from './UnitRevealOverlay'
|
import UnitRevealOverlay from './UnitRevealOverlay'
|
||||||
|
|
||||||
const TOTAL_FRAMES = 298
|
const TOTAL_FRAMES = 299
|
||||||
|
const CDN = 'https://media.ayris.tech/t'
|
||||||
const FRAME_PATH = (n: number) =>
|
const FRAME_PATH = (n: number) =>
|
||||||
`/frames/ezgif-frame-${String(n).padStart(3, '0')}.jpg`
|
`${CDN}/vesta/frames/ezgif-frame-${String(n).padStart(3, '0')}.jpg`
|
||||||
|
|
||||||
// Scroll aralığına göre opacity döndüren helper
|
// Scroll aralığına göre opacity döndüren helper
|
||||||
function usePhaseOpacity(
|
function usePhaseOpacity(
|
||||||
|
|||||||
@@ -5,10 +5,11 @@ import { motion, AnimatePresence } from 'framer-motion'
|
|||||||
import { X } from 'lucide-react'
|
import { X } from 'lucide-react'
|
||||||
|
|
||||||
const UNIT_FRAMES = 120
|
const UNIT_FRAMES = 120
|
||||||
|
const CDN = 'https://media.ayris.tech/t'
|
||||||
|
|
||||||
// Video kullanan birimler
|
// Video kullanan birimler
|
||||||
const VIDEO_UNITS: Record<string, string> = {
|
const VIDEO_UNITS: Record<string, string> = {
|
||||||
'blok-a': '/unit-videos/blok-a.mp4',
|
'blok-a': `${CDN}/vesta/unit-videos/blok-a.mp4`,
|
||||||
}
|
}
|
||||||
|
|
||||||
interface UnitRevealOverlayProps {
|
interface UnitRevealOverlayProps {
|
||||||
@@ -61,7 +62,7 @@ export default function UnitRevealOverlay({
|
|||||||
|
|
||||||
for (let i = 0; i < UNIT_FRAMES; i++) {
|
for (let i = 0; i < UNIT_FRAMES; i++) {
|
||||||
const img = new Image()
|
const img = new Image()
|
||||||
img.src = `/unit-frames/${unitId}/ezgif-frame-${String(i + 1).padStart(3, '0')}.jpg`
|
img.src = `${CDN}/vesta/unit-frames/${unitId}/ezgif-frame-${String(i + 1).padStart(3, '0')}.jpg`
|
||||||
img.onload = () => {
|
img.onload = () => {
|
||||||
if (cancelled) return
|
if (cancelled) return
|
||||||
loadedCount++
|
loadedCount++
|
||||||
|
|||||||
Reference in New Issue
Block a user