File size: 7,682 Bytes
8800c81
 
5c86297
8800c81
 
 
 
5c86297
8800c81
 
5c86297
 
 
 
 
 
 
 
 
 
 
 
 
 
8800c81
5c86297
 
 
 
 
 
 
aa1fcca
 
5c86297
 
 
 
 
8800c81
5c86297
 
 
 
 
 
 
 
 
 
 
f0175ec
 
 
 
 
 
 
 
 
5c86297
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
664a5eb
5c86297
aa1fcca
 
 
 
 
 
 
 
 
5c86297
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8800c81
5c86297
 
 
 
 
 
 
 
8800c81
5c86297
 
 
 
 
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
import React from 'react';

interface DesktopStartMenuProps extends React.HTMLAttributes<HTMLDivElement> {
  isOpen: boolean;
  onOpenWindow: (id: string) => void;
  onTriggerSync: () => void;
  onSignOut: () => void;
  style?: React.CSSProperties;
}

export const DesktopStartMenu = React.forwardRef<HTMLDivElement, DesktopStartMenuProps>(
  (
    {
      isOpen,
      onOpenWindow,
      onTriggerSync,
      onSignOut,
      style,
      className,
      ...rest
    },
    ref
  ) => {
    if (!isOpen) return null;

    return (
      <div
        ref={ref}
        onClick={(e) => e.stopPropagation()}
        id="start-menu"
        style={style}
        {...rest}
        className={`w-64 bg-white border-[3px] border-ink-black shadow-[6px_6px_0px_0px_#1E293B] flex flex-col p-4 z-[90] select-none ${style ? '' : 'absolute bottom-14 left-0 ml-2 mb-2'
          } ${className || ''}`}
      >
        <div className="flex items-center justify-between border-b-[2px] border-ink-black pb-2 mb-3">
          <span className="font-arcade text-[9px] font-bold text-ink-black tracking-wider">ALGOSPACED OS</span>
          <span className="font-arcade text-[7px] font-extrabold bg-[#facc15] text-ink-black px-1.5 py-0.5 border-[1.5px] border-ink-black shadow-[1.5px_1.5px_0_0_#1E293B]">
            BETA
          </span>
        </div>
        <div className="flex flex-col gap-2.5 font-window-title text-base font-bold">
          <button
            onClick={() => onOpenWindow('queue')}
            className="w-full text-left hover:bg-secondary-container px-3 py-1.5 border-2 border-transparent hover:border-ink-black transition-colors cursor-pointer flex items-center gap-2"
          >
            <span className="material-symbols-outlined text-lg" style={{ fontVariationSettings: "'FILL' 1" }}>
              view_list
            </span>
            Daily Queue
          </button>
          <button
            onClick={() => onOpenWindow('cardManager')}
            className="w-full text-left hover:bg-sky-100 px-3 py-1.5 border-2 border-transparent hover:border-ink-black transition-colors cursor-pointer flex items-center gap-2"
          >
            <span className="material-symbols-outlined text-lg text-sky-600" style={{ fontVariationSettings: "'FILL' 1" }}>
              style
            </span>
            Card Manager
          </button>
          <button
            onClick={() => onOpenWindow('journey')}
            className="w-full text-left hover:bg-secondary-container px-3 py-1.5 border-2 border-transparent hover:border-ink-black transition-colors cursor-pointer flex items-center gap-2"
          >
            <span className="material-symbols-outlined text-lg" style={{ fontVariationSettings: "'FILL' 1" }}>
              route
            </span>
            Journey Path
          </button>
          <button
            onClick={onTriggerSync}
            className="w-full text-left hover:bg-secondary-container px-3 py-1.5 border-2 border-transparent hover:border-ink-black transition-colors cursor-pointer flex items-center gap-2"
          >
            <span className="material-symbols-outlined text-lg" style={{ fontVariationSettings: "'FILL' 1" }}>
              cloud_sync
            </span>
            Drive Sync
          </button>
          <button
            onClick={() => onOpenWindow('github')}
            className="w-full text-left hover:bg-slate-100 px-3 py-1.5 border-2 border-transparent hover:border-ink-black transition-colors cursor-pointer flex items-center gap-2"
          >
            <span className="material-symbols-outlined text-lg text-slate-800" style={{ fontVariationSettings: "'FILL' 1" }}>
              code
            </span>
            GitHub Solutions
          </button>
          <button
            onClick={() => onOpenWindow('terminal')}
            className="w-full text-left hover:bg-secondary-container px-3 py-1.5 border-2 border-transparent hover:border-ink-black transition-colors cursor-pointer flex items-center gap-2"
          >
            <span className="material-symbols-outlined text-lg" style={{ fontVariationSettings: "'FILL' 1" }}>
              terminal
            </span>
            Terminal
          </button>
          <button
            onClick={() => onOpenWindow('computer')}
            className="w-full text-left hover:bg-secondary-container px-3 py-1.5 border-2 border-transparent hover:border-ink-black transition-colors cursor-pointer flex items-center gap-2"
          >
            <span className="material-symbols-outlined text-lg" style={{ fontVariationSettings: "'FILL' 1" }}>
              desktop_windows
            </span>
            My Computer
          </button>
          <button
            onClick={() => onOpenWindow('companion')}
            className="w-full text-left hover:bg-[#ffe24c]/40 px-3 py-1.5 border-2 border-transparent hover:border-[#f59e0b] transition-colors cursor-pointer flex items-center gap-2"
          >
            <span className="material-symbols-outlined text-lg text-[#f59e0b]" style={{ fontVariationSettings: "'FILL' 1" }}>
              castle
            </span>
            Auri
          </button>
          <button
            onClick={() => onOpenWindow('store')}
            className="w-full text-left hover:bg-amber-100 px-3 py-1.5 border-2 border-transparent hover:border-ink-black transition-colors cursor-pointer flex items-center gap-2"
          >
            <span className="material-symbols-outlined text-lg text-amber-600" style={{ fontVariationSettings: "'FILL' 1" }}>
              storefront
            </span>
            STORE
          </button>
          <button
            onClick={() => onOpenWindow('python')}
            className="w-full text-left hover:bg-secondary-container px-3 py-1.5 border-2 border-transparent hover:border-ink-black transition-colors cursor-pointer flex items-center gap-2"
          >
            <span className="material-symbols-outlined text-lg" style={{ fontVariationSettings: "'FILL' 1" }}>
              sports_esports
            </span>
            Python Challenge
          </button>
          <button
            onClick={() => onOpenWindow('mysql')}
            className="w-full text-left hover:bg-secondary-container px-3 py-1.5 border-2 border-transparent hover:border-ink-black transition-colors cursor-pointer flex items-center gap-2"
          >
            <span className="material-symbols-outlined text-lg" style={{ fontVariationSettings: "'FILL' 1" }}>
              database
            </span>
            MySQL Playground
          </button>
          <button
            onClick={() => onOpenWindow('settings')}
            className="w-full text-left hover:bg-[#10b981]/25 px-3 py-1.5 border-2 border-transparent hover:border-[#10b981] transition-colors cursor-pointer flex items-center gap-2"
          >
            <span className="material-symbols-outlined text-lg text-[#10b981]" style={{ fontVariationSettings: "'FILL' 1" }}>
              key
            </span>
            API Configuration
          </button>
        </div>

        <div className="mt-4 flex justify-end border-t-[3px] border-ink-black pt-4 select-none">
          <button
            onClick={onSignOut}
            className="bg-highlight-pink text-white font-window-title px-4 py-2.5 border-[3px] border-ink-black shadow-[3px_3px_0px_0px_#1E293B] active:translate-y-0.5 active:translate-x-0.5 active:shadow-none hover:bg-rose-600 transition-all cursor-pointer font-bold uppercase text-xs"
          >
            Shut Down
          </button>
        </div>
      </div>
    );
  }
);

DesktopStartMenu.displayName = 'DesktopStartMenu';