diff --git a/attribution.txt b/attribution.txt new file mode 100644 index 0000000..997c4c2 --- /dev/null +++ b/attribution.txt @@ -0,0 +1 @@ +"Document" icon made by Becris from www.flaticon.com diff --git a/src/client/app.jsx b/src/client/app.jsx index f86d2a9..18b6569 100644 --- a/src/client/app.jsx +++ b/src/client/app.jsx @@ -4,7 +4,9 @@ import {hot} from 'react-hot-loader'; import React, {useState} from 'react'; import TypeRenderersContext from './context/typeRenderers'; -import Resource from './resource'; +import Resources from './resources'; +import Sidebar from './sidebar'; +import SidebarIcons from './sidebar-icons'; import {all as allTypeRenderers} from './type-renderers.scwp'; const typeRenderMap = () => Object.values(allTypeRenderers()).reduce((r, M) => { @@ -15,9 +17,21 @@ const typeRenderMap = () => Object.values(allTypeRenderers()).reduce((r, M) => { const App = () => { const [typeRenderers] = useState(typeRenderMap()); return ( - - - +
+ +
+
+ +
+
+ +
+
+ +
+
+
+
); }; diff --git a/src/client/app.scss b/src/client/app.scss index e69de29..7f4ea74 100644 --- a/src/client/app.scss +++ b/src/client/app.scss @@ -0,0 +1,29 @@ +.app { + width: 100vw; + height: 100vh; +} + +.panes { + position: relative; + width: 100%; + height: 100%; + &.horizontal .pane { + float: left; + height: 100%; + } + &.vertical .pane { + width: 100%; + } +} + +.sidebar-icons-wrapper { + width: 4em; +} + +.sidebar-wrapper { + width: 24em; +} + +.resources-wrapper { + width: calc(100% - 28em); +} diff --git a/src/client/index.scss b/src/client/index.scss index 1f3d2e2..6eadae4 100644 --- a/src/client/index.scss +++ b/src/client/index.scss @@ -144,3 +144,81 @@ select { outline: none; z-index: 1; } + +.react-tabs { + width: 100%; + height: 100%; +} + +.react-tabs__tab-list { + background-color: #272727; + font-family: Ubuntu, "Droid Sans", sans-serif; + font-size: 0.9em; + overflow-x: hidden; + scrollbar-width: thin; + white-space: nowrap; + width: 100%; + &::-webkit-scrollbar { + width: 6px; + height: 6px; + } + &::-webkit-scrollbar-track { + background: #2e1d1d; + } + &::-webkit-scrollbar-thumb { + background-color: #777; + border-radius: 0; + border-width: 1px; + } +} + +.react-tabs__tab { + background-color: #2d2d2d; + color: #aaaaaa; + cursor: pointer; + display: inline-block; + height: 3em; + &:not(:last-of-type) { + border-right: 1px solid #282828; + } + &:hover { + color: #ddd; + } + .wrapper { + align-content: space-between; + align-items: center; + display: flex; + height: 100%; + justify-content: space-evenly; + } + .icon { + padding: 0.75em; + } + .close { + color: #999999; + padding: 0.25em; + visibility: hidden; + &:hover { + color: #ffffff; + } + } + &:hover .close { + visibility: visible; + } +} + +.react-tabs__tab--selected[class] { + background-color: #212121; + color: #ffffff; +} + +.react-tabs__tab-panel { + display: none; + overflow-y: auto; + height: calc(100% - 3em); + width: 100%; +} + +.react-tabs__tab-panel--selected { + display: block; +} diff --git a/src/client/resource.jsx b/src/client/resource.jsx index d8fad09..20c1131 100644 --- a/src/client/resource.jsx +++ b/src/client/resource.jsx @@ -1,11 +1,15 @@ -import './app.scss'; - +import {compose} from '@avocado/core'; +import contempo from 'contempo'; import PropTypes from 'prop-types'; import React from 'react'; import {registerHooks} from 'scwp'; import {all} from './resources.scwp'; +const decorate = compose( + contempo(require('./resource.raw.scss')), +); + const resources = Object.values(all()).map((M) => M.default); const Resource = (props) => { @@ -29,7 +33,7 @@ Resource.propTypes = { uri: PropTypes.string.isRequired, }; -export default Resource; +export default decorate(Resource); if (module.hot) { registerHooks({ diff --git a/src/client/resource.raw.scss b/src/client/resource.raw.scss new file mode 100644 index 0000000..ac16713 --- /dev/null +++ b/src/client/resource.raw.scss @@ -0,0 +1,4 @@ +:scope { + width: 100%; + height: 100%; +} diff --git a/src/client/resources.jsx b/src/client/resources.jsx new file mode 100644 index 0000000..5f3e385 --- /dev/null +++ b/src/client/resources.jsx @@ -0,0 +1,53 @@ +import {compose} from '@avocado/core'; +import contempo from 'contempo'; +import React, {useState} from 'react'; +import { + Tab, + Tabs, + TabList, + TabPanel, +} from 'react-tabs'; + +import Resource from './resource'; + +const decorate = compose( + contempo(require('./resources.raw.scss')), +); + +const Sidebar = (props) => { + const [tabIndex, setTabIndex] = useState(0); + const uris = [ + '/resources/cha0s/initial/kitty.entity.json', + '/resources/cha0s/initial/mama-kitty.entity.json', + ]; + return ( +
+ setTabIndex(index)} + > + + {uris.map((uri) => ( + + + + {uri} + + + + ))} + + {uris.map((uri) => ( + + + + ))} + +
+ ); +}; + +Sidebar.propTypes = { +}; + +export default decorate(Sidebar); diff --git a/src/client/resources.raw.scss b/src/client/resources.raw.scss new file mode 100644 index 0000000..ab0132b --- /dev/null +++ b/src/client/resources.raw.scss @@ -0,0 +1,17 @@ +:scope { + height: 100%; + width: 100%; +} + +.react-tabs__tab .wrapper { + padding: 0 0.5em; +} + +.react-tabs__tab .wrapper .text { + padding: 0 0.5em; +} + +// :scope > .react-tabs > .react-tabs__tab-list { +// margin-left: 4em; +// width: calc(100% - 3em); +// } diff --git a/src/client/scss/tabs.scss b/src/client/scss/tabs.scss index 67a6ee7..3600c57 100644 --- a/src/client/scss/tabs.scss +++ b/src/client/scss/tabs.scss @@ -1,65 +1,4 @@ %tabs { - .react-tabs__tab-list { - background-color: #272727; - font-family: Ubuntu, "Droid Sans", sans-serif; - font-size: 0.9em; - overflow-x: hidden; - scrollbar-width: thin; - white-space: nowrap; - width: 100%; - &::-webkit-scrollbar { - width: 6px; - height: 6px; - } - &::-webkit-scrollbar-track { - background: #2e1d1d; - } - &::-webkit-scrollbar-thumb { - background-color: #777; - border-radius: 0; - border-width: 1px; - } - } - - .react-tabs__tab { - background-color: #2d2d2d; - color: #aaaaaa; - cursor: pointer; - display: inline-block; - &:not(:last-of-type) { - border-right: 1px solid #282828; - } - &:hover { - color: #ddd; - } - .wrapper { - align-content: space-between; - align-items: center; - display: flex; - justify-content: space-evenly; - height: 3em; - width: 10em; - } - .icon { - padding: 0.75em; - } - .close { - color: #999999; - padding: 0.25em; - visibility: hidden; - &:hover { - color: #ffffff; - } - } - &:hover .close { - visibility: visible; - } - } - - .react-tabs__tab--selected[class] { - background-color: #212121; - color: #ffffff; - } } diff --git a/src/client/sidebar-icons.jsx b/src/client/sidebar-icons.jsx new file mode 100644 index 0000000..c5d5d31 --- /dev/null +++ b/src/client/sidebar-icons.jsx @@ -0,0 +1,39 @@ +import {compose} from '@avocado/core'; +import classnames from 'classnames'; +import contempo from 'contempo'; +import React, {useState} from 'react'; + +const decorate = compose( + contempo(require('./sidebar-icons.raw.scss')), +); + +const SidebarIcons = () => { + const [opened, setOpened] = useState(false); + return ( +
+ +
+ ); +}; + +SidebarIcons.propTypes = { +}; + +export default decorate(SidebarIcons); \ No newline at end of file diff --git a/src/client/sidebar-icons.raw.scss b/src/client/sidebar-icons.raw.scss new file mode 100644 index 0000000..8b59038 --- /dev/null +++ b/src/client/sidebar-icons.raw.scss @@ -0,0 +1,29 @@ +:scope { + background-color: #333333; + height: 100%; + width: 100%; +} + +.icon { + align-items: center; + background-color: inherit; + border: none; + display: flex; + justify-content: center; + height: 4em; + width: 4em; + svg { + height: 100%; + width: 100%; + path { + fill: #999999; + } + } + &:hover svg path { + fill: #ffffff; + } +} + +.files { + padding: 0.75em; +} diff --git a/src/client/sidebar.jsx b/src/client/sidebar.jsx new file mode 100644 index 0000000..655bcf6 --- /dev/null +++ b/src/client/sidebar.jsx @@ -0,0 +1,20 @@ +import {compose} from '@avocado/core'; +// import classnames from 'classnames'; +import contempo from 'contempo'; +import React from 'react'; + +const decorate = compose( + contempo(require('./sidebar.raw.scss')), +); + +const Sidebar = () => { + // const [active, setActive] = useState(false); + return ( +
+ ); +}; + +Sidebar.propTypes = { +}; + +export default decorate(Sidebar); \ No newline at end of file diff --git a/src/client/sidebar.raw.scss b/src/client/sidebar.raw.scss new file mode 100644 index 0000000..fbea075 --- /dev/null +++ b/src/client/sidebar.raw.scss @@ -0,0 +1,5 @@ +:scope { + background-color: #272727; + width: 100%; + height: 100%; +} \ No newline at end of file diff --git a/src/common/resources/entity/entity.raw.scss b/src/common/resources/entity/entity.raw.scss index 3b74cd1..7275a9c 100644 --- a/src/common/resources/entity/entity.raw.scss +++ b/src/common/resources/entity/entity.raw.scss @@ -1,12 +1,19 @@ +:scope { + height: 100%; + width: 100%; +} + .document-pane { border-right: 1px solid #1a1a1a; display: none; float: left; - width: calc(100% - 36em); - height: 100vh; + width: calc(100% - 58em); + height: 100%; } .settings-pane { - width: 100vw; - height: 100vh; + float: left; + // width: 58em; + width: 100%; + height: 100%; } diff --git a/src/common/resources/entity/traits.raw.scss b/src/common/resources/entity/traits.raw.scss index b0bc760..79603a4 100644 --- a/src/common/resources/entity/traits.raw.scss +++ b/src/common/resources/entity/traits.raw.scss @@ -1,18 +1,12 @@ -@import '~/client/scss/tabs.scss'; @import '~/client/scss/trait.scss'; -.react-tabs { - @extend %tabs; +:scope { + height: 100%; + width: 100%; } -.react-tabs__tab-panel { - display: none; -} - -.react-tabs__tab-panel--selected { - display: block; - height: calc(100vh - 2.7em); - overflow-y: auto; +.react-tabs__tab .wrapper { + width: 10em; } .react-tabs__tab-panel input {