@vixoniccom/menu-daily 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/assets/framed.ai +3330 -4
- package/assets/modern.ai +421 -0
- package/build.zip +0 -0
- package/configuration.json +207 -0
- package/icon.png +0 -0
- package/package.json +31 -0
- package/src/dataLoader.ts +168 -0
- package/src/global.d.ts +59 -0
- package/src/index.html +33 -0
- package/src/logger.ts +11 -0
- package/src/main.ts +47 -0
- package/src/scenes/App.tsx +103 -0
- package/src/scenes/components/FontLoader.tsx +52 -0
- package/src/scenes/components/FormattedText.tsx +56 -0
- package/src/scenes/components/Grid/Grid.tsx +161 -0
- package/src/scenes/components/Grid/GridItem.tsx +79 -0
- package/src/scenes/components/Grid/animation.ts +105 -0
- package/src/scenes/components/Grid/index.ts +2 -0
- package/src/scenes/components/MealContainer/components/OptionItem.tsx +25 -0
- package/src/scenes/components/MealContainer/components/Title/index.tsx +82 -0
- package/src/scenes/components/MealContainer/components/Title/styles/Framed.tsx +52 -0
- package/src/scenes/components/MealContainer/components/Title/styles/Modern.tsx +47 -0
- package/src/scenes/components/MealContainer/components/Title/styles/index.tsx +13 -0
- package/src/scenes/components/MealContainer/components/index.ts +2 -0
- package/src/scenes/components/MealContainer/index.tsx +59 -0
- package/src/static/menu-daily-example.xlsx +0 -0
- package/src/test/downloads/1234.ttf +0 -0
- package/src/test/downloads/background.jpg +0 -0
- package/src/test/downloads/futura-font.ttf +0 -0
- package/src/test/parameters.json +37 -0
- package/tsconfig.json +36 -0
- package/tslint.json +5 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import Grid from '../Grid'
|
|
3
|
+
import { OptionItem, Title } from './components'
|
|
4
|
+
|
|
5
|
+
type Props = {
|
|
6
|
+
data: Meal
|
|
7
|
+
vixonicData: VixonicData
|
|
8
|
+
interval: number
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default class MealContainer extends React.Component<Props, any> {
|
|
12
|
+
constructor () {
|
|
13
|
+
super ()
|
|
14
|
+
this.state = {}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
render () {
|
|
18
|
+
let { data, interval, vixonicData } = this.props
|
|
19
|
+
let { parameters } = vixonicData
|
|
20
|
+
let rows = parameters.itemGridRows || 1
|
|
21
|
+
let pages = Math.ceil(data.options.length / rows)
|
|
22
|
+
let cycle = parameters.itemAnimationDuration && parameters.itemAnimationDuration * 1000 || (interval / pages)
|
|
23
|
+
return <div style={{
|
|
24
|
+
display: 'flex',
|
|
25
|
+
flexDirection: 'column',
|
|
26
|
+
width: '100%',
|
|
27
|
+
height: '100%',
|
|
28
|
+
flex: 1
|
|
29
|
+
}}>
|
|
30
|
+
<Title
|
|
31
|
+
text={data.type}
|
|
32
|
+
vixonicData={vixonicData}
|
|
33
|
+
getPadding={(padding) => this.setState({padding})} />
|
|
34
|
+
{ data && data.options &&
|
|
35
|
+
<Grid
|
|
36
|
+
style={{
|
|
37
|
+
flex: 1,
|
|
38
|
+
padding: parameters.itemGridMargins || this.state.padding
|
|
39
|
+
}}
|
|
40
|
+
fontSize='inherit'
|
|
41
|
+
id={data.type}
|
|
42
|
+
items={data.options.map((option) => (<OptionItem data={option} vixonicData={vixonicData} />))}
|
|
43
|
+
animate={true}
|
|
44
|
+
animation={{
|
|
45
|
+
mode: parameters.animationMode || 'fade',
|
|
46
|
+
duration: cycle
|
|
47
|
+
}}
|
|
48
|
+
layout={{
|
|
49
|
+
columns: 1,
|
|
50
|
+
rows,
|
|
51
|
+
alignment: {
|
|
52
|
+
h: 'start',
|
|
53
|
+
v: 'center'
|
|
54
|
+
}
|
|
55
|
+
}} />
|
|
56
|
+
}
|
|
57
|
+
</div>
|
|
58
|
+
}
|
|
59
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"parameters":{
|
|
3
|
+
"animationDuration":10,
|
|
4
|
+
"animationMode":"fade",
|
|
5
|
+
"backgroundImage":{
|
|
6
|
+
"filename":"background.jpg"
|
|
7
|
+
},
|
|
8
|
+
"containerGridMargins":"110px 30px 30px 30px",
|
|
9
|
+
"containerGridRows":2,
|
|
10
|
+
"containerGridRowsGap":5,
|
|
11
|
+
"itemGridRows":3,
|
|
12
|
+
"itemOptionsTextFormat":{
|
|
13
|
+
"alignment":{
|
|
14
|
+
|
|
15
|
+
},
|
|
16
|
+
"fontSize":14,
|
|
17
|
+
"font": {
|
|
18
|
+
"filename": "futura-font.ttf"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"itemStyle":"modern",
|
|
22
|
+
"itemTitleBackgroundColor": "#EA7D15",
|
|
23
|
+
"itemTitleTextFormat":{
|
|
24
|
+
"alignment":{
|
|
25
|
+
|
|
26
|
+
},
|
|
27
|
+
"fontColor":"#fff",
|
|
28
|
+
"fontSize":14,
|
|
29
|
+
"font": {
|
|
30
|
+
"filename": "bold-font.ttf"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"pollingInterval": 300000,
|
|
34
|
+
"url":"./static/menu-daily-example.xlsx",
|
|
35
|
+
"url2":"https://docs.google.com/spreadsheets/d/e/2PACX-1vRTuTsKdqpLH2zqKXURYTu_xpc5arXljE0W8KfnPJVy5U_J1HGD30C5YfVrWjUFAz5W9JiTC4VGVBYN/pub?output=xlsx"
|
|
36
|
+
}
|
|
37
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es2015",
|
|
4
|
+
"module": "es2015",
|
|
5
|
+
"moduleResolution": "node",
|
|
6
|
+
"jsx": "preserve",
|
|
7
|
+
"allowJs": true,
|
|
8
|
+
"checkJs": true,
|
|
9
|
+
"allowSyntheticDefaultImports": true,
|
|
10
|
+
"emitDecoratorMetadata": true,
|
|
11
|
+
"experimentalDecorators": true,
|
|
12
|
+
"downlevelIteration": true,
|
|
13
|
+
"strict": true,
|
|
14
|
+
"forceConsistentCasingInFileNames": true,
|
|
15
|
+
"noFallthroughCasesInSwitch": true,
|
|
16
|
+
"noImplicitReturns": true,
|
|
17
|
+
"noImplicitAny": true,
|
|
18
|
+
"noImplicitThis": true,
|
|
19
|
+
"noUnusedLocals": true,
|
|
20
|
+
"noUnusedParameters": true,
|
|
21
|
+
"sourceMap": true,
|
|
22
|
+
"types": [
|
|
23
|
+
"node"
|
|
24
|
+
],
|
|
25
|
+
"typeRoots": [
|
|
26
|
+
"./node_modules/@types",
|
|
27
|
+
"./src"
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
"include": [
|
|
31
|
+
"./src/**/*"
|
|
32
|
+
],
|
|
33
|
+
"exclude": [
|
|
34
|
+
"./node_modules/**/*"
|
|
35
|
+
]
|
|
36
|
+
}
|