Skip to content

Commit 44a3016

Browse files
add Calculatro.app
1 parent 8dd4bec commit 44a3016

23 files changed

Lines changed: 615 additions & 160 deletions

File tree

MacOSWeb.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default function MacOSWeb() {
3434
const openApp = useCallback((appId) => {
3535
setWindows(prev => {
3636
if (prev.find(w => w.id === appId)) return prev;
37-
const p = INITIAL_POSITIONS[appId] || { x: 120, y: 80, w: 600, h: 420 };
37+
const p = INITIAL_POSITIONS[appId] || { x: 120, y: 80 };
3838
const app = APPS.find(a => a.id === appId);
3939
return [...prev, { id: appId, title: app?.name || appId, x: p.x, y: p.y, width: p.w, height: p.h, zIndex: Date.now() }];
4040
});
@@ -94,7 +94,7 @@ export default function MacOSWeb() {
9494
const openApp = useCallback((appId) => {
9595
setWindows(prev => {
9696
if (prev.find((w) => w.id === appId)) return prev;
97-
const p = INITIAL_POSITIONS[appId] || { x: 120, y: 80, w: 600, h: 420 };
97+
const p = INITIAL_POSITIONS[appId] || { x: 120, y: 80 };
9898
const app = APPS.find((a) => a.id === appId);
9999
return [...prev, { id: appId, title: app?.name || appId, x: p.x, y: p.y, width: p.w, height: p.h, zIndex: ++zCounter }];
100100
});

src/App.jsx

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
import React, { useState, useCallback, useEffect, memo } from "react";
2-
import { useMobileCheck } from "@/core/hooks";
3-
import { useContextMenu } from "@/core/hooks";
4-
import { WindowManagerProvider, useWindowManager } from "@/core/providers";
5-
import { ThemeProvider, useTheme } from "@/core/providers";
2+
import { useMobileCheck, useContextMenu } from "@/core/hooks";
3+
import { WindowManagerProvider, useWindowManager, ThemeProvider, useTheme } from "@/core/providers";
64
// UI компоненты
75
import { BootScreen, MobileNotSupported, ContextMenu } from "@/ui";
86
// Layout компоненты
97
import { Desktop, Dock, WindowList } from "@/windows";
108
import { MenuBar } from "@/features/menubar/MenuBar";
11-
// Оптимизация: ленивая загрузка обоев
9+
// Ленивая загрузка обоев
1210
import defaultWallpaperDark from "@/assets/images/wallpapers/Tahoe/Tahoe Dark.webp";
1311
import defaultWallpaperLight from "@/assets/images/wallpapers/Tahoe/Tahoe Light.webp";
1412

@@ -65,7 +63,6 @@ function AppContent() {
6563
onZoom={() => windowManager.maximizeWindow(windowManager.activeWin)}
6664
/>
6765

68-
{/* ✅ Окна рендерятся независимо через WindowList */}
6966
<WindowList setWallpaper={setWallpaper} />
7067

7168
<Dock
@@ -88,17 +85,15 @@ function AppContent() {
8885
}
8986

9087
/**
91-
* AppInner — управляет boot screen и провайдерами
88+
* AppInner — управление boot screen
9289
*/
9390
function AppInner() {
9491
const isMobile = useMobileCheck();
9592
const [bootComplete, setBootComplete] = useState(false);
9693

97-
// Показываем boot screen сразу, не ждем инициализацию
9894
if (!bootComplete) return <BootScreen onComplete={() => setBootComplete(true)} />;
9995
if (isMobile) return <MobileNotSupported />;
10096

101-
// Рендерим провайдеры и контент
10297
return (
10398
<ThemeProvider>
10499
<WindowManagerProvider>
38.6 KB
Loading
-3.44 KB
Binary file not shown.
-2.95 KB
Binary file not shown.
-2.26 KB
Binary file not shown.
-4.68 KB
Binary file not shown.
39.9 KB
Loading

src/assets/paths.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export const APP_ICONS = {
77
music: "icons/apps/Dark_Themes/Music_Dark.png",
88
settings: "icons/apps/Dark_Themes/Settings_Dark.png",
99
calendar: "icons/apps/Dark_Themes/Calendrier_Dark.png",
10+
calculator: "icons/apps/Dark_Themes/Calculator_Dark.png"
1011
};
1112

1213
/**===== Светлые иконки приложений для светлой темы =====**/
@@ -18,6 +19,7 @@ export const APP_ICONS_LIGHT = {
1819
music: "icons/apps/Light_Themes/apple_music.ico",
1920
settings: "icons/apps/Light_Themes/settings_1.png",
2021
calendar: "icons/apps/Light_Themes/Calendrier.png",
22+
calculator: "icons/apps/Light_Themes/Calculator.png"
2123
};
2224

2325
/**===== Emoji-fallback для иконок приложений =====**/
@@ -29,4 +31,5 @@ export const APP_ICON_FALLBACK = {
2931
music: "🎵",
3032
settings: "⚙️",
3133
calendar: "📅",
34+
calculator: "🧮"
3235
};

src/core/constants/apps.jsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export const INITIAL_POSITIONS = {
1212
music: { x: 160, y: 130, w: 1000, h: 500 },
1313
settings: { x: 180, y: 150, w: 700, h: 450 },
1414
calendar: { x: 200, y: 120, w: 900, h: 580 },
15+
calculator: { x: 500, y: 150 },
1516
};
1617

1718
export const APPS = [
@@ -70,4 +71,12 @@ export const APPS = [
7071
icon: APP_ICON_FALLBACK.calendar,
7172
color: "#FF3B30",
7273
},
74+
{
75+
id: "calculator",
76+
name: "Calculator",
77+
iconPath: APP_ICONS.calculator,
78+
iconPathLight: APP_ICONS_LIGHT.calculator,
79+
icon: APP_ICON_FALLBACK.calculator,
80+
color: "#FF9500",
81+
},
7382
];

0 commit comments

Comments
 (0)