Awesome work, Elusien! I just tried rotating a picture and this time there was no deviation; as you promised . And it worked right the first time. Usually, anything even resembling code means for me several trials are necessary to get to a result.
One remark about the webpage: If you only enter ā{animation: myfirst 5s linear 2s infinite alternate; }ā and not ādiv {animation: myfirst 5s linear 2s infinite alternate; }ā, an error message is displayed which complains about a missing ā}ā. But actually, a name is missing not a curly bracket.
I was confused at first that it is not necessary to delete the @keyframes section because I would delete it to not cause any conflicts. But it seems this is not the case or you prevent that.
I will try it out some more later. My interim conclusion is positive .
Yes, I have to tighten up on āerrorsā. I was more concerned with getting the utility out there, available for people to try. I will now try to make it less error-prone, or at least report errors (correctly).
The @keyframes section does not need to be deleted - it isnāt a problem if you do, because without the āanimationsā section (which you must delete or comment out) the @keyframes section is not used.
Hi @elusien, unfortunately I had no time to experiment today, but uncannily I had very similar teething āproblemsā as @samth on the first use yesterday. First, I put just only the line
animation: myfirst 5s linear 2s infinite alternate;
into the fiield, took me a while to realise I had to split
div {
width: 100px; height: 100px; background-color: red; position: relative;
animation: myfirst 5s linear 2s infinite alternate;
}
into
div { animation: myfirst 5s linear 2s infinite alternate; }
Yes, you explain it in words (by saying
āIf the animations data is part of a larger CSS clause, break that clause into two, with the animation data separateā,
but I wonder if an example might help the first-time user.
Also, I was unsure whether to include ā@keyframesā or not when entering into the generator field. I think this could also be made a little clearer. Hope you donāt mind me pointing out these observations.
No of course not. Iāll be working on the code and the webpage over the next few days to see where improvements and extra checks can be made. Iām joping I can do them all at the webpage level and donāt have to create a new version of the javascript you have to download.
EDIT: I have already updated the webpage to highlight some of the issues that have already been experienced.
Hereās my zip: bubbles animation jonray.zip (55.2 KB)
The zip contains my 3 HTML files - #1 after copying/pasting the raw HTML and CSS, #2 after formatting/deleting/tidying up the code, and #3 after converting using your generator.
In #2 I did quite a bit of tweaking - some of it based on my knowledge of HTML.
I found LOTS of duplicated code to delete!
For example, I deleted the duplicated lines of keyframes and animation with -moz- and -webkit- prefixes (also gradient and box-shadow);
I also deleted the unnecessary code relating to text (1st CSS clause) , changed body-wrap to body_wrap, and gave it a dimension of 1920 x 1080.
Then changed x1, x2 etc to bubble01 bubble02 etc (just so I could understand how it works).
Then I added ā0sā for the delay part of the animation.
Finally I struggled with understanding the pseudo element :after, (didnāt know how to convert this to divs) - just about to ask you for advice, then I found if I just deleted this part it still worked OK!
(Oh, and I added a few more bubbles!!)
One point I noticed is that your system worked OK with having ādouble animationsā for each element (one vertical and one sideways).
So, Iām pleased to report that it works OK. It was quite a complex animation but it would have still worked had I not tweaked it (deleted/changed names etc) quite as severely.
Great, well done @elusien!! - will try to find another animation to explore with soon and report back.
ā¦ and wondered if I could convert it. Before spend time trying it, I thought Iād ask if it would work in principle since it has JS code as well as HTML and CSS. Thanks!
Been out all day and just got back from the airport with the next lot of family coming to stay.
Strictly speaking the code is not javascript it is written in babel and needs to be fed through the babel compiler to produce javascript. None of the animation is done using CSS, so even if you got the javascript sorted youād still have to find a way to synchronise the animation produced by the javascript with WebVfx.
Itās not that it canāt be done, just that it isnāt simple. If I get a few days spare I wouldnāt mind looking at it and trying to get it working in Shotcut. But if I were you I think Iād leave it on the shelf, unless you are proficient in javascript programming.
By the way, well done in getting the bubbles to rise. It did seem a bit fiddly.
Ah, thanks for the explanation. Your detailed knowledge of all this never ceases to amaze me - so thank you! Yes, I will leave it to you, if you get any spare time. I certainly donāt have the necessary JS programming skills - in fact, Iād rate it as zero!
Yes, it was a bit fiddly but mainly because I wanted to analyse what was going on in the code. Iāll look for a simpler animation to try next - or at least one that has more standard straightforward coding.
So I got time to really test the new system instead of just using it for a previous written animation.
I used this example of an animated bird: https://codepen.io/matchboxhero/pen/XeQWNw
After tidying it up to comply to the generatorās requirements, I copied the generated code back into the file. Opening it in the browser works but in Shotcut there is only a still frame.
In the log it says:
[Info ] SyntaxError: Unexpected token ā-ā
[Info ] TypeError: undefined is not an object (evaluating āthis.animate.lengthā)
I do not know when I should have defined a length. The browser console displays this undefined length as well but plays the animation regardless.
The unexpected token seems to be a minus but removing it from the background-position property did not yield any result (unsurprisingly).
I compared my code with jonrayās bubble code but did not find anything vastly different except that in mine a svg is used. Additionally, there was no undefined length error.
Here the files: bird.zip (5.0 KB)
Hi @samth, I think I know one problem - try changing bird-container and fly-cycle to bird_container and fly_cycle. Leave the other minus signs. Iāve no time to test to see if that works right now but it might help. Not sure about the other problem, I guess @elusienās your manā¦
I feel a bit dumbfounded. I overlooked the minus signs in the names . They were definitely preventing the animation. It works now to some degree but there is tweaking necessary. I will report my progress later.
I did format the animation part because I pasted it in the generator before without any formatting and there were several errors.
The will-change property is not necessary as it seems only relevant for some browsers. Removing it does not impact it in Vivaldi.
Yes, you are right. You have to convert the āanimation-ā properties into the combined shorthand āanimation:ā property.
When I have time I will modify the utility to allow hyphens (-) in the names. At the moment they are not detected by the utility and cause a problem at run-time, which is more difficult to notice.
Iām still in the throws of setting up my new Surface Pro, so I canāt do as much as I could otherwise.
I discovered that you can download a zip file of the code from Codepen if you sign in. In the downloaded folder called ādistā the file āindex.htmlā is the code converted to a working HTML file which should preview in your browser. No need to copy/paste.
That is my problem as well. I was not able to figure a workaround and you were not as well, as it seems. I think too that this step(10) is the culprit. It should flip through the 10 birds of the svg similar to a flip-book. Perhaps a modification of the scripts is necessary .
Nice animation! Did it work right away after editing to meet the generatorās requirements?
I might sign up for Codepen. It is simple to copy the code but downloading a html file is just easier.