├── src ├── api │ ├── index.ts │ └── widget.ts ├── utils │ ├── request │ │ ├── index.ts │ │ ├── requestWidget.ts │ │ └── factory.ts │ ├── storage.ts │ ├── index.ts │ └── appList.ts ├── assets │ ├── code.png │ ├── avatar.jpg │ ├── img │ │ ├── lock.jpg │ │ ├── desktop │ │ │ ├── ark.png │ │ │ ├── camera.png │ │ │ ├── excel.png │ │ │ ├── github.png │ │ │ ├── mail.png │ │ │ ├── paint.png │ │ │ ├── photos.png │ │ │ ├── store.png │ │ │ ├── todo.png │ │ │ ├── vscode.png │ │ │ ├── word.png │ │ │ ├── Computer.png │ │ │ ├── Explorer.png │ │ │ ├── Network.png │ │ │ ├── feedback.png │ │ │ ├── notepad.png │ │ │ ├── settings.png │ │ │ ├── terminal.png │ │ │ ├── wy-music.png │ │ │ ├── Trash Full.png │ │ │ ├── calculator.png │ │ │ ├── powerpoint.png │ │ │ ├── Control Panel.png │ │ │ └── edge browser.png │ │ └── wapppaper │ │ │ ├── dark │ │ │ └── dark.jpg │ │ │ ├── ThemeA │ │ │ ├── img0.jpg │ │ │ ├── img1.jpg │ │ │ ├── img2.jpg │ │ │ └── img3.jpg │ │ │ ├── ThemeB │ │ │ ├── img0.jpg │ │ │ ├── img1.jpg │ │ │ ├── img2.jpg │ │ │ └── img3.jpg │ │ │ ├── ThemeC │ │ │ ├── img0.jpg │ │ │ ├── img1.jpg │ │ │ ├── img2.jpg │ │ │ └── img3.jpg │ │ │ ├── ThemeD │ │ │ ├── img0.jpg │ │ │ ├── img1.jpg │ │ │ ├── img2.jpg │ │ │ └── img3.jpg │ │ │ └── default │ │ │ └── default.jpg │ ├── icon │ │ ├── status │ │ │ ├── sun.png │ │ │ ├── audio0.png │ │ │ ├── audio1.png │ │ │ ├── audio2.png │ │ │ ├── audio3.png │ │ │ ├── moon.png │ │ │ ├── wifi.png │ │ │ ├── airplane.png │ │ │ ├── settings.png │ │ │ ├── weather.png │ │ │ ├── bluetooth.png │ │ │ ├── nightlight.png │ │ │ ├── network-wired-symbolic.svg │ │ │ └── audio-volume-high-symbolic.svg │ │ ├── task │ │ │ ├── edge.png │ │ │ ├── home.png │ │ │ ├── skype.png │ │ │ ├── teams.png │ │ │ ├── Folder.png │ │ │ ├── defender.png │ │ │ ├── explorer.png │ │ │ ├── search.png │ │ │ ├── settings.png │ │ │ ├── vscode.png │ │ │ ├── widget.png │ │ │ └── wy-music.png │ │ ├── actions │ │ │ ├── ark.png │ │ │ ├── baidu.png │ │ │ ├── excel.png │ │ │ ├── mail.png │ │ │ ├── paint.png │ │ │ ├── sina.png │ │ │ ├── store.png │ │ │ ├── todo.png │ │ │ ├── word.png │ │ │ ├── Network.png │ │ │ ├── camera.png │ │ │ ├── github.png │ │ │ ├── notepad.png │ │ │ ├── photos.png │ │ │ ├── vscode.png │ │ │ ├── Computer.png │ │ │ ├── Explorer.png │ │ │ ├── Trash Full.png │ │ │ ├── calculator.png │ │ │ ├── feedback.png │ │ │ ├── powerpoint.png │ │ │ ├── settings.png │ │ │ ├── terminal.png │ │ │ ├── wy-music.png │ │ │ ├── edge browser.png │ │ │ ├── Control Panel.png │ │ │ ├── window-minimize-symbolic.svg │ │ │ ├── window-maximize-symbolic.svg │ │ │ ├── window-restore-symbolic.svg │ │ │ └── window-close-symbolic.svg │ │ └── folder-documents-symbolic.svg │ ├── css │ │ ├── common.ts │ │ ├── theme.ts │ │ └── reset.css │ └── logo.svg ├── index.tsx ├── store │ ├── app │ │ ├── reducers.ts │ │ ├── state.ts │ │ └── index.ts │ ├── win │ │ ├── asyncThunk.ts │ │ ├── index.ts │ │ ├── state.ts │ │ └── reducers.ts │ └── index.ts ├── typings │ └── index.d.ts ├── app │ ├── Music.tsx │ ├── Settings.tsx │ ├── Explorer.tsx │ ├── VSCode.tsx │ └── Edge │ │ ├── type-css.ts │ │ └── index.tsx ├── hooks │ ├── useEvent.ts │ ├── useStatusEff.ts │ ├── useDeferState.ts │ ├── UseTime.ts │ ├── useResize.ts │ └── useContextmenu.ts ├── components │ ├── Loading │ │ ├── index.tsx │ │ └── type-css.ts │ ├── Button │ │ ├── index.tsx │ │ └── type-css.ts │ ├── Icon │ │ ├── index.tsx │ │ └── type-css.ts │ ├── Image │ │ ├── type-css.ts │ │ └── index.tsx │ ├── DesktopIcon │ │ ├── index.tsx │ │ └── type-css.ts │ ├── Input │ │ ├── index.tsx │ │ └── type-css.ts │ ├── Menu │ │ ├── type-css.ts │ │ └── index.tsx │ └── AppShell │ │ ├── SplitScreen.tsx │ │ └── type-css.ts ├── screen │ ├── Desktop │ │ ├── components │ │ │ ├── TaskBar │ │ │ │ ├── TaskWidget │ │ │ │ │ ├── SystemInfo.tsx │ │ │ │ │ ├── StartMenu.tsx │ │ │ │ │ ├── index.tsx │ │ │ │ │ └── SearchMenu.tsx │ │ │ │ ├── Hideapp.tsx │ │ │ │ ├── index.tsx │ │ │ │ ├── TaskPreview.tsx │ │ │ │ ├── TaskIcon.tsx │ │ │ │ ├── Widget.tsx │ │ │ │ ├── Notifier.tsx │ │ │ │ ├── TaskStatus.tsx │ │ │ │ └── TaskDate.tsx │ │ │ ├── MenuIcon.tsx │ │ │ ├── render.tsx │ │ │ ├── Menu.tsx │ │ │ └── DesktopIconList.tsx │ │ └── index.tsx │ ├── Bootstrap │ │ ├── type-css.ts │ │ └── index.tsx │ ├── ErrorBoundary │ │ ├── type-css.ts │ │ └── index.tsx │ └── LoginLock │ │ ├── type-css.ts │ │ └── index.tsx └── App.tsx ├── .gitignore ├── .prettierignore ├── commitlint.config.js ├── public ├── favicon.ico ├── preview-1.png ├── preview-3.png ├── preview-4.png ├── preview-5.png ├── preview-6.png ├── preview-2-1.png ├── preview-2-2.png ├── preview-7-1.png ├── preview-7-2.png └── index.html ├── .husky ├── pre-commit └── commit-msg ├── .eslintignore ├── .editorconfig ├── tsconfig.json ├── config ├── webpack.dev.js ├── webpack.prod.js └── webpack.common.js ├── scripts └── deploy.js ├── .eslintrc.js ├── README.md ├── .prettierrc.js ├── LICENSE ├── .github └── workflows │ └── build&deploy.yml └── package.json /src/api/index.ts: -------------------------------------------------------------------------------- 1 | export * from './widget' 2 | -------------------------------------------------------------------------------- /src/utils/request/index.ts: -------------------------------------------------------------------------------- 1 | export * from './requestWidget' 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | build 3 | yarn-error.log 4 | DS_Store -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | **/*.svg 2 | **/*.yml 3 | **/*.html 4 | **/*.jpg 5 | **/*.png -------------------------------------------------------------------------------- /commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { extends: ['@commitlint/config-conventional'] } 2 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /public/preview-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/public/preview-1.png -------------------------------------------------------------------------------- /public/preview-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/public/preview-3.png -------------------------------------------------------------------------------- /public/preview-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/public/preview-4.png -------------------------------------------------------------------------------- /public/preview-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/public/preview-5.png -------------------------------------------------------------------------------- /public/preview-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/public/preview-6.png -------------------------------------------------------------------------------- /src/assets/code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/code.png -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | . "$(dirname -- "$0")/_/husky.sh" 3 | 4 | npm run lint 5 | -------------------------------------------------------------------------------- /public/preview-2-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/public/preview-2-1.png -------------------------------------------------------------------------------- /public/preview-2-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/public/preview-2-2.png -------------------------------------------------------------------------------- /public/preview-7-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/public/preview-7-1.png -------------------------------------------------------------------------------- /public/preview-7-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/public/preview-7-2.png -------------------------------------------------------------------------------- /src/assets/avatar.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/avatar.jpg -------------------------------------------------------------------------------- /src/assets/img/lock.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/img/lock.jpg -------------------------------------------------------------------------------- /src/assets/icon/status/sun.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/status/sun.png -------------------------------------------------------------------------------- /src/assets/icon/task/edge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/task/edge.png -------------------------------------------------------------------------------- /src/assets/icon/task/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/task/home.png -------------------------------------------------------------------------------- /src/assets/icon/task/skype.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/task/skype.png -------------------------------------------------------------------------------- /src/assets/icon/task/teams.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/task/teams.png -------------------------------------------------------------------------------- /src/assets/img/desktop/ark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/img/desktop/ark.png -------------------------------------------------------------------------------- /src/assets/icon/actions/ark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/actions/ark.png -------------------------------------------------------------------------------- /src/assets/icon/actions/baidu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/actions/baidu.png -------------------------------------------------------------------------------- /src/assets/icon/actions/excel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/actions/excel.png -------------------------------------------------------------------------------- /src/assets/icon/actions/mail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/actions/mail.png -------------------------------------------------------------------------------- /src/assets/icon/actions/paint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/actions/paint.png -------------------------------------------------------------------------------- /src/assets/icon/actions/sina.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/actions/sina.png -------------------------------------------------------------------------------- /src/assets/icon/actions/store.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/actions/store.png -------------------------------------------------------------------------------- /src/assets/icon/actions/todo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/actions/todo.png -------------------------------------------------------------------------------- /src/assets/icon/actions/word.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/actions/word.png -------------------------------------------------------------------------------- /src/assets/icon/status/audio0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/status/audio0.png -------------------------------------------------------------------------------- /src/assets/icon/status/audio1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/status/audio1.png -------------------------------------------------------------------------------- /src/assets/icon/status/audio2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/status/audio2.png -------------------------------------------------------------------------------- /src/assets/icon/status/audio3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/status/audio3.png -------------------------------------------------------------------------------- /src/assets/icon/status/moon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/status/moon.png -------------------------------------------------------------------------------- /src/assets/icon/status/wifi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/status/wifi.png -------------------------------------------------------------------------------- /src/assets/icon/task/Folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/task/Folder.png -------------------------------------------------------------------------------- /src/assets/icon/task/defender.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/task/defender.png -------------------------------------------------------------------------------- /src/assets/icon/task/explorer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/task/explorer.png -------------------------------------------------------------------------------- /src/assets/icon/task/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/task/search.png -------------------------------------------------------------------------------- /src/assets/icon/task/settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/task/settings.png -------------------------------------------------------------------------------- /src/assets/icon/task/vscode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/task/vscode.png -------------------------------------------------------------------------------- /src/assets/icon/task/widget.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/task/widget.png -------------------------------------------------------------------------------- /src/assets/icon/task/wy-music.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/task/wy-music.png -------------------------------------------------------------------------------- /src/assets/img/desktop/camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/img/desktop/camera.png -------------------------------------------------------------------------------- /src/assets/img/desktop/excel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/img/desktop/excel.png -------------------------------------------------------------------------------- /src/assets/img/desktop/github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/img/desktop/github.png -------------------------------------------------------------------------------- /src/assets/img/desktop/mail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/img/desktop/mail.png -------------------------------------------------------------------------------- /src/assets/img/desktop/paint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/img/desktop/paint.png -------------------------------------------------------------------------------- /src/assets/img/desktop/photos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/img/desktop/photos.png -------------------------------------------------------------------------------- /src/assets/img/desktop/store.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/img/desktop/store.png -------------------------------------------------------------------------------- /src/assets/img/desktop/todo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/img/desktop/todo.png -------------------------------------------------------------------------------- /src/assets/img/desktop/vscode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/img/desktop/vscode.png -------------------------------------------------------------------------------- /src/assets/img/desktop/word.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/img/desktop/word.png -------------------------------------------------------------------------------- /.husky/commit-msg: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | . "$(dirname -- "$0")/_/husky.sh" 3 | 4 | npx --no-install commitlint --edit $1 5 | -------------------------------------------------------------------------------- /src/assets/icon/actions/Network.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/actions/Network.png -------------------------------------------------------------------------------- /src/assets/icon/actions/camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/actions/camera.png -------------------------------------------------------------------------------- /src/assets/icon/actions/github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/actions/github.png -------------------------------------------------------------------------------- /src/assets/icon/actions/notepad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/actions/notepad.png -------------------------------------------------------------------------------- /src/assets/icon/actions/photos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/actions/photos.png -------------------------------------------------------------------------------- /src/assets/icon/actions/vscode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/actions/vscode.png -------------------------------------------------------------------------------- /src/assets/icon/status/airplane.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/status/airplane.png -------------------------------------------------------------------------------- /src/assets/icon/status/settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/status/settings.png -------------------------------------------------------------------------------- /src/assets/icon/status/weather.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/status/weather.png -------------------------------------------------------------------------------- /src/assets/img/desktop/Computer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/img/desktop/Computer.png -------------------------------------------------------------------------------- /src/assets/img/desktop/Explorer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/img/desktop/Explorer.png -------------------------------------------------------------------------------- /src/assets/img/desktop/Network.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/img/desktop/Network.png -------------------------------------------------------------------------------- /src/assets/img/desktop/feedback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/img/desktop/feedback.png -------------------------------------------------------------------------------- /src/assets/img/desktop/notepad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/img/desktop/notepad.png -------------------------------------------------------------------------------- /src/assets/img/desktop/settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/img/desktop/settings.png -------------------------------------------------------------------------------- /src/assets/img/desktop/terminal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/img/desktop/terminal.png -------------------------------------------------------------------------------- /src/assets/img/desktop/wy-music.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/img/desktop/wy-music.png -------------------------------------------------------------------------------- /src/assets/icon/actions/Computer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/actions/Computer.png -------------------------------------------------------------------------------- /src/assets/icon/actions/Explorer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/actions/Explorer.png -------------------------------------------------------------------------------- /src/assets/icon/actions/Trash Full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/actions/Trash Full.png -------------------------------------------------------------------------------- /src/assets/icon/actions/calculator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/actions/calculator.png -------------------------------------------------------------------------------- /src/assets/icon/actions/feedback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/actions/feedback.png -------------------------------------------------------------------------------- /src/assets/icon/actions/powerpoint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/actions/powerpoint.png -------------------------------------------------------------------------------- /src/assets/icon/actions/settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/actions/settings.png -------------------------------------------------------------------------------- /src/assets/icon/actions/terminal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/actions/terminal.png -------------------------------------------------------------------------------- /src/assets/icon/actions/wy-music.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/actions/wy-music.png -------------------------------------------------------------------------------- /src/assets/icon/status/bluetooth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/status/bluetooth.png -------------------------------------------------------------------------------- /src/assets/icon/status/nightlight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/status/nightlight.png -------------------------------------------------------------------------------- /src/assets/img/desktop/Trash Full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/img/desktop/Trash Full.png -------------------------------------------------------------------------------- /src/assets/img/desktop/calculator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/img/desktop/calculator.png -------------------------------------------------------------------------------- /src/assets/img/desktop/powerpoint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/img/desktop/powerpoint.png -------------------------------------------------------------------------------- /src/assets/img/wapppaper/dark/dark.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/img/wapppaper/dark/dark.jpg -------------------------------------------------------------------------------- /src/assets/icon/actions/edge browser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/actions/edge browser.png -------------------------------------------------------------------------------- /src/assets/img/desktop/Control Panel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/img/desktop/Control Panel.png -------------------------------------------------------------------------------- /src/assets/img/desktop/edge browser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/img/desktop/edge browser.png -------------------------------------------------------------------------------- /src/assets/img/wapppaper/ThemeA/img0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/img/wapppaper/ThemeA/img0.jpg -------------------------------------------------------------------------------- /src/assets/img/wapppaper/ThemeA/img1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/img/wapppaper/ThemeA/img1.jpg -------------------------------------------------------------------------------- /src/assets/img/wapppaper/ThemeA/img2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/img/wapppaper/ThemeA/img2.jpg -------------------------------------------------------------------------------- /src/assets/img/wapppaper/ThemeA/img3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/img/wapppaper/ThemeA/img3.jpg -------------------------------------------------------------------------------- /src/assets/img/wapppaper/ThemeB/img0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/img/wapppaper/ThemeB/img0.jpg -------------------------------------------------------------------------------- /src/assets/img/wapppaper/ThemeB/img1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/img/wapppaper/ThemeB/img1.jpg -------------------------------------------------------------------------------- /src/assets/img/wapppaper/ThemeB/img2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/img/wapppaper/ThemeB/img2.jpg -------------------------------------------------------------------------------- /src/assets/img/wapppaper/ThemeB/img3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/img/wapppaper/ThemeB/img3.jpg -------------------------------------------------------------------------------- /src/assets/img/wapppaper/ThemeC/img0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/img/wapppaper/ThemeC/img0.jpg -------------------------------------------------------------------------------- /src/assets/img/wapppaper/ThemeC/img1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/img/wapppaper/ThemeC/img1.jpg -------------------------------------------------------------------------------- /src/assets/img/wapppaper/ThemeC/img2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/img/wapppaper/ThemeC/img2.jpg -------------------------------------------------------------------------------- /src/assets/img/wapppaper/ThemeC/img3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/img/wapppaper/ThemeC/img3.jpg -------------------------------------------------------------------------------- /src/assets/img/wapppaper/ThemeD/img0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/img/wapppaper/ThemeD/img0.jpg -------------------------------------------------------------------------------- /src/assets/img/wapppaper/ThemeD/img1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/img/wapppaper/ThemeD/img1.jpg -------------------------------------------------------------------------------- /src/assets/img/wapppaper/ThemeD/img2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/img/wapppaper/ThemeD/img2.jpg -------------------------------------------------------------------------------- /src/assets/img/wapppaper/ThemeD/img3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/img/wapppaper/ThemeD/img3.jpg -------------------------------------------------------------------------------- /src/assets/icon/actions/Control Panel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/icon/actions/Control Panel.png -------------------------------------------------------------------------------- /src/assets/img/wapppaper/default/default.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CVopen/react-to-win11/HEAD/src/assets/img/wapppaper/default/default.jpg -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | *.json 3 | webpack.config.js 4 | *.css 5 | *.less 6 | *.html 7 | *.svg 8 | *.png 9 | *.jpg 10 | .md 11 | ./build -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | end_of_line = lf 5 | insert_final_newline = true 6 | charset = utf-8 7 | indent_style = space 8 | indent_size = 2 9 | -------------------------------------------------------------------------------- /src/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ReactDOM from 'react-dom/client' 3 | import App from './App' 4 | 5 | const root = ReactDOM.createRoot(document.getElementById('root') as Element) 6 | 7 | root.render() 8 | -------------------------------------------------------------------------------- /src/store/app/reducers.ts: -------------------------------------------------------------------------------- 1 | import { PayloadAction } from '@reduxjs/toolkit' 2 | import { AppState } from './state' 3 | 4 | const addCount = (state: AppState, action: PayloadAction) => { 5 | state.count += action.payload 6 | } 7 | 8 | export default { 9 | addCount, 10 | } 11 | -------------------------------------------------------------------------------- /src/store/app/state.ts: -------------------------------------------------------------------------------- 1 | export interface CreatePathLocal { 2 | path: string[] 3 | folderList: { folderName: string; frame: '' | 'vue' | 'react' }[] 4 | } 5 | 6 | export interface AppState { 7 | count: number 8 | } 9 | 10 | export const initialState: AppState = { 11 | count: 0, 12 | } 13 | -------------------------------------------------------------------------------- /src/assets/icon/actions/window-minimize-symbolic.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/typings/index.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.css' { 2 | const content: { [selector: string]: string } 3 | export default content 4 | } 5 | 6 | declare module '*.svg' 7 | declare module '*.png' 8 | declare module '*.jpg' 9 | declare module '*.jpeg' 10 | declare module '*.gif' 11 | declare module '*.bmp' 12 | declare module '*.tiff' 13 | -------------------------------------------------------------------------------- /src/utils/request/requestWidget.ts: -------------------------------------------------------------------------------- 1 | import factory from './factory' 2 | 3 | interface IWidgetRes { 4 | code: number 5 | data?: T 6 | msg?: string 7 | } 8 | 9 | type Http = (url: string) => Promise> 10 | 11 | const instance = factory('https://api.vore.top/api') 12 | 13 | export const getVore: Http = (url) => instance.get(url) 14 | -------------------------------------------------------------------------------- /src/store/app/index.ts: -------------------------------------------------------------------------------- 1 | import { createSlice } from '@reduxjs/toolkit' 2 | 3 | import { initialState } from './state' 4 | import reducers from './reducers' 5 | 6 | export const appSlice = createSlice({ 7 | name: 'app', 8 | initialState, 9 | reducers: reducers, 10 | }) 11 | 12 | export default appSlice.reducer 13 | export const { addCount } = appSlice.actions 14 | -------------------------------------------------------------------------------- /src/app/Music.tsx: -------------------------------------------------------------------------------- 1 | import AppShell from '@/components/AppShell' 2 | import React, { memo } from 'react' 3 | 4 | function Music({ index }: { index: number }) { 5 | return ( 6 | header}> 7 |
Music
8 |
9 | ) 10 | } 11 | 12 | export default memo(Music) 13 | -------------------------------------------------------------------------------- /src/app/Settings.tsx: -------------------------------------------------------------------------------- 1 | import AppShell from '@/components/AppShell' 2 | import React, { memo } from 'react' 3 | 4 | function Settings({ index }: { index: number }) { 5 | return ( 6 | header}> 7 |
settings
8 |
9 | ) 10 | } 11 | 12 | export default memo(Settings) 13 | -------------------------------------------------------------------------------- /src/hooks/useEvent.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-undef */ 2 | import { useEffect } from 'react' 3 | 4 | export default function useEvent({ 5 | cb, 6 | eventName, 7 | }: { 8 | cb: (e: WindowEventMap[K]) => void 9 | eventName: K 10 | }) { 11 | useEffect(() => { 12 | window.addEventListener(eventName, cb) 13 | return () => window.removeEventListener(eventName, cb) 14 | }, [cb]) 15 | } 16 | -------------------------------------------------------------------------------- /src/assets/icon/actions/window-maximize-symbolic.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/components/Loading/index.tsx: -------------------------------------------------------------------------------- 1 | import React, { memo } from 'react' 2 | import { Circle, Div, LoadingProps } from './type-css' 3 | 4 | function Loading({ style, fill = 'transparent', stroke }: LoadingProps) { 5 | return ( 6 |
7 | 8 | 9 | 10 |
11 | ) 12 | } 13 | 14 | export default memo(Loading) 15 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "sourceMap": true, 4 | "outDir": "./dist", 5 | "target": "es5", 6 | "module": "esnext", 7 | "strict": true, 8 | "allowJs": true, 9 | "jsx": "react", 10 | "esModuleInterop": true, 11 | "allowSyntheticDefaultImports": true, 12 | "typeRoots": ["node_modules/@types", "src/typings"], 13 | "moduleResolution": "node", 14 | "paths": { 15 | "@/*": ["./src/*"] 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/components/Button/index.tsx: -------------------------------------------------------------------------------- 1 | import React, { memo } from 'react' 2 | import { Button, IBtnProps } from './type-css' 3 | 4 | function index({ onClick, style, children, follow = false, size = 'small', preIcon, icon, className }: IBtnProps) { 5 | return ( 6 | 11 | ) 12 | } 13 | 14 | export default memo(index) 15 | -------------------------------------------------------------------------------- /src/hooks/useStatusEff.ts: -------------------------------------------------------------------------------- 1 | import React, { useEffect, useState } from 'react' 2 | 3 | export default function useStatusEff( 4 | state: T, 5 | cb?: Function, 6 | deps?: any[], 7 | ): [T, React.Dispatch>] { 8 | const [refExist, setRefExist] = useState(state) 9 | 10 | useEffect( 11 | () => { 12 | if (cb) { 13 | return cb() 14 | } 15 | }, 16 | deps ? deps : [refExist], 17 | ) 18 | 19 | return [refExist, setRefExist] 20 | } 21 | -------------------------------------------------------------------------------- /src/store/win/asyncThunk.ts: -------------------------------------------------------------------------------- 1 | import { createAsyncThunk } from '@reduxjs/toolkit' 2 | import { WritableDraft } from 'immer/dist/internal' 3 | 4 | import { IWinState } from './state' 5 | 6 | export const bootstrapAsync = createAsyncThunk('app/bootstrap', () => { 7 | return new Promise((resolve) => { 8 | setTimeout(resolve, 3000) 9 | }) 10 | }) 11 | 12 | export default { 13 | [bootstrapAsync.fulfilled.type](state: WritableDraft) { 14 | state.boot = false 15 | }, 16 | } 17 | -------------------------------------------------------------------------------- /src/hooks/useDeferState.ts: -------------------------------------------------------------------------------- 1 | import React, { startTransition, useDeferredValue, useEffect, useState } from 'react' 2 | 3 | export default function useDeferState( 4 | state: T, 5 | cb?: () => void, 6 | deps?: any[], 7 | ): [T, React.Dispatch>] { 8 | const [refExist, setRefExist] = useState(state) 9 | const deferState = useDeferredValue(refExist) 10 | 11 | useEffect( 12 | () => { 13 | cb && startTransition(cb) 14 | }, 15 | deps ? deps : [refExist], 16 | ) 17 | 18 | return [deferState, setRefExist] 19 | } 20 | -------------------------------------------------------------------------------- /src/assets/icon/actions/window-restore-symbolic.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/assets/icon/folder-documents-symbolic.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/utils/request/factory.ts: -------------------------------------------------------------------------------- 1 | import axios, { AxiosInstance } from 'axios' 2 | 3 | export default factory 4 | 5 | function factory(baseURL: string): AxiosInstance { 6 | const instance = axios.create({ 7 | baseURL, 8 | headers: { 9 | 'Content-Type': 'application/json', 10 | }, 11 | timeout: 1 << 14, 12 | }) 13 | 14 | instance.interceptors.response.use( 15 | (response) => { 16 | if (response.data.code === 200) { 17 | return response.data 18 | } 19 | return Promise.reject(response.data) 20 | }, 21 | (error) => Promise.reject(error), 22 | ) 23 | 24 | return instance 25 | } 26 | -------------------------------------------------------------------------------- /src/app/Explorer.tsx: -------------------------------------------------------------------------------- 1 | import AppShell from '@/components/AppShell' 2 | import React, { memo } from 'react' 3 | 4 | function Explorer({ name, index }: { name: string; index: number }) { 5 | return ( 6 | header}> 7 |
8 | {name} 9 | { 12 | console.log('first') 13 | }} 14 | alt="" 15 | /> 16 |
17 |
18 | ) 19 | } 20 | 21 | export default memo(Explorer) 22 | -------------------------------------------------------------------------------- /src/components/Icon/index.tsx: -------------------------------------------------------------------------------- 1 | import React, { memo } from 'react' 2 | import { IIcon, ImgIcon, Size } from './type-css' 3 | 4 | function Icon({ src, style, size = 'middle', status, type, onClick, onMouseEnter, onMouseLeave, className }: IIcon) { 5 | return ( 6 | 16 | ) 17 | } 18 | 19 | export default memo(Icon) 20 | -------------------------------------------------------------------------------- /src/assets/icon/actions/window-close-symbolic.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | <%= htmlWebpackPlugin.options.title %> 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /src/screen/Desktop/components/TaskBar/TaskWidget/SystemInfo.tsx: -------------------------------------------------------------------------------- 1 | import React, { memo } from 'react' 2 | import Image from '@/components/Image' 3 | import { AiOutlinePoweroff } from 'react-icons/ai' 4 | 5 | function SystemInfo() { 6 | return ( 7 |
8 |
9 | 10 | cvopen 11 |
12 |
13 | 14 |
15 |
16 | ) 17 | } 18 | 19 | export default memo(SystemInfo) 20 | -------------------------------------------------------------------------------- /src/screen/Bootstrap/type-css.ts: -------------------------------------------------------------------------------- 1 | import styled from 'styled-components' 2 | import { DivFull } from '@/assets/css/common' 3 | 4 | export const Div = styled(DivFull)` 5 | background-color: #000; 6 | display: flex; 7 | justify-content: center; 8 | align-items: center; 9 | flex-direction: column; 10 | user-select: none; 11 | ` 12 | 13 | export const Img = styled.img` 14 | width: 300px; 15 | animation: App-logo-spin infinite 16s linear; 16 | @keyframes App-logo-spin { 17 | from { 18 | transform: rotate(0deg); 19 | } 20 | to { 21 | transform: rotate(360deg); 22 | } 23 | } 24 | ` 25 | 26 | export const LoadingDiv = styled.div` 27 | height: 200px; 28 | margin-top: 20rem; 29 | ` 30 | -------------------------------------------------------------------------------- /config/webpack.dev.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-require-imports */ 2 | const path = require('path') 3 | 4 | const webpack = require('webpack') 5 | const { merge } = require('webpack-merge') 6 | const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin') 7 | 8 | const common = require('./webpack.common') 9 | 10 | module.exports = merge(common, { 11 | devServer: { 12 | static: { 13 | directory: path.resolve(__dirname, 'build'), 14 | }, 15 | port: 4000, 16 | open: true, 17 | hot: true, 18 | compress: true, 19 | historyApiFallback: true, 20 | }, 21 | plugins: [new webpack.HotModuleReplacementPlugin(), new ReactRefreshWebpackPlugin({ overlay: false })], 22 | }) 23 | -------------------------------------------------------------------------------- /scripts/deploy.js: -------------------------------------------------------------------------------- 1 | const spawn = require('child_process').spawn 2 | 3 | function exec(command, args) { 4 | const win32 = process.platform === 'win32' 5 | const cmd = win32 ? 'cmd' : command 6 | const cmdArgs = win32 ? ['/c'].concat(command, args) : args 7 | return spawn(cmd, cmdArgs, { 8 | cwd: process.cwd(), 9 | stdio: 'inherit', 10 | }) 11 | } 12 | 13 | function execSync(command, args) { 14 | return new Promise((resolve, reject) => { 15 | const cp = exec(command, args) 16 | cp.on('error', (code) => { 17 | reject(code) 18 | }) 19 | cp.on('exit', (code) => { 20 | resolve(code) 21 | }) 22 | }) 23 | } 24 | 25 | execSync('yarn', 'build').then(() => { 26 | exec('yarn', 'gp') 27 | }) 28 | -------------------------------------------------------------------------------- /src/screen/Bootstrap/index.tsx: -------------------------------------------------------------------------------- 1 | import Loading from '@/components/Loading' 2 | import { useAppDispatch } from '@/store' 3 | import { bootstrapAsync } from '@/store/win/asyncThunk' 4 | import React, { memo, useEffect } from 'react' 5 | import { Div, Img, LoadingDiv } from './type-css' 6 | 7 | import logo from '@/assets/logo.svg' 8 | 9 | function index() { 10 | const dispatch = useAppDispatch() 11 | 12 | useEffect(() => { 13 | dispatch(bootstrapAsync()) 14 | }, []) 15 | 16 | if (process.env.NODE_ENV === 'development') return null 17 | 18 | return ( 19 |
20 | 21 | 22 | 23 | 24 |
25 | ) 26 | } 27 | 28 | export default memo(index) 29 | -------------------------------------------------------------------------------- /src/components/Icon/type-css.ts: -------------------------------------------------------------------------------- 1 | import styled, { CSSProperties } from 'styled-components' 2 | import React from 'react' 3 | 4 | export enum Size { 5 | small = '16px', 6 | middle = '24px', 7 | large = '36px', 8 | } 9 | 10 | export interface IIcon { 11 | src: string 12 | style?: CSSProperties 13 | size?: 'large' | 'middle' | 'small' 14 | status?: boolean 15 | type?: boolean 16 | onClick?: React.MouseEventHandler 17 | onMouseEnter?: React.MouseEventHandler 18 | onMouseLeave?: React.MouseEventHandler 19 | className?: string 20 | } 21 | 22 | export const ImgIcon = styled.img` 23 | transition: all ${(props) => props.theme.transitionSlow}; 24 | width: ${({ size }: { size: string }) => size}; 25 | height: ${({ size }: { size: string }) => size}; ; 26 | ` 27 | -------------------------------------------------------------------------------- /src/store/win/index.ts: -------------------------------------------------------------------------------- 1 | import { createSlice } from '@reduxjs/toolkit' 2 | 3 | import { initialState } from './state' 4 | import reducers from './reducers' 5 | import extraReducers from './asyncThunk' 6 | 7 | export const winSlice = createSlice({ 8 | name: 'win', 9 | initialState, 10 | reducers: reducers, 11 | extraReducers, 12 | }) 13 | 14 | export default winSlice.reducer 15 | export const { 16 | wallunlock, 17 | changeTheme, 18 | changeDesktopSize, 19 | changeAppList, 20 | changeAppActive, 21 | changeAppIsHide, 22 | closeApp, 23 | changeNight, 24 | changeOpacity, 25 | changeIamge, 26 | changeWidget, 27 | changeBootResatrOrLock, 28 | pushNotifier, 29 | clearNotifier, 30 | clearNotifierCount, 31 | NextNotifier, 32 | clearHistoryApp, 33 | refurbishIcon, 34 | changeIconSort, 35 | } = winSlice.actions 36 | -------------------------------------------------------------------------------- /src/store/index.ts: -------------------------------------------------------------------------------- 1 | import { Action, configureStore, ThunkAction } from '@reduxjs/toolkit' 2 | import { TypedUseSelectorHook, useDispatch, useSelector } from 'react-redux' 3 | 4 | import appReducer from './app' 5 | import winReducer from './win' 6 | 7 | export const store = configureStore({ 8 | reducer: { 9 | app: appReducer, 10 | win: winReducer, 11 | }, 12 | middleware: (getDefaultMiddleware) => 13 | getDefaultMiddleware({ 14 | serializableCheck: false, 15 | }), 16 | }) 17 | 18 | export type AppDispatch = typeof store.dispatch 19 | export type RootState = ReturnType 20 | export type AppThunk = ThunkAction> 21 | 22 | export const useAppDispatch = () => useDispatch() 23 | export const useAppSelector: TypedUseSelectorHook = useSelector 24 | -------------------------------------------------------------------------------- /src/hooks/UseTime.ts: -------------------------------------------------------------------------------- 1 | import dayjs from 'dayjs' 2 | import { useEffect, useState } from 'react' 3 | 4 | export default function useTime(state: T, format: (date: dayjs.Dayjs) => T, wait = 1000): T { 5 | const [time, setTime] = useState(state) 6 | 7 | useEffect(() => { 8 | setTime(format(dayjs())) 9 | const tiemr = setInterval(() => { 10 | setTime((preState) => { 11 | const newState = format(dayjs()) 12 | format(dayjs()) 13 | if (typeof newState === 'object') { 14 | // eslint-disable-next-line max-nested-callbacks 15 | const flag = Object.keys(newState).some((key) => (newState as any)[key] !== (preState as any)[key]) 16 | if (!flag) return preState 17 | } 18 | return newState 19 | }) 20 | }, wait) 21 | return () => clearInterval(tiemr) 22 | }, []) 23 | 24 | return time 25 | } 26 | -------------------------------------------------------------------------------- /src/components/Loading/type-css.ts: -------------------------------------------------------------------------------- 1 | import styled, { CSSProperties } from 'styled-components' 2 | 3 | export const Circle = styled.circle` 4 | stroke: white; 5 | stroke-width: 2px; 6 | transform-origin: 50% 50%; 7 | animation: 3s linear 0s infinite normal none running spin-infinite; 8 | @keyframes spin-infinite { 9 | 0% { 10 | stroke-dasharray: 0.01px, 43.97px; 11 | transform: rotate(0deg); 12 | } 13 | 50% { 14 | stroke-dasharray: 21.99px, 21.99px; 15 | transform: rotate(450deg); 16 | } 17 | 100% { 18 | stroke-dasharray: 0.01px, 43.97px; 19 | transform: rotate(1080deg); 20 | } 21 | } 22 | ` 23 | 24 | export const Div = styled.div` 25 | width: 100%; 26 | height: 100%; 27 | display: flex; 28 | justify-content: center; 29 | align-items: center; 30 | ` 31 | 32 | export interface LoadingProps { 33 | style?: CSSProperties 34 | fill?: string 35 | stroke?: string 36 | } 37 | -------------------------------------------------------------------------------- /src/assets/css/common.ts: -------------------------------------------------------------------------------- 1 | import styled from 'styled-components' 2 | 3 | export const DivFull = styled.div` 4 | width: 100%; 5 | height: 100%; 6 | ` 7 | 8 | export const CenteredDiv = styled.div` 9 | display: flex; 10 | align-items: center; 11 | justify-content: center; 12 | ` 13 | 14 | export const DivFullCenter = styled(CenteredDiv)` 15 | width: 100%; 16 | height: 100%; 17 | ` 18 | 19 | export const TaskAppDiv = styled.div` 20 | overflow: hidden; 21 | position: fixed; 22 | box-shadow: rgba(0, 0, 0, 0.3) 0px 4px 12px; 23 | user-select: none; 24 | font-size: 0.8rem; 25 | backdrop-filter: saturate(3) blur(10px); 26 | background: ${(props) => props.theme.themeOpacity}; 27 | border-radius: ${(props) => props.theme.borderRadiusLarge}; 28 | transition: all ${(props) => props.theme.transitionSlow}; 29 | color: ${(props) => props.theme.fontColor}; 30 | z-index: 10; 31 | box-shadow: rgba(0, 0, 0, 0.3) 0px 4px 12px; 32 | ` 33 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ['alloy', 'alloy/react', 'alloy/typescript'], 3 | env: { 4 | // 你的环境变量(包含多个预定义的全局变量) 5 | // 6 | browser: true, 7 | // node: true, 8 | // mocha: true, 9 | // jest: true, 10 | // jquery: true 11 | }, 12 | globals: { 13 | // 你的全局变量(设置为 false 表示它不允许被重新赋值) 14 | // 15 | // myGlobal: false 16 | }, 17 | rules: { 18 | quotes: [1, 'single'], 19 | semi: [2, 'never'], 20 | '@typescript-eslint/explicit-member-accessibility': 'off', 21 | 'prefer-promise-reject-errors': 'off', 22 | '@typescript-eslint/no-unused-expressions': 'off', 23 | 'react/jsx-no-useless-fragment': 'off', 24 | 'no-param-reassign': 'off', 25 | '@typescript-eslint/no-invalid-void-type': 'off', 26 | '@typescript-eslint/consistent-type-assertions': 'off', 27 | '@typescript-eslint/no-require-imports': 'off', 28 | 'react/jsx-no-constructed-context-values': 'off', 29 | }, 30 | } 31 | -------------------------------------------------------------------------------- /src/assets/css/theme.ts: -------------------------------------------------------------------------------- 1 | const darkTheme = { 2 | name: 'dark', 3 | theme: '#212020', 4 | themeColor: '#4cc2ff', 5 | themeOpacity: 'rgba(32, 32, 32, .85)', 6 | fontColor: '#fff', 7 | secondaryFontColor: '#e9e9e9', 8 | inputborderColor: 'rgba(255, 255, 255, 0.2)', 9 | borderRadiusLarge: '6px', 10 | borderRadiusMiddle: '4px', 11 | borderRadiusSmall: '2px', 12 | transitionSlow: '.2s', 13 | transitionMiddle: '.4s', 14 | transitionFast: '.8s', 15 | } 16 | 17 | const lightTheme = { 18 | name: 'light', 19 | theme: '#f1f3f7', 20 | themeColor: '#4cc2ff', 21 | themeOpacity: 'rgba(240, 236, 238, .75)', 22 | fontColor: '#000', 23 | secondaryFontColor: '#333333', 24 | inputborderColor: 'rgba(255, 255, 255, 0.2)', 25 | borderRadiusLarge: '6px', 26 | borderRadiusMiddle: '4px', 27 | borderRadiusSmall: '2px', 28 | transitionSlow: '.2s', 29 | transitionMiddle: '.4s', 30 | transitionFast: '.8s', 31 | } 32 | 33 | export default { darkTheme, lightTheme } 34 | -------------------------------------------------------------------------------- /src/utils/storage.ts: -------------------------------------------------------------------------------- 1 | class SessionStorage { 2 | getItem(key: string) { 3 | const value = sessionStorage.getItem(key) 4 | if (value) return JSON.parse(value) 5 | return value 6 | } 7 | setItem(key: string, value: any) { 8 | return sessionStorage.setItem(key, JSON.stringify(value)) 9 | } 10 | removeItem(key: string) { 11 | sessionStorage.removeItem(key) 12 | } 13 | clear() { 14 | sessionStorage.clear() 15 | } 16 | } 17 | 18 | class Localstorage { 19 | getItem(key: string) { 20 | const value = localStorage.getItem(key) 21 | if (value) return JSON.parse(value) 22 | return value 23 | } 24 | setItem(key: string, value: any) { 25 | return localStorage.setItem(key, JSON.stringify(value)) 26 | } 27 | removeItem(key: string) { 28 | localStorage.removeItem(key) 29 | } 30 | clear() { 31 | localStorage.clear() 32 | } 33 | } 34 | 35 | export const session = new SessionStorage() 36 | export const local = new Localstorage() 37 | -------------------------------------------------------------------------------- /src/hooks/useResize.ts: -------------------------------------------------------------------------------- 1 | import { Timer } from '@/utils' 2 | import { useCallback, useEffect, useState } from 'react' 3 | 4 | export default function useResize() { 5 | const [error, setError] = useState(false) 6 | 7 | useEffect(() => { 8 | window.onresize = (() => { 9 | let timer: Timer | null 10 | return () => { 11 | if (timer) return 12 | timer = setTimeout(() => { 13 | clearTimeout(timer as Timer) 14 | timer = null 15 | handleError() 16 | }, 200) 17 | } 18 | })() 19 | handleError() 20 | }, []) 21 | 22 | useEffect(() => { 23 | if (!error) return 24 | setError(false) 25 | }, [error]) 26 | 27 | function Bomb() { 28 | if (!error) return null 29 | throw new Error('The window width is too small(width < 1440 or height < 650).') 30 | } 31 | 32 | const handleError = useCallback(() => { 33 | if (window.innerWidth >= 1440 && window.innerHeight >= 650) return 34 | setError(true) 35 | }, []) 36 | 37 | return Bomb 38 | } 39 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 🐲 React-to-Win11 2 | 3 | 使用 Web 技术在 Web 上 复刻 Windows 11 桌面体验 4 | 5 | ## 项目预览 6 | 7 | [https://cvopen.github.io/react-to-win11](https://cvopen.github.io/react-to-win11) 8 | 9 | > #### 预览时建议浏览器全屏(按下f11),不要打开控制台,为了保证体验,对页面宽高有所限制,报错时会进入蓝屏页面。 10 | 11 | ![启动页](/public/preview-1.png) 12 | 13 | ![登录](/public/preview-2-1.png) 14 | ![登录](/public/preview-2-2.png) 15 | 16 | ![桌面](/public/preview-3.png) 17 | 18 | ![任务栏窗口预览](/public/preview-4.png) 19 | 20 | ![系统通知](/public/preview-5.png) 21 | 22 | ![窗口分屏](/public/preview-6.png) 23 | 24 | ![任务栏控件](/public/preview-7-1.png) 25 | 26 | ![任务栏控件](/public/preview-7-2.png) 27 | 28 | ## 系统功能 29 | 30 | - [x] 启动页 31 | - [x] 登录页 32 | - [x] 蓝屏页 33 | - [x] 开始菜单和搜索菜单 34 | - [x] 左侧控件: 当前天气,微博、百度热搜、疫情数据 35 | - [x] 状态栏管理 36 | - [x] 日历 37 | - [x] 系统通知 38 | - [x] 任务栏窗口预览 39 | - [x] 重启和锁屏 40 | - [x] 主题切换, 护眼模式, 亮度调节 41 | - [x] 窗口拖动, 大小调节 42 | - [x] 窗口分屏 43 | - [x] 右键菜单 44 | 45 | ## 应用 46 | 47 | - [x] vscode 48 | - [x] edge 浏览器 49 | 50 | ## 技术栈 51 | 52 | React18 + Ts + redux-toolkit + styled-components 53 | -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | // 一行最多 120 字符 3 | printWidth: 120, 4 | // 使用 2 个空格缩进 5 | tabWidth: 2, 6 | // 不使用缩进符,而使用空格 7 | useTabs: false, 8 | // 行尾需要有分号 9 | semi: false, 10 | // 使用单引号 11 | singleQuote: true, 12 | // 对象的 key 仅在必要时用引号 13 | quoteProps: 'as-needed', 14 | // jsx 不使用单引号,而使用双引号 15 | jsxSingleQuote: false, 16 | // 末尾需要有逗号 17 | trailingComma: 'all', 18 | // 大括号内的首尾需要空格 19 | bracketSpacing: true, 20 | // jsx 标签的反尖括号需要换行 21 | bracketSameLine: false, 22 | // 箭头函数,只有一个参数的时候,也需要括号 23 | arrowParens: 'always', 24 | // 每个文件格式化的范围是文件的全部内容 25 | rangeStart: 0, 26 | rangeEnd: Infinity, 27 | // 不需要写文件开头的 @prettier 28 | requirePragma: false, 29 | // 不需要自动在文件开头插入 @prettier 30 | insertPragma: false, 31 | // 使用默认的折行标准 32 | proseWrap: 'preserve', 33 | // 根据显示样式决定 html 要不要折行 34 | htmlWhitespaceSensitivity: 'css', 35 | // vue 文件中的 script 和 style 内不用缩进 36 | vueIndentScriptAndStyle: false, 37 | // 换行符使用 lf 38 | endOfLine: 'lf', 39 | // 格式化内嵌代码 40 | embeddedLanguageFormatting: 'auto', 41 | } 42 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 navigate 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/components/Image/type-css.ts: -------------------------------------------------------------------------------- 1 | import { CenteredDiv } from '@/assets/css/common' 2 | import styled, { CSSProperties } from 'styled-components' 3 | 4 | export interface IImgProps { 5 | fits?: 'fill' | 'contain' | 'cover' | 'none' | 'scale-down' 6 | width?: number 7 | height?: number 8 | } 9 | 10 | export interface IImageProps extends IImgProps { 11 | src: string 12 | style?: CSSProperties 13 | onError?: Function 14 | } 15 | 16 | export type ImageStatus = 'pending' | 'success' | 'fail' 17 | 18 | export const Image = styled.img` 19 | width: ${({ width }: IImgProps) => `${width}px`}; 20 | height: ${({ height, width }: IImgProps) => `${height ? height : width}px`}; 21 | object-fit: ${({ fits = 'fill' }: IImgProps) => fits}; 22 | vertical-align: bottom; 23 | ` 24 | 25 | export const LoadingDiv = styled(CenteredDiv)` 26 | width: ${({ width }: IImgProps) => `${width}px`}; 27 | height: ${({ height, width }: IImgProps) => `${height ? height : width}px`}; 28 | background-color: rgba(159, 159, 159, 0.5); 29 | overflow: hidden; 30 | display: inline-block; 31 | text-align: center; 32 | vertical-align: bottom; 33 | ` 34 | -------------------------------------------------------------------------------- /src/components/DesktopIcon/index.tsx: -------------------------------------------------------------------------------- 1 | import React, { memo, useCallback, useState } from 'react' 2 | import { useAppSelector } from '@/store' 3 | 4 | import { DeskTopIconDiv, IDesktopIconProps } from './type-css' 5 | import useEvent from '@/hooks/useEvent' 6 | 7 | function index({ src, name, size, style }: IDesktopIconProps) { 8 | const { desktopSize } = useAppSelector(({ win }) => win) 9 | const [down, setDown] = useState(false) 10 | 11 | const handleMouseDown = useCallback(() => { 12 | setDown(true) 13 | }, []) 14 | 15 | const handleMouseUp = useCallback(() => setDown(false), []) 16 | 17 | useEvent({ eventName: 'mouseup', cb: handleMouseUp }) 18 | 19 | const handleClick = useCallback((e?: React.MouseEvent) => { 20 | setDown(false) 21 | }, []) 22 | 23 | return ( 24 | 25 |
26 | 27 |
28 |

{name}

29 |
30 | ) 31 | } 32 | 33 | export default memo(index) 34 | -------------------------------------------------------------------------------- /src/app/VSCode.tsx: -------------------------------------------------------------------------------- 1 | import AppShell from '@/components/AppShell' 2 | import Icon from '@/components/Icon' 3 | import React, { memo } from 'react' 4 | 5 | const style = { height: '100%', display: 'flex', alignItems: 'center', fontSize: '.8rem', color: '#fff' } 6 | 7 | const styleIcon = { padding: '0 5px' } 8 | 9 | const headerStyle = { background: '#1a1614' } 10 | const iframeStyle = { verticalAlign: 'top', background: '#1e1e1e' } 11 | 12 | function VSCode({ index }: { index: number }) { 13 | return ( 14 | 23 | 24 | Visual Studio Code 25 | 26 | } 27 | > 28 |