daybrush / scenejs

🎬 Scene.js is JavaScript & CSS timeline-based animation library

Home Page:https://daybrush.com/scenejs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Code crashes when creating a Frame using the linear-gradient CSS function

Gumball12 opened this issue · comments

commented

Describe the bug
Code crashes when creating a Scene.Frame using the linear-gradient() CSS function. Am I using it wrong?

To Reproduce

new Scene.Frame({
  "mask-image": {
    prefix: "linear-gradient(",

    // If the suffix item is removed, no error occurs
    suffix: ")", // <- Uncaught Error: invalid format

    model: "linear-gradient",
    type: "",
    separator: ",",
    value: [
      {
        prefix: "",
        suffix: "",
        model: "",
        type: "array",
        separator: " ",
        value: ["to", "left"]
      },
      {
        prefix: "",
        suffix: "",
        model: "",
        type: "array",
        separator: " ",
        value: ["transparent", "40%"]
      },
      {
        prefix: "",
        suffix: "",
        model: "",
        type: "array",
        separator: " ",
        value: ["black", "60%"]
      }
    ]
  }
});

Expected behavior
no error should occur

Screenshots
image

Desktop (please complete the following information):

  • OS: macOS
  • Browser: chrome
  • Version: 104.0.5112.101

@Gumball12

Use linear-gradient(to left, transparent 40%, black 60%)
Can you tell me why I'm using it in the following way instead of using ?

commented

I was trying to get the properties property from the Frame object and use it.
Now I've found that is wrong, and I'm using toCSSObject() instead(same as you said). Thanks!