diff --git a/src/locale/OutputTexts.ts b/src/locale/OutputTexts.ts index 23db40a4a..09ef8da65 100644 --- a/src/locale/OutputTexts.ts +++ b/src/locale/OutputTexts.ts @@ -324,6 +324,8 @@ type OutputTexts = { spin: NameAndDoc; /** Fades in from purely transparent to purely opaque */ fadein: NameAndDoc; + /** Fades out from purely opaque to purely transprent */ + fadeout: NameAndDoc; /** Scales from 0 to larger than its size, then back to scale of 1 */ popup: NameAndDoc; /** Offsets randomly in multiple directions */ diff --git a/src/locale/en-US.json b/src/locale/en-US.json index 23645195a..ae159805a 100644 --- a/src/locale/en-US.json +++ b/src/locale/en-US.json @@ -3861,6 +3861,10 @@ "doc": "I create a @Sequence that fades @Output in from invisible to visible.", "names": ["fadein"] }, + "fadeout": { + "doc": "I create a @Sequence that fades @Output from visible to invisible. Try me in an exiting @Sequence!", + "names": ["fadeout"] + }, "popup": { "doc": "I create a @Sequence that makes @Output scale in quickly than shrink to its normal size.", "names": ["popup"] diff --git a/src/output/DefaultSequences.ts b/src/output/DefaultSequences.ts index a333451cb..5f4f8d47f 100644 --- a/src/output/DefaultSequences.ts +++ b/src/output/DefaultSequences.ts @@ -18,14 +18,14 @@ export function createSway(locales: Locales) { Bind.make( getDocLocales( locales, - (locale) => locale.output.sequence.sway.angle.doc + (locale) => locale.output.sequence.sway.angle.doc, ), getNameLocales( locales, - (locale) => locale.output.sequence.sway.angle.names + (locale) => locale.output.sequence.sway.angle.names, ), NumberType.make(Unit.reuse(['°'])), - NumberLiteral.make(2, Unit.reuse(['°'])) + NumberLiteral.make(2, Unit.reuse(['°'])), ), ], parseExpression( @@ -33,8 +33,8 @@ export function createSway(locales: Locales) { 0%: Pose(rotation: -1 · angle) 50%: Pose(rotation: angle) 100%: Pose(rotation: -1 · angle) - }`) - ) + }`), + ), ); } @@ -43,21 +43,21 @@ export function createBounce(locales: Locales) { getDocLocales(locales, (locale) => locale.output.sequence.bounce.doc), getNameLocales( locales, - (locale) => locale.output.sequence.bounce.names + (locale) => locale.output.sequence.bounce.names, ), undefined, [ Bind.make( getDocLocales( locales, - (locale) => locale.output.sequence.bounce.height.doc + (locale) => locale.output.sequence.bounce.height.doc, ), getNameLocales( locales, - (locale) => locale.output.sequence.bounce.height.names + (locale) => locale.output.sequence.bounce.height.names, ), NumberType.make(Unit.reuse(['m'])), - NumberLiteral.make(2, Unit.reuse(['m'])) + NumberLiteral.make(2, Unit.reuse(['m'])), ), ], parseExpression( @@ -69,8 +69,8 @@ export function createBounce(locales: Locales) { 57%: Pose(scale: 1 offset: Place(y: .1m)) 64%: Pose(scale: 1 offset: Place(y: 0m)) 100%: Pose(scale: 1 offset: Place(y: 0m)) - }`) - ) + }`), + ), ); } @@ -84,8 +84,8 @@ export function createSpin(locales: Locales) { toTokens(`{ 0%: Pose(rotation: 360°) 100%: Pose(rotation: 0°) - }`) - ) + }`), + ), ); } @@ -94,7 +94,7 @@ export function createFadeIn(locales: Locales) { getDocLocales(locales, (locale) => locale.output.sequence.fadein.doc), getNameLocales( locales, - (locale) => locale.output.sequence.fadein.names + (locale) => locale.output.sequence.fadein.names, ), undefined, [], @@ -102,8 +102,26 @@ export function createFadeIn(locales: Locales) { toTokens(`{ 0%: Pose(opacity: 0) 100%: Pose(opacity: 1) - }`) - ) + }`), + ), + ); +} + +export function createFadeOut(locales: Locales) { + return FunctionDefinition.make( + getDocLocales(locales, (locale) => locale.output.sequence.fadeout.doc), + getNameLocales( + locales, + (locale) => locale.output.sequence.fadeout.names, + ), + undefined, + [], + parseExpression( + toTokens(`{ + 0%: Pose(opacity: 1) + 100%: Pose(opacity: 0) + }`), + ), ); } @@ -119,8 +137,8 @@ export function createPopup(locales: Locales) { 80%: Pose(scale: 1.1) 90%: Pose(scale: 0.9) 100%: Pose(scale: 1) - }`) - ) + }`), + ), ); } @@ -137,8 +155,8 @@ export function createShake(locales: Locales) { 50%: Pose(offset: Place(.1m 0m)) 75%: Pose(offset: Place(-.1m 0.1m)) 100%: Pose(offset: Place(0m 0m)) - }`) - ) + }`), + ), ); } @@ -148,6 +166,7 @@ export function getDefaultSequences(locales: Locales) { bounce: createBounce(locales), spin: createSpin(locales), fadein: createFadeIn(locales), + fadeout: createFadeOut(locales), popup: createPopup(locales), shake: createShake(locales), }; diff --git a/static/locales/es-MX/es-MX.json b/static/locales/es-MX/es-MX.json index 8bcbba515..5da44e98b 100644 --- a/static/locales/es-MX/es-MX.json +++ b/static/locales/es-MX/es-MX.json @@ -3877,19 +3877,23 @@ } }, "spin": { - "doc": "Creo una @Sequence que rota un @Output alrededor de su centro.", + "doc": "Creo una @Sequence que rota un @Output alrededor de su centro.", "names": ["girar"] }, "fadein": { - "doc": "Creo una @Sequence que hace que un @Output aparezca gradualmente de invisible a visible.", + "doc": "Creo una @Sequence que hace que un @Output aparezca gradualmente de invisible a visible.", "names": ["aparecer"] }, + "fadeout": { + "doc": "$?", + "names": ["$?"] + }, "popup": { - "doc": "Creo una @Sequence que hace que un @Output se agrande rápidamente y luego vuelva a su tamaño normal.", + "doc": "Creo una @Sequence que hace que un @Output se agrande rápidamente y luego vuelva a su tamaño normal.", "names": ["aparecer"] }, "shake": { - "doc": "Creo una @Sequence que hace que parezca que un @Output está asustado.", + "doc": "Creo una @Sequence que hace que parezca que un @Output está asustado.", "names": ["temblor"] } }, diff --git a/static/locales/ko-KR/ko-KR.json b/static/locales/ko-KR/ko-KR.json index f4a1f4c17..84e935757 100644 --- a/static/locales/ko-KR/ko-KR.json +++ b/static/locales/ko-KR/ko-KR.json @@ -2674,6 +2674,10 @@ }, "spin": { "doc": "$?", "names": ["girar"] }, "fadein": { "doc": "$?", "names": ["revelar"] }, + "fadeout": { + "doc": "$?", + "names": ["$?"] + }, "popup": { "doc": "$?", "names": ["surgir"] }, "shake": { "doc": "$?", "names": ["agitar"] } }, diff --git a/static/locales/zh-CN/zh-CN.json b/static/locales/zh-CN/zh-CN.json index 77737e2f0..21fdd9864 100644 --- a/static/locales/zh-CN/zh-CN.json +++ b/static/locales/zh-CN/zh-CN.json @@ -3714,6 +3714,10 @@ "doc": "我创建一个@Sequence, 将@Output从不可见状态淡入可见状态。", "names": ["淡入"] }, + "fadeout": { + "doc": "$?", + "names": ["$?"] + }, "popup": { "doc": "我创建一个@Sequence, 使@Output迅速放大然后缩小到正常尺寸。", "names": ["弹出"] diff --git a/static/locales/zh-TW/zh-TW.json b/static/locales/zh-TW/zh-TW.json index 804d69b39..d57a9caeb 100644 --- a/static/locales/zh-TW/zh-TW.json +++ b/static/locales/zh-TW/zh-TW.json @@ -3695,6 +3695,10 @@ "doc": "我建立一個@Sequence, 將@Output從不可見狀態淡入可見狀態。", "names": ["淡入"] }, + "fadeout": { + "doc": "$?", + "names": ["$?"] + }, "popup": { "doc": "我創建一個@Sequence, 使@Output迅速放大然後縮小到正常尺寸。", "names": ["彈出"] diff --git a/static/schemas/Locale.json b/static/schemas/Locale.json index e41f7a3cd..f77430f0e 100644 --- a/static/schemas/Locale.json +++ b/static/schemas/Locale.json @@ -7848,6 +7848,10 @@ "$ref": "#/definitions/NameAndDoc", "description": "Fades in from purely transparent to purely opaque" }, + "fadeout": { + "$ref": "#/definitions/NameAndDoc", + "description": "Fades out from purely opaque to purely transprent" + }, "popup": { "$ref": "#/definitions/NameAndDoc", "description": "Scales from 0 to larger than its size, then back to scale of 1" @@ -7890,6 +7894,7 @@ "bounce", "spin", "fadein", + "fadeout", "popup", "shake" ],