-
Notifications
You must be signed in to change notification settings - Fork 20
/
app.vue
184 lines (163 loc) · 4.94 KB
/
app.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
<script setup>
import FileWindow from './templates/FileWindow.vue'
import Window from './templates/Window.vue'
import Mail from './templates/Mail.vue'
import Navbar from './templates/Navbar.vue'
import AppGrid from './templates/AppGrid.vue'
import Bio from './views/Bio.vue'
import Resume from './views/Resume.vue'
import Nossaflex from './views/Nossaflex.vue'
import Wwdc2021 from './views/Wwdc2021.vue'
import Wwdc2022 from './views/Wwdc2022.vue'
import Wwdc2023 from './views/Wwdc2023.vue'
import ImagePreviewWindow from './templates/ImagePreviewWindow.vue'
import StartMenu from './templates/StartMenu.vue'
import {
useWindowsStore
} from './stores/windows'
const windowsStore = useWindowsStore()
const windows = windowsStore.windows
const windowComponents = [
{ name: 'window', comp: Window },
{ name: 'ImagePreviewWindow', comp: ImagePreviewWindow },
{ name: 'mail', comp: Mail },
{ name: 'FilesWindow', comp: FileWindow }
]
const slotViews = [
{ name: 'bio', comp: Bio },
{ name: 'resume', comp: Resume },
{ name: 'nossaflex', comp: Nossaflex },
{ name: 'wwdc2021', comp: Wwdc2021 },
{ name: 'wwdc2022', comp: Wwdc2022 },
{ name: 'wwdc2023', comp: Wwdc2023 }
]
const windowCheck = (windowId) => {
if (windowsStore.getWindowById(windowId).windowState == "open") {
return true
}
}
const deinitWindows = () => {
if (windowsStore.activeWindow == "Menu") {
windowsStore.setActiveWindow("")
windowsStore.zIndexIncrement("")
}
}
const openWindow = (windowId) => {
const payload = {
windowState: "open",
windowId: windowId
}
windowsStore.setWindowState(payload)
}
onMounted(() => {
let navbar = document.getElementById("navbar");
let navbarHeight = navbar.clientHeight;
document.getElementById("screen").style.height =
window.innerHeight - navbarHeight + "px";
window.addEventListener("resize", () => {
let vh = window.innerHeight * 0.01;
document.documentElement.style.setProperty("--vh", `${vh}px`);
});
openWindow('BiographyWindow')
})
</script>
<template>
<div id="app">
<div class="screen" id="screen" @click="deinitWindows">
<div
v-for="window in windows"
:key="window.key"
:aria-label="window.displayName"
>
<component
:is="windowComponents.find(comp => comp.name === window.windowComponent).comp"
:nameOfWindow="window.windowId"
:content_padding_bottom="window.windowContentPadding['bottom']"
:content_padding_left="window.windowContentPadding['left']"
:content_padding_right="window.windowContentPadding['right']"
:content_padding_top="window.windowContentPadding['top']"
:id="window.windowId"
:style="{
position: window.position,
left: window.positionX,
top: window.positionY,
}"
:folderContent="window.folderContent"
:folderSize="window.folderSize"
v-if="windowCheck(window.windowId)"
>
<template v-slot:content>
<component :is="slotViews.find(comp => comp.name === window.windowContent).comp"></component>
</template>
</component>
</div>
<AppGrid />
</div>
<StartMenu
v-if="windowsStore.activeWindow == 'Menu'"
style="position: absolute; z-index: 9999; left: 0; bottom: 36px"
></StartMenu>
<navbar style="position: absolute; bottom: 0; z-index: 9999" id="navbar" />
</div>
</template>
<style>
@import "./assets/css/utils/normalize.css";
@import "./assets/css/windows/app.css";
@import "./assets/css/windows/window.css";
@import "./assets/css/windows/appgrid.css";
@font-face {
font-family: "MS Sans Serif";
src: url("@/assets/fonts/MS-Sans-Serif.ttf");
}
/*-------------------------------------------*\
Utilities
\*-------------------------------------------*/
html {
overflow: hidden;
}
h6 {
margin-top: 5px !important;
}
#app {
font-family: "MS Sans Serif";
font-weight: 400;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
display: flex;
width: 100%;
height: calc(var(--vh, 1vh) * 100);
flex-direction: column;
}
.screen {
width: 100%;
position: relative;
z-index: 999;
}
::-webkit-scrollbar {
width: 15px;
background: repeating-conic-gradient(
rgb(189, 190, 189) 0% 25%,
rgb(255, 255, 255) 0% 50%
)
50% / 2px 2px;
}
::-webkit-scrollbar-thumb {
background: rgb(189, 190, 189);
/* box-shadow: 1.5px 1.5px black; */
border-top: solid rgb(250, 250, 250) 1.5px;
border-left: solid rgb(250, 250, 250) 1.5px;
border-bottom: solid rgb(90, 90, 90) 1.5px;
border-right: solid rgb(90, 90, 90) 1.5px;
outline: rgb(219, 219, 219);
}
/*-------------------------------------------*\
Fullscreen
\*-------------------------------------------*/
.fullscreen {
left: 0 !important;
position: relative;
display: block;
top: 0 !important;
right: 0 !important;
}
</style>