@@ -44,36 +43,25 @@ import { ref, onMounted, onUnmounted, watch } from 'vue';
import { useI18n } from 'vue-i18n';
const { t, locale, setLocale } = useI18n();
+
defineProps({
- minimizedWindows: {
- type: Array,
- default: () => [],
- },
+ minimizedWindows: { type: Array, default: () => [] },
+ menuItems: { type: Array, default: () => [] },
});
+const emit = defineEmits(['restore-window', 'menu-action']);
+
const currentTime = ref('');
const isMounted = ref(false);
let timerId = null;
const showStartMenu = ref(false);
-const emit = defineEmits(['open-about-me', 'restore-window', 'close-all-windows', 'open-terminal']);
-
const toggleStartMenu = () => {
showStartMenu.value = !showStartMenu.value;
};
-const openTerminal = () => {
- emit('open-terminal');
- showStartMenu.value = false;
-};
-
-const openAboutMe = () => {
- emit('open-about-me');
- showStartMenu.value = false;
-};
-
-const closeAllWindows = () => {
- emit('close-all-windows');
+const handleMenuClick = (action) => {
+ emit('menu-action', action);
showStartMenu.value = false;
};
@@ -88,16 +76,15 @@ const restoreMinimizedWindow = (id) => {
};
const updateCurrentTime = () => {
- // Map i18n locale to a specific locale for time formatting
const timeLocale = locale.value === 'zh-tw' ? 'zh-TW' : 'en-US';
currentTime.value = new Date().toLocaleTimeString(timeLocale);
};
-// Watch for locale changes to update the time format immediately
+
watch(locale, updateCurrentTime);
onMounted(() => {
isMounted.value = true;
- updateCurrentTime(); // Set initial time based on current locale
+ updateCurrentTime();
timerId = setInterval(updateCurrentTime, 1000);
});
@@ -113,53 +100,20 @@ onUnmounted(() => {
display: flex;
justify-content: space-between;
align-items: center;
- background-color: #c0c0c0; /* Classic Windows gray */
+ background-color: #c0c0c0;
padding: 4px 6px;
border-top: 2px solid #ffffff;
border-bottom: 2px solid #808080;
width: 100%;
box-sizing: border-box;
height: 40px;
- position: relative; /* For positioning the start menu */
+ position: relative;
}
.start-section {
position: relative;
display: flex;
align-items: center;
- flex-grow: 0; /* Don't let start section grow */
-}
-
-.right-section {
- display: flex;
- align-items: center;
- gap: 6px;
-}
-
-.task-buttons {
- display: flex;
- flex-grow: 1; /* Allow task buttons to take available space */
- margin-left: 10px; /* Space between start button and task buttons */
- gap: 6px;
- overflow-x: auto; /* Allow horizontal scrolling if many windows */
- padding-bottom: 2px; /* Prevent scrollbar from overlapping border */
-}
-
-.task-button {
- padding: 4px 8px;
- border: 2px solid;
- border-color: #808080 #ffffff #ffffff #808080;
- background-color: #c0c0c0;
- font-weight: bold;
- font-size: 0.9rem;
- cursor: pointer;
- color: black;
- white-space: nowrap; /* Prevent text wrapping */
- flex-shrink: 0; /* Prevent buttons from shrinking */
-}
-
-.task-button:active {
- border-color: #ffffff #808080 #808080 #ffffff;
}
.start-button {
@@ -181,26 +135,31 @@ onUnmounted(() => {
.start-icon {
margin-right: 8px;
+ width: 20px;
+ height: 20px;
}
.start-menu {
position: absolute;
- top: 100%; /* Opens downwards from the taskbar */
+ top: 100%;
left: 0;
background-color: #c0c0c0;
border: 2px solid;
border-color: #ffffff #808080 #808080 #ffffff;
padding: 4px;
- min-width: 160px;
+ min-width: 200px;
z-index: 1001;
}
.menu-item {
- padding: 4px 8px;
+ padding: 8px 12px;
cursor: pointer;
white-space: nowrap;
border: 1px solid transparent;
color: black;
+ display: flex;
+ align-items: center;
+ gap: 10px;
}
.menu-item:hover {
@@ -209,7 +168,43 @@ onUnmounted(() => {
border-color: #000080;
}
-.language-toggle {
+.menu-icon {
+ width: 24px;
+ height: 24px;
+}
+
+.task-buttons {
+ display: flex;
+ flex-grow: 1;
+ margin-left: 10px;
+ gap: 6px;
+ overflow-x: auto;
+}
+
+.task-button {
+ padding: 4px 8px;
+ border: 2px solid;
+ border-color: #808080 #ffffff #ffffff #808080;
+ background-color: #c0c0c0;
+ font-weight: bold;
+ font-size: 0.9rem;
+ cursor: pointer;
+ color: black;
+ white-space: nowrap;
+ flex-shrink: 0;
+}
+
+.task-button:active {
+ border-color: #ffffff #808080 #808080 #ffffff;
+}
+
+.right-section {
+ display: flex;
+ align-items: center;
+ gap: 6px;
+}
+
+.language-toggle, .clock {
padding: 4px 8px;
border: 2px solid;
border-color: #808080 #ffffff #ffffff #808080;
@@ -222,13 +217,4 @@ onUnmounted(() => {
.language-toggle:active {
border-color: #ffffff #808080 #808080 #ffffff;
}
-
-.clock {
- padding: 4px 8px;
- border: 2px solid;
- border-color: #808080 #ffffff #ffffff #808080;
- font-size: 0.9rem;
- color: black;
- background-color: #c0c0c0;
-}
diff --git a/app/components/TerminalWindow.vue b/app/components/TerminalWindow.vue
index 64ee1a9..ffd5f0c 100644
--- a/app/components/TerminalWindow.vue
+++ b/app/components/TerminalWindow.vue
@@ -1,115 +1,57 @@
-
-
-
{{ t(windowData.title) }}
-
-
-
+
-
-
- guest@daniels-mac:~$
-
-
-
-
+
diff --git a/app/components/WindowFrame.vue b/app/components/WindowFrame.vue
new file mode 100644
index 0000000..09ed8d0
--- /dev/null
+++ b/app/components/WindowFrame.vue
@@ -0,0 +1,149 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/pages/index.vue b/app/pages/index.vue
index e3f30e9..1da9b2a 100644
--- a/app/pages/index.vue
+++ b/app/pages/index.vue
@@ -1,16 +1,15 @@
+
+
-
-
[PC]
-
{{ $t('my_computer') }}
-
-
-
[BIN]
-
{{ $t('recycle_bin') }}
-
-
-
[>]_
-
{{ $t('terminal') }}
+
@@ -56,4 +55,4 @@
padding: 2px 4px;
font-size: 0.8rem;
}
-
+
\ No newline at end of file