Skip to content

Commit

Permalink
feat(clipscarousel): add fade animation
Browse files Browse the repository at this point in the history
  • Loading branch information
sogehige committed Feb 16, 2022
1 parent e09f722 commit df7306e
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 26 deletions.
28 changes: 14 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
"author": "Michal Orlik <sogehige@gmail.com>",
"license": "MIT",
"dependencies": {
"@sogebot/ui-admin": "^36.2.2",
"@sogebot/ui-admin": "^37.0.0",
"@sogebot/ui-helpers": "^2.8.0",
"@sogebot/ui-oauth": "~3.0.2",
"@sogebot/ui-overlay": "^17.2.3",
"@sogebot/ui-overlay": "^18.0.0",
"@sogebot/ui-public": "^2.0.0",
"@twurple/api": "^5.0.17",
"@twurple/chat": "^5.0.17",
Expand Down
1 change: 1 addition & 0 deletions src/database/entity/overlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ export interface OverlayMapperClipsCarousel {
customPeriod: number,
numOfClips: number,
volume: number,
animation: string,
},
}

Expand Down
32 changes: 22 additions & 10 deletions src/graphql/resolvers/overlayResolver.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import {
OverlayMapper, OverlayMapperInterface, OverlayMappers,
OverlayMapper, OverlayMapperClipsCarousel, OverlayMapperInterface, OverlayMappers,
} from '@entity/overlay';
import { SECOND } from '@sogebot/ui-helpers/constants';
import { defaults, pick } from 'lodash';
import {
Arg, Authorized, Mutation, Query, Resolver,
} from 'type-graphql';
Expand Down Expand Up @@ -86,15 +87,26 @@ export class overlayResolver {
emotesfireworks: items.filter(o => o.value === 'emotesfireworks'),
emotesexplode: items.filter(o => o.value === 'emotesexplode'),
hypetrain: items.filter(o => o.value === 'hypetrain'),
clipscarousel: items.filter(o => o.value === 'clipscarousel'),
carousel: items.filter(o => o.value === 'carousel'),
tts: items.filter(o => o.value === 'tts'),
polls: items.filter(o => o.value === 'polls'),
obswebsocket: items.filter(o => o.value === 'obswebsocket'),
group: items.filter(o => o.value === 'group'),
stats: items.filter(o => o.value === 'stats'),
wordcloud: items.filter(o => o.value === 'wordcloud'),
randomizer: items.filter(o => o.value === 'randomizer'),
clipscarousel: (items.filter(o => o.value === 'clipscarousel') as OverlayMapperClipsCarousel[]).map((value) => {
value.opts = pick(
defaults(value.opts, {
volume: 0,
customPeriod: 31,
numOfClips: 20,
animation: 'slide',
}),
['volume', 'customPeriod', 'numOfClips', 'animation'],
);
return value;
}),
carousel: items.filter(o => o.value === 'carousel'),
tts: items.filter(o => o.value === 'tts'),
polls: items.filter(o => o.value === 'polls'),
obswebsocket: items.filter(o => o.value === 'obswebsocket'),
group: items.filter(o => o.value === 'group'),
stats: items.filter(o => o.value === 'stats'),
wordcloud: items.filter(o => o.value === 'wordcloud'),
randomizer: items.filter(o => o.value === 'randomizer'),
} as OverlayObject;
return response;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ type OverlayMapperClipsCarouselOptions = NonNullable<OverlayMapperClipsCarousel[

@ObjectType()
export class OverlayClipsCarouselOptionsObject implements OverlayMapperClipsCarouselOptions {
@Field() animation: string;
@Field(type => Int) customPeriod: number;
@Field(type => Int) numOfClips: number;
@Field(type => Float) volume: number;
Expand Down

0 comments on commit df7306e

Please sign in to comment.