Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/cmgriffing/giffium into fea…
Browse files Browse the repository at this point in the history
…t/use-store
  • Loading branch information
cmgriffing committed Nov 3, 2024
2 parents 1b03ee7 + bb82a48 commit d71bfd0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions playgrounds/app/src/components/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from './
import { SetStoreFunction } from 'solid-js/store'

const animationSeconds = 1
const animationFPS = 10
const animationFPS = 30
const animationFrames = animationSeconds * animationFPS

const supportedFontFamilies: { name: string }[] = [
Expand Down Expand Up @@ -184,7 +184,7 @@ export default function Editor(props: EditorProps) {
middleFrames.push(i)
}

const pauseFrameLength = 15
const pauseFrameLength = 60
const firstFrames = new Array(pauseFrameLength).fill(0)
const lastFrames = new Array(pauseFrameLength).fill(animationFrames)

Expand Down Expand Up @@ -236,7 +236,10 @@ export default function Editor(props: EditorProps) {
format: 'blob',
width: canvasFrames[0].width,
height: canvasFrames[0].height,
frames: canvasFrames,
frames: canvasFrames.map(el => ({
data: el.data.buffer,
delay: (animationSeconds * 1000) / animationFPS,
})),
})

const dataUrl = await blobToDataURL(blob)
Expand Down

0 comments on commit d71bfd0

Please sign in to comment.