import { Alignment , ColorCorrectionFilter , ColorSource , OBS , Scene } from "@sceneify/core" ; import { Easing , keyframe , animate } from "@sceneify/animation" ; async function main ( ) { const obs = new OBS ( ) ; await obs . connect ( "localhost:4444" ) ; const mainScene = new Scene ( { name : "Main" , items : { blue : { source : new ColorSource ( { name : "Blue Color Source" , settings : { color : 0xffff0000 , width : 400 , height : 400 , } , } ) , alignment : Alignment . Center , positionY : 400 , } , red : { source : new ColorSource ( { name : "Main Scene Background" , settings : { color : 0xff0000ff , width : 200 , height : 200 , } , filters : { color : new ColorCorrectionFilter ( { name : "Color" , settings : { hue_shift : 0 , } , } ) , } , } ) , positionY : 800 , } , } , } ) ; await mainScene . create ( obs ) ; await mainScene . makeCurrentScene ( ) ; await animate ( { subjects : { blueItem : mainScene . item ( "blue" ) , redSource : mainScene . item ( "red" ) . source , } , keyframes : { blueItem : { positionX : { 0 : 0 , 1000 : keyframe ( 1920 , Easing . InOut ) , 2000 : keyframe ( 0 , Easing . InOut ) , } , } , redSource : { width : { 0 : keyframe ( 200 , Easing . InOut ) , 1000 : keyframe ( 600 , Easing . InOut ) , 2000 : keyframe ( 200 , Easing . InOut ) , } , } , } , } ) ; } main ( ) ; const wait = ( ms ) => new Promise ( ( r ) => setTimeout ( r , ms ) ) ;