123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167 |
- <template>
- <div class="project-main-window">
- <div class="top-navigation">
- <img class="burger"
- src="@/assets/icons/three-bars.svg"
- alt="Menü"
- v-if="!wide"
- :class="{ rotation: menu }"
- @click="invertMenu">
- <div class="name">
- {{ project.name }}
- </div>
- </div>
- <div class="bottom">
- <div class="side-navigation"
- :class="{ wide: wide, narrow: !wide, active: menu }">
- <div class="item"
- :class="{active: activeContent === 'settings'}"
- @click="activeContent = 'settings'">
- Project Settings
- </div>
- <div class="item" @click="socket.set(projectPath, 'save')">
- Close
- </div>
- </div>
- <div class="content">
- <project-main-window-settings v-if="activeContent === 'settings'"
- :status="status" :socket="socket"/>
- </div>
- </div>
- </div>
- </template>
- <script>
- import ProjectMainWindowSettings from "@/components/projects/project-main-window-settings";
- export default {
- name: "project-main-window",
- components: {ProjectMainWindowSettings},
- props: ['status', 'socket'],
- data: function() {
- return {
- wide: true,
- menu: false,
- activeContent: 'settings'
- }
- },
- computed: {
- project: function() {
- return this.status.projects.filter(x => (x.status === 'open'))[0];
- },
- projectPath: function() {
- for (let i = 0; i < this.status.projects.length; i++)
- if (this.status.projects[i].status === 'open')
- return 'projects/' + i + '/status';
- return null;
- }
- },
- methods: {
- resize: function() {
- this.wide = (document.body.offsetWidth > 1024);
- },
- invertMenu: function() {
- this.menu = !this.menu;
- }
- },
- created: function() {
- window.addEventListener('resize', this.resize);
- this.resize();
- },
- destroyed: function() {
- window.removeEventListener('resize', this.resize);
- }
- }
- </script>
- <style scoped>
- .project-main-window {
- width: 100%;
- height: 100%;
- display: flex;
- flex-direction: column;
- }
- .top-navigation {
- background-color: #3f3f3f;
- color: whitesmoke;
- display: flex;
- padding: 1rem;
- flex-direction: row;
- align-items: center;
- }
- .top-navigation .burger {
- transition: transform 0.5s;
- filter: invert(1);
- width: 2rem;
- margin-right: 0.75rem;
- }
- .top-navigation .burger.rotation {
- transform: rotate(90deg);
- }
- .top-navigation .name {
- font-weight: bold;
- font-family: "Roboto Condensed";
- }
- .bottom {
- display: flex;
- flex-grow: 1;
- flex-direction: row;
- position: relative;
- }
- .side-navigation {
- background-color: #2f2f2f;
- color: whitesmoke;
- }
- .side-navigation.wide {
- flex-grow: 0;
- height: 100%;
- }
- .side-navigation.narrow {
- width: 85vw;
- left: -85vw;
- position: absolute;
- top: 0;
- bottom: 0;
- transition: 0.3s ease-out;
- }
- .side-navigation.narrow.active {
- left: 0;
- }
- .side-navigation .item {
- padding: 1rem 3rem 1rem 1rem;
- cursor: pointer;
- }
- .side-navigation .item:hover {
- background-color: #292929;
- }
- .side-navigation .item.active {
- background-color: #1f1f1f;
- }
- .side-navigation .item:not(:last-child) {
- border-bottom: 1px solid rgba(255, 255, 255, 0.25);
- }
- .content {
- flex-grow: 1;
- }
- </style>
|