-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: core tsconfig path and left logo position * refactor: event flow
- Loading branch information
Showing
18 changed files
with
228 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './positions'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
export const getPositions = (size: number, tiles = 6) => { | ||
const base = size / 6 | ||
|
||
const width = size | ||
const height = size | ||
|
||
const grid = { | ||
x: 0, | ||
y: 0, | ||
w: size, | ||
h: size, | ||
tiles, | ||
active: false, | ||
} | ||
|
||
const background = { | ||
x: 0, | ||
y: 0, | ||
w: size, | ||
h: size, | ||
} | ||
|
||
const logo = { | ||
x: base / 4.5, | ||
y: base / 4.5, | ||
w: base + base / 4.5, | ||
h: base + base / 4.5, | ||
} | ||
|
||
const title = { | ||
x: logo.x + logo.w, | ||
y: base / 3, | ||
w: size - base, | ||
h: base, | ||
} | ||
|
||
const presentation = { | ||
x: 0, | ||
y: base, | ||
w: size, | ||
h: base * 3, | ||
} | ||
|
||
const date = { | ||
x: 0, | ||
y: size - base * 2, | ||
w: base * 1.5, | ||
h: base, | ||
} | ||
|
||
const time = { | ||
x: date.x + date.w, | ||
y: date.y, | ||
w: base, | ||
h: date.h, | ||
} | ||
|
||
const location = { | ||
x: time.x + time.w, | ||
y: time.y, | ||
w: size - time.x - time.w, | ||
h: time.h, | ||
} | ||
|
||
const details = { | ||
x: base / 4.5, | ||
y: size - base * 2, | ||
w: size, | ||
h: base, | ||
} | ||
|
||
const sponsor = { | ||
x: base / 4.5, | ||
y: size - base, | ||
w: base * 2, | ||
h: base, | ||
} | ||
|
||
const devParana = { | ||
x: size - 250, | ||
y: size - 90, | ||
w: 200, | ||
h: 50, | ||
} | ||
|
||
return { | ||
width, | ||
height, | ||
base, | ||
grid, | ||
background, | ||
logo, | ||
title, | ||
presentation, | ||
date, | ||
time, | ||
location, | ||
details, | ||
sponsor, | ||
devParana, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,45 @@ | ||
import {Presentation, SubmittedPresentation} from '@interfaces/presentation' | ||
import {ImageLayer, PresentationLayer} from '../core' | ||
import {Schema} from '@interfaces/schema' | ||
import {action} from '@utils/state' | ||
import {EventMap} from '@interfaces/event-map' | ||
import {store} from './store' | ||
|
||
export const state = store<EventMap>() | ||
|
||
/** | ||
* Form | ||
*/ | ||
export const updateForm = action<Schema>('form.updated') | ||
export const updateForm = state.action('form.updated') | ||
export const updateLogo = state.action('form.logo-updated') | ||
// export const updateForm = action<Schema>('form.updated') | ||
// export const updateLogo = action<HTMLOptionElement>('form.logo-updated') | ||
|
||
/** | ||
* Presentation | ||
*/ | ||
export const submitPresentation = action<SubmittedPresentation>( | ||
'presentation.submitted' | ||
) | ||
export const submitPresentation = state.action('presentation.submitted') | ||
// export const submitPresentation = action<SubmittedPresentation>( | ||
// 'presentation.submitted' | ||
// ) | ||
|
||
export const handlePresentation = action<Presentation>('presentation.handled') | ||
export const handlePresentation = state.action('presentation.handled') | ||
// export const handlePresentation = action<Presentation>('presentation.handled') | ||
|
||
export const createPresentation = action<PresentationLayer>( | ||
'presentation.created' | ||
) | ||
export const createPresentation = state.action('presentation.created') | ||
// export const createPresentation = action<PresentationLayer>( | ||
// 'presentation.created' | ||
// ) | ||
|
||
export const addPresentation = action<PresentationLayer>('presentation.added') | ||
export const addPresentation = state.action('presentation.added') | ||
// export const addPresentation = action<PresentationLayer>('presentation.added') | ||
|
||
/** | ||
* Sponsor | ||
*/ | ||
export const selectSponsor = action<File>('sponsor.selected') | ||
export const selectSponsor = state.action('sponsor.selected') | ||
|
||
export const createSponsor = state.action('sponsor.created') | ||
|
||
export const addSponsor = state.action('sponsor.added') | ||
// export const selectSponsor = action<File>('sponsor.selected') | ||
|
||
export const createSponsor = action<ImageLayer>('sponsor.created') | ||
// export const createSponsor = action<ImageLayer>('sponsor.created') | ||
|
||
export const addSponsor = action<ImageLayer>('sponsor.added') | ||
// export const addSponsor = action<ImageLayer>('sponsor.added') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import {onLogoUpdated} from '@store/selectors' | ||
|
||
onLogoUpdated(({text, value}) => { | ||
console.log(text, value) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './form.logo-change'; | ||
export * from './form.updated'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,25 @@ | ||
import {Presentation, SubmittedPresentation} from '@interfaces/presentation' | ||
import {ImageLayer, PresentationLayer} from '../core' | ||
import {Schema} from '@interfaces/schema' | ||
import {select} from '@utils/state' | ||
|
||
import {state} from './actions' | ||
|
||
/** | ||
* Form | ||
*/ | ||
export const onFormUpdated = select<Schema>('form.updated') | ||
export const onFormUpdated = state.select('form.updated') | ||
export const onLogoUpdated = state.select('form.logo-updated') | ||
|
||
/** | ||
* Presentation | ||
*/ | ||
export const onPresentationSubmitted = select<SubmittedPresentation>( | ||
'presentation.submitted' | ||
) | ||
export const onPresentationSubmitted = state.select('presentation.submitted') | ||
|
||
export const onPresentationHandled = select<Presentation>( | ||
'presentation.handled' | ||
) | ||
export const onPresentationHandled = state.select('presentation.handled') | ||
|
||
export const onPresentationCreated = select<PresentationLayer>( | ||
'presentation.created' | ||
) | ||
export const onPresentationCreated = state.select('presentation.created') | ||
|
||
export const onPresentationAdded = | ||
select<PresentationLayer>('presentation.added') | ||
export const onPresentationAdded = state.select('presentation.added') | ||
|
||
/** | ||
* Sponsor | ||
*/ | ||
export const onSponsorSelected = select<File>('sponsor.selected') | ||
export const onSponsorCreated = select<ImageLayer>('sponsor.created') | ||
export const onSponsorAdded = select<ImageLayer>('sponsor.added') | ||
export const onSponsorSelected = state.select('sponsor.selected') | ||
export const onSponsorCreated = state.select('sponsor.created') | ||
export const onSponsorAdded = state.select('sponsor.added') |
Oops, something went wrong.