Overlay HTML, Webvfx animation - problem with "transform-origin"

I set myself another task today, to see if I could create a video title with an animated “revealing” rectangle, using HTML/CSS/Webvfx,
but using a transparent background and overlay it above video footage.
Good news - I did it, using Elusien’s Webvfx framework to animate the four sides of the rectangle using this piece of code:

0% :   {webkitTransform:scale(1, 0);}, 
100% : {webkitTransform:scale(1, 1);}

(for the four sides of the rectangle).

Here’s the result:

https://streamable.com/91l5f

However, although I like the effect of the revealing rectangle (each line growing outwards from its centre), I originally wanted the lines of the rectangle to reveal like they do in this screen capture which is the same video title but with a blue background rendered in Chrome:

https://streamable.com/gikfg

To do this I added this code to the css:
transform-origin:bottom; (to the left rectangle side),
transform-origin:left; (to the top rectangle side),
transform-origin:top;(to the right rectangle side),
transform-origin:right;(to the bottom rectangle side).

However, Webvfx seems to ignore these “transform-origin” commands and in Shotcut the result is that each line scales outwards from the middle.
I know that Webvfx has limitations when it comes to “transform” animations. I was just womdering if there was another way of coding it using webvfx to achieve the effect shown in the video above (blue background)?
Thanks, any help gratefully received. Jon

PS full code is here if anyone would like to use it and experiment:

	<html lang="en">
	<head>
	<meta charset="utf-8">
	<title>Video title 01</title>
	<style>
      body  {
      background:transparent;
				  }

	#big_container {
	 position: absolute;
	 width: 1920px;
	 height: 1080px;
	 background-color:transparent;
	left:50%;
	top:50%;
	margin:-540px 0 0 -960px;
	opacity:1;   }

	#global_fade_out {
	 position: absolute;
	 width: 1920px;
	 height: 1080px;
	 background-color:transparent;
	left:50%;
	top:50%;
	margin:-540px 0 0 -960px;
	opacity:1;   }

	#main_title {
	font-family:Adequate;
	font-size:150px;
	text-align:center;
	font-weight:bold;
	color:white;
	text-shadow: 2px 2px 4px #000000;
	 position: absolute;
	 width: 1800px;
	 height: 250px;
	 background-color:transparent;
	left:50%;
	top:300px;
	margin:0px 0 0 -900px;
	opacity:0; 

	  }	


	#line_01 {

	 position: absolute;
	 width: 1100px;
	 height: 2px;
	 background-color:white;
	left:50%;
	top:550px;
	margin:0 0 0 -550px;
	opacity:0; 

	  }	  
	  
	  #subtitle {
	font-family:Life Savers;
	font-size:100px;
	text-align:center;
	color:white;
	font-weight:bold;
	 position: absolute;
	 width: 1800px;
	 height: 250px;
	 background-color:transparent;
	left:50%;
	top:650px;
	margin:0px 0 0 -900px;
	opacity:0; 

	  }		
	  #box_left {
	 position: absolute;
	 width: 8px;
	 height: 600px;
	 background-color:white;
	left:200px;
	top:250px;
	transform-origin:bottom;
	opacity:0; 
	  }	

	#box_top {
	 position: absolute;
	 width: 1500px;
	 height: 8px;
	 background-color:white;
	left:200px;
	top:250px;
	transform-origin:left;
	opacity:0; 
	  }	
	#box_right {
	 position: absolute;
	 width: 8px;
	 height: 600px;
	 background-color:white;
	left:1700px;
	top:250px;
	transform-origin:top;
	opacity:0; 
	  }	
	#box_bottom {
	 position: absolute;
	 width: 1500px;
	 height: 8px;
	 background-color:white;
	left:208px;
	top:842px;
	transform-origin:right;
	opacity:0; 
	  }	  
	  
	  
				
				  


	</style>
	</head>
	<body>

	<div id="big_container">

	<div id="global_fade_out" class="webvfx" data-animate="{start: 0.7, end: 1, ease: &quot;easeInOutSine&quot;,
		  0% :   {opacity:1;}, 
		  100% : {opacity:0;} }">


	<div id="box_left" class="webvfx" data-animate="{start: 0.0, end: 0.01, ease: &quot;easeInOutSine&quot;,
		  0% :   {opacity:0;}, 
		  100% : {opacity:1;} }" data-animate2="{start: 0.0, end: 0.1, ease: &quot;easeInOutSine&quot;,
		  0% :   {webkitTransform:scale(1, 0);}, 
		  100% : {webkitTransform:scale(1, 1);}
	}"></div>
		  
		  <div id="box_top" class="webvfx" data-animate="{start: 0.1, end: 0.11, ease: &quot;easeInOutSine&quot;,
		  0% :   {opacity:0;}, 
		  100% : {opacity:1;} }" data-animate2="{start: 0.1, end: 0.2, ease: &quot;easeInOutSine&quot;,
		  0% :   {webkitTransform:scale(0, 1);}, 
		  100% : {webkitTransform:scale(1, 1);}
	}"></div>

	<div id="box_right" class="webvfx" data-animate="{start: 0.2, end: 0.21, ease: &quot;easeInOutSine&quot;,
		  0% :   {opacity:0;}, 
		  100% : {opacity:1;} }" data-animate2="{start: 0.2, end: 0.3, ease: &quot;easeInOutSine&quot;,
		  0% :   {webkitTransform:scale(1, 0);}, 
		  100% : {webkitTransform:scale(1, 1);}
	}"></div>

	<div id="box_bottom" class="webvfx" data-animate="{start: 0.3, end: 0.31, ease: &quot;easeInOutSine&quot;,
		  0% :   {opacity:0;}, 
		  100% : {opacity:1;} }" data-animate2="{start: 0.3, end: 0.4, ease: &quot;easeInOutSine&quot;,
		  0% :   {webkitTransform:scale(0, 1);}, 
		  100% : {webkitTransform:scale(1, 1);}
	}"></div>


	<div id="main_title" class="webvfx" data-animate="{start: 0.0, end: 0.2, ease: &quot;easeInOutSine&quot;,
		  0% :   {opacity:0;}, 
		  100% : {opacity:1;} }">Planet Earth
	</div>

	<div id="line_01" class="webvfx" data-animate="{start: 0.1, end: 0.4, ease: &quot;easeInOutSine&quot;,
		  0% :   {opacity:0;}, 
		  100% : {opacity:1;} }">
	</div>

	<div id="Subtitle" class="webvfx" data-animate="{start: 0.3, end: 0.5, ease: &quot;easeInOutSine&quot;,
		  0% :   {opacity:0; letterSpacing:0;}, 
		  100% : {opacity:1; letterSpacing:30;} }">as seen from space
	</div>

	</div>
	</div>




	<script src="WebVfx 1_4.js"></script>
	</body></html>

Made the rectangle work with the S&P filter and key-frames.

https://streamable.com/r9fg6

Jon,

You need to change the 4 CSS options from “transform-origin” to “-webkit-transform-origin”. I just tried it and it works.

Enjoy - Neil

Wow, two helpful replies - thanks, guys!

Thanks, Neil, I should have tried that!!

Now that is really beautiful! I’d be very interested in how you did that (only if you have the time to reply, of course) :grinning:. I thought of using the S &P filter but I couldn’t figure out how to do it…

I’d like to explain it all but it would take too long and I’m sure I wouldn’t be able to give you a clear picture of what I did. It involved much math and some drawing.

Here’s a shot of the track layout.

I put the mlt and the border files here.

https://www.dropbox.com/sh/0r9aak53ksndg98/AACAWlt7g2gC7cX-EM3NoUxSa?dl=0

You can download and figure out what I did with the S&P filter. You’ll need to replace the main “Patagonia” video with your own.

:+1::smile:

That’s fantastic, sauron! Thank you so much. Downloaded - will have a play with it when I get a spare moment later. (Just settling down to watch the Brazil World Cup match on TV !!) :grinning::grin::rofl:

I had an idea you might have used transparent pngs…

I had to break the rectangle into 4 parts to make it work.

Html is not working for me at all. Keep downloading your code, it’s just not working in SC at all.:confused:

Renamed WebVfx.js to WebVfx 1_4.js. Now the Html overlay works sporadically.:frowning_face:

Hi sauron, I loaded up your mlt file and I can see exactly how you did this - great, very ingenious, good job…!
It’s given me a few ideas about how to use the size and position filter together with transparent pngs to create interesting video titles. Thank you.

Ah yes, I’ve just realised - in the text in my earlier post I had renamed the file to webvfx1_4.js…, sorry, forgot to mention that…

If I get time I’ll try to do a screen capture showing how overlay HTML works for me…

… also. a couple of tips:

  1. apply HTML filter when playhead is at the beginning of the clip,
  2. select re-load each time on replay,
  3. Note: playback may be stuttery on playback but should be OK on export. (check “realtime (frame dropping))”…

Hope this may help. Apologies if you knew this already… Jon

Thanks Jon, I’ll give it a try and see what I get.

Some title effects using the mask filter.

https://streamable.com/h7w48

https://streamable.com/h7w48

1 Like

Hi sauron, these effects are cool! Like the last time, If the mlt file is available for sharing, I’d love to dissect it and see how it was done! No worries if this isn’t possible… Thanks, Jon

Hey Jon, the mlt is available. Please dissect it.

Titles.mlt (34.2 KB)

You need to set the mask operation to Write on clear or Maximum. Actually Maximum works better than Write on clear. Then when you’re done with sizing and positioning, set the operation to either minimum or subtract depending on whether you want to hide or reveal the text.

A million thanks, sauron, much appreciated. Will play with it in between watching the football and weeding the garden :laughing::neutral_face:

Hi sauron, following your help re: mask filters I put this together:


https://streamable.com/4hz3q

(Mask filter applied to “Bournville” text).
My title video also uses an imported png of a horizontal line to which I applied a size and position filter to achieve the animation.

There is a problem, however with the fade-out of the png. It doesn’t work!

See this screen capture. The fade-out of V3 is not being applied at the end of the clip. Any ideas as to why?

https://streamable.com/sp42z

Your help with mask filter/sp filter keyframes has opened up alternative possibilities to html overlay - thanks!!

Looks fantastic. Like the font.

I think I had the same problem with fading my horizontal line. Wasn’t able to figure why it wasn’t working with the fade out filter so I used the opacity filter to fade it out.

Thanks! Fonts are: A Song For Jennifer , and AR Hermann.

I tried using the opacity filter instead of Fade Out - but it’s still not working. The line just disappears at the end of the clip without fading…

I have no idea why the fade or opacity isn’t working. Maybe you could redo the line and it might start working. Sometimes Shotcut does strange things.

Glad to report that I just deleted the png, reimported it, applied the size/position filter, added fade in/outs - and the fades are now working :rofl::rofl:
Thanks sauron! :+1::+1:

Also: I notice that SC is getting advanced keyframes for size and position very soon … excellent!

Looking forward to it.