2018-06-26 16:08:33 +02:00
|
|
|
import 'babel-polyfill';
|
2017-11-11 20:23:45 +01:00
|
|
|
import React from 'react';
|
|
|
|
import { Interface } from 'doodle3d-slicer';
|
|
|
|
import { render } from 'react-dom';
|
2017-11-12 16:58:59 +01:00
|
|
|
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
|
2017-12-14 11:55:14 +01:00
|
|
|
import jss from 'jss';
|
|
|
|
import preset from 'jss-preset-default';
|
|
|
|
import normalize from 'normalize-jss';
|
2018-01-15 15:17:38 +01:00
|
|
|
import queryString from 'query-string';
|
2018-01-17 13:26:30 +01:00
|
|
|
import getMuiTheme from 'material-ui/styles/getMuiTheme';
|
2018-01-17 14:58:36 +01:00
|
|
|
import { grey400, blue500, blue700 } from 'material-ui/styles/colors';
|
2018-01-17 13:26:30 +01:00
|
|
|
|
|
|
|
const muiTheme = getMuiTheme({
|
|
|
|
palette: {
|
|
|
|
primary1Color: blue500,
|
|
|
|
primary2Color: blue700,
|
|
|
|
accent1Color: blue500,
|
|
|
|
}
|
|
|
|
});
|
2017-11-12 16:58:59 +01:00
|
|
|
|
2017-12-14 11:55:14 +01:00
|
|
|
jss.setup(preset());
|
|
|
|
jss.createStyleSheet(normalize).attach();
|
|
|
|
jss.createStyleSheet({
|
|
|
|
'@global': {
|
|
|
|
'*': { margin: 0, padding: 0 },
|
|
|
|
'#app, body, html': { height: '100%', fontFamily: 'sans-serif' },
|
|
|
|
body: { overflow: 'auto' },
|
|
|
|
html: { overflow: 'hidden' }
|
|
|
|
}
|
|
|
|
}).attach();
|
2017-11-12 13:08:51 +01:00
|
|
|
|
2018-04-16 16:26:44 +02:00
|
|
|
let { file, selectedPrinter, actions, name } = queryString.parse(location.search);
|
2018-03-07 18:21:41 +01:00
|
|
|
if (actions) actions = JSON.parse(actions);
|
2017-12-18 16:37:03 +01:00
|
|
|
|
2018-01-15 15:17:38 +01:00
|
|
|
render((
|
2018-01-17 13:26:30 +01:00
|
|
|
<MuiThemeProvider muiTheme={muiTheme}>
|
2018-04-16 16:26:44 +02:00
|
|
|
<Interface actions={actions} fileUrl={file} selectedPrinter={selectedPrinter} name={name}/>
|
2018-01-15 15:17:38 +01:00
|
|
|
</MuiThemeProvider>
|
|
|
|
), document.getElementById('app'));
|