Skip to content

Commit

Permalink
fix: repeat click when export
Browse files Browse the repository at this point in the history
  • Loading branch information
sheepbox8646 committed Sep 6, 2024
1 parent 74d1370 commit 448c1b7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
2 changes: 1 addition & 1 deletion packages/export/src/image-process.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Page } from 'puppeteer'

export async function transformToImage(path: string, page: Page, index = 0) {
page.click('#motion')
await page.click('body')
const element = await page.waitForSelector('#motion')
await element?.screenshot({ path, type: 'jpeg' })
console.log('complete transform image!' + ` Image index: ${index}`)
Expand Down
4 changes: 0 additions & 4 deletions packages/export/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ export default async function (options: ExportOptions) {
let index = 0

for (let i = 0; i < options.duration; i += 1 / options.fps) {
// await new Promise((resolve) => setTimeout(resolve, 1 / options.fps * 1000))
await page.click('body')
const element = await page.waitForSelector('#motion')
await element?.click()
if (!fs.existsSync(resolve('.vuemotion'))) {
await new Promise((res) => fs.mkdir(resolve('.vuemotion'), res))
}
Expand Down

0 comments on commit 448c1b7

Please sign in to comment.