diff --git a/public/locales/en/translate.json b/public/locales/en/translate.json index 357ca29eb..3fcb82ec9 100644 --- a/public/locales/en/translate.json +++ b/public/locales/en/translate.json @@ -8,6 +8,7 @@ "about.microsoftcopywrite": "Microsoft, Windows and Other demonstrated Products in this project are trademarks of the Microsoft group of companies", "about.understand": "Ok, I understand", "about.contact": "contact", + "store.featured-app": "Featured Apps", "store.featured-app.info": "Take your experience to new heights with these must-have apps", "store.featured-game": "Featured Games", diff --git a/public/locales/zh/translate.json b/public/locales/zh/translate.json new file mode 100644 index 000000000..1bc74c712 --- /dev/null +++ b/public/locales/zh/translate.json @@ -0,0 +1,28 @@ +{ + "about.opensource": "win11 是一个开源项目,旨在通过React、css、JavaScript等标准web技术,在web上复制window11的桌面体验", + "about.notmicrosoft": "这个项目不属于Microsoft,不应与它的操作系统或产品混淆", + "about.Creative-Commons": "Creative-Commons", + "about.title": "About", + "about.licensed": "本项目的开源协议", + "about.alsonot": "这同样不是", + "about.microsoftcopywrite": "这个项目的Microsoft、Windows和其他演示产品均为Microsoft公司的商标", + "about.understand": "好的", + "about.contact": "联系方式", + + "store.featured-app": "精选应用", + "store.featured-app.info": "用这些必备的应用把你的体验带到新的高度", + "store.featured-game": "精选游戏", + "store.featured-game.info": "探索Xbox游戏的乐趣,并发现你的最爱", + "store.featured-film": "精选电影", + "store.featured-film.info": "租赁或购买最新热门电影,在家或者旅途中观看", + "store.free": "免费", + "store.owned": "已拥有", + "store.rent": "租赁", + "store.features": "精选", + "store.ratings": "评分与评论", + "store.description": "描述", + "camera.take-photo": "拍照", + "oobe.country": "国家和地区是否正确?", + "oobe.keyboard": "键盘布局或输入法是否正确", + "oobe.anotherkeyboard": "如果你使用其他的键盘布局,你可以在下方添加" +} \ No newline at end of file diff --git a/src/App.jsx b/src/App.jsx index ddcf7a3b3..dc5a9a0f5 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,4 +1,4 @@ -import { useEffect } from "react"; +import { useEffect, useRef, useState } from "react"; import { ErrorBoundary } from "react-error-boundary"; import { useDispatch, useSelector } from "react-redux"; import "./i18nextConf"; @@ -70,6 +70,7 @@ function ErrorFallback({ error, resetErrorBoundary }) { function App() { const apps = useSelector((state) => state.apps); const wall = useSelector((state) => state.wallpaper); + const isfullScreen = useSelector((state) => state.menus.fullScreen); const dispatch = useDispatch(); const afterMath = (event) => { @@ -88,7 +89,7 @@ function App() { } catch (err) {} var actionType0 = getComputedStyle(event.target).getPropertyValue( - "--prefix", + "--prefix" ); ess.forEach((item, i) => { @@ -125,7 +126,44 @@ function App() { window.onload = (e) => { dispatch({ type: "WALLBOOTED" }); }; + document.addEventListener("fullscreenchange", ()=>{ + if(document.fullscreenElement===null){ + // exit + console.log('exit'); + dispatch({type:"FULLSREEN"}) + } + },true); + + function fullScreen(element) { + const runfullScreen = + element.requestFullscreen || + element.mozRequestFullScreen || + element.webkitRequestFullScreen || + element.msRequestFullscreen; + if (runfullScreen) runfullScreen.call(element); + else { + console.error("当前浏览器不支持部分全屏!"); + } + } + function exitFullScreen() { + const runExit = + document.exitFullscreen || + document.mozCancelFullScreen || + document.webkitExitFullscreen || + document.msExitFullscreen; + if (runExit) runExit.call(document); + else { + console.error("当前浏览器不支持退出全屏!"); + } + } + const App = useRef(null); + if (isfullScreen) { + fullScreen(App.current); + } else if (document.fullscreenElement !== null) { + exitFullScreen(); + dispatch({type:"FULLSREEN"}) + } useEffect(() => { if (!window.onstart) { loadSettings(); @@ -137,7 +175,7 @@ function App() { }); return ( -
+
{!wall.booted ? : null} {wall.locked ? : null} @@ -149,7 +187,7 @@ function App() { var WinApp = Applications[key]; return ; })} - {Object.keys(apps) + {/* {Object.keys(apps) .filter((x) => x != "hz") .map((key) => apps[key]) .map((app, i) => { @@ -157,7 +195,7 @@ function App() { var WinApp = Drafts[app.data.type]; return ; } - })} + })} */} diff --git a/src/containers/applications/apps/terminal.jsx b/src/containers/applications/apps/terminal.jsx index ad646b78a..9287d45d6 100644 --- a/src/containers/applications/apps/terminal.jsx +++ b/src/containers/applications/apps/terminal.jsx @@ -335,7 +335,10 @@ export const WnTerminal = () => { tmpStack.push("Network Org: " + IP.org); tmpStack.push("Region: " + IP.region); tmpStack.push("Postal: " + IP.postal); - } else { + }else if(type=="ls"){ + tmpStack.push("visit https://github.com/blueedgetechno/win11React"); + } + else { tmpStack.push( `'${type}' is not recognized as an internal or external command,`, ); diff --git a/src/reducers/menu.js b/src/reducers/menu.js index e3b648097..3cf39f4c9 100644 --- a/src/reducers/menu.js +++ b/src/reducers/menu.js @@ -5,6 +5,7 @@ const defState = { opts: "desk", attr: null, dataset: null, + fullScreen:false, data: { desk: { width: "310px", @@ -75,6 +76,11 @@ const defState = { }, ], }, + { + name:"fullScreen", + action:"FULLSCREEN", + type:"svg", + }, { name: "Refresh", action: "refresh", @@ -264,6 +270,15 @@ const menusReducer = (state = defState, action) => { tmpState = { ...action.payload, }; + } else if(action.type==="FULLSCREEN"){ + tmpState.fullScreen=!tmpState.fullScreen + tmpState.menus.desk.forEach(obj=>{ + if(obj.name==='fullScreen'){ + obj.name='exit fullSreen' + }else if(obj.name==='exit fullSreen'){ + obj.name='fullScreen' + } + }) } return tmpState;