diff --git a/package-lock.json b/package-lock.json index 611c64196..fa6159c3c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,12 @@ { "name": "win11React", - "version": "0.1.0", + "version": "0.1.1", "lockfileVersion": 2, "requires": true, "packages": { "": { - "version": "0.1.0", + "name": "win11React", + "version": "0.1.1", "dependencies": { "@fortawesome/fontawesome-svg-core": "^1.2.35", "@fortawesome/free-regular-svg-icons": "^5.15.3", diff --git a/public/dycalendar.css b/public/dycalendar.css index c6c8ae258..81ed54681 100644 --- a/public/dycalendar.css +++ b/public/dycalendar.css @@ -104,8 +104,8 @@ } .dycalendar-today-date { - background-color: #246ff2; - color: #fff; + background: var(--clrPrm); + color: var(--dark-txt); border-radius: 24px; } diff --git a/public/font/spotify.ttf b/public/font/spotify.ttf new file mode 100644 index 000000000..fecd4ad61 Binary files /dev/null and b/public/font/spotify.ttf differ diff --git a/public/font/spotify.woff2 b/public/font/spotify.woff2 new file mode 100644 index 000000000..57bd11f22 Binary files /dev/null and b/public/font/spotify.woff2 differ diff --git a/public/img/icon/home.png b/public/img/icon/home.png index eccb318ea..40fd08f1a 100644 Binary files a/public/img/icon/home.png and b/public/img/icon/home.png differ diff --git a/public/img/icon/search.png b/public/img/icon/search.png index 616142812..d6ce9b07f 100644 Binary files a/public/img/icon/search.png and b/public/img/icon/search.png differ diff --git a/public/img/icon/store.png b/public/img/icon/store.png index 1b89c0d54..9fa9d4730 100644 Binary files a/public/img/icon/store.png and b/public/img/icon/store.png differ diff --git a/public/img/icon/ui/display.png b/public/img/icon/ui/display.png index 29d6fd8de..b33d5af52 100644 Binary files a/public/img/icon/ui/display.png and b/public/img/icon/ui/display.png differ diff --git a/public/img/icon/ui/marker1.png b/public/img/icon/ui/marker1.png deleted file mode 100644 index 345fb9db0..000000000 Binary files a/public/img/icon/ui/marker1.png and /dev/null differ diff --git a/public/img/icon/ui/new.png b/public/img/icon/ui/new.png index 13a97790b..ea4e80c4e 100644 Binary files a/public/img/icon/ui/new.png and b/public/img/icon/ui/new.png differ diff --git a/public/img/icon/ui/personalize.png b/public/img/icon/ui/personalize.png index 482da5726..28a46b6fc 100644 Binary files a/public/img/icon/ui/personalize.png and b/public/img/icon/ui/personalize.png differ diff --git a/public/img/icon/ui/sort.png b/public/img/icon/ui/sort.png index b589af0dd..6ce318a4b 100644 Binary files a/public/img/icon/ui/sort.png and b/public/img/icon/ui/sort.png differ diff --git a/public/img/icon/ui/sun.png b/public/img/icon/ui/sun.png new file mode 100644 index 000000000..26e813f3e Binary files /dev/null and b/public/img/icon/ui/sun.png differ diff --git a/public/img/icon/ui/view.png b/public/img/icon/ui/view.png index 1a3590d3d..794ed563b 100644 Binary files a/public/img/icon/ui/view.png and b/public/img/icon/ui/view.png differ diff --git a/public/img/icon/widget.png b/public/img/icon/widget.png index f84e5ee80..5777f5ad6 100644 Binary files a/public/img/icon/widget.png and b/public/img/icon/widget.png differ diff --git a/public/index.html b/public/index.html index bed5bc866..ce3a7eae8 100644 --- a/public/index.html +++ b/public/index.html @@ -28,7 +28,7 @@
- This project is   not in anyway affiliated with Microsoft and + This project is  not in anyway affiliated with Microsoft and should not be confused with Microsoft’s Operating System or Products.
diff --git a/src/App.js b/src/App.js index 12c368065..7752b593d 100644 --- a/src/App.js +++ b/src/App.js @@ -21,6 +21,7 @@ import { CalnWid } from './components/start'; +import {loadSettings} from './actions'; import * as Applications from './containers/applications'; import * as Drafts from './containers/applications/draft.js'; @@ -85,6 +86,7 @@ function App() { useEffect(()=>{ if(!window.onstart){ + loadSettings() window.onstart = setTimeout(()=>{ console.log("prematurely loading ( ノ ゚ー゚)ノ"); dispatch({type: "WALLBOOTED"}) diff --git a/src/actions/index.js b/src/actions/index.js index c32ddcddf..605b4d90e 100644 --- a/src/actions/index.js +++ b/src/actions/index.js @@ -152,3 +152,43 @@ export const installApp = (data)=>{ store.dispatch({type: "DESKADD", payload: app}) store.dispatch({type: "WNSTORE", payload: "mnmz"}) } + +export const getTreeValue = (obj, path)=>{ + if(path==null) return false + + var tdir = {...obj} + path = path.split(".") + for (var i = 0; i < path.length; i++) { + tdir = tdir[path[i]]; + } + + return tdir +} + +export const changeTheme = ()=>{ + var thm = store.getState().setting.person.theme, + thm = thm=="light"?"dark":"light" + var icon = thm=="light"?"sun":"moon" + + document.body.dataset.theme = thm + store.dispatch({type: "STNGTHEME", payload: thm}) + store.dispatch({type: "PANETHEM", payload: icon}) + store.dispatch({type: "WALLSET", payload: thm=="light"?0:1}) +} + +export const loadSettings = ()=>{ + var sett = localStorage.getItem("setting") || "{}" + sett = JSON.parse(sett) + + if(sett.person==null){ + sett = JSON.parse(JSON.stringify(store.getState().setting)) + if (window.matchMedia && + window.matchMedia('(prefers-color-scheme: dark)').matches) { + sett.person.theme = "dark" + } + } + + if(sett.person.theme!="light") changeTheme() + + store.dispatch({type: "SETTLOAD", payload: sett}) +} diff --git a/src/components/menu/index.js b/src/components/menu/index.js index 724776ae5..3bcc4ede6 100644 --- a/src/components/menu/index.js +++ b/src/components/menu/index.js @@ -1,96 +1,101 @@ -import React, {useState, useEffect} from 'react'; -import {useSelector, useDispatch} from 'react-redux'; -import {Icon} from '../../utils/general'; -import './menu.scss'; +import React, { useState, useEffect } from "react"; +import { useSelector, useDispatch } from "react-redux"; +import { Icon } from "../../utils/general"; +import "./menu.scss"; -import * as Actions from '../../actions'; +import * as Actions from "../../actions"; -export const ActMenu = ()=>{ - const menu = useSelector(state=>state.menus); - const {abpos, isLeft} = useSelector(state=>{ +export const ActMenu = () => { + const menu = useSelector((state) => state.menus); + const { abpos, isLeft } = useSelector((state) => { var acount = state.menus.menus[state.menus.opts].length; var tmpos = { - 'top': state.menus.top, - 'left': state.menus.left - }, tmpleft = false; + top: state.menus.top, + left: state.menus.left, + }, + tmpleft = false; var wnwidth = window.innerWidth, - wnheight = window.innerHeight; + wnheight = window.innerHeight; var ewidth = 312, - eheight = acount*28; + eheight = acount * 28; - tmpleft = (wnwidth - tmpos.left) > 504; - if(wnwidth - tmpos.left < ewidth){ - tmpos.right = wnwidth - tmpos.left; - tmpos.left = null; + tmpleft = wnwidth - tmpos.left > 504; + if (wnwidth - tmpos.left < ewidth) { + tmpos.left = wnwidth - ewidth; } - if(wnheight - tmpos.top < eheight){ + if (wnheight - tmpos.top < eheight) { tmpos.bottom = wnheight - tmpos.top; tmpos.top = null; } return { abpos: tmpos, - isLeft: tmpleft + isLeft: tmpleft, }; - }) + }); const dispatch = useDispatch(); - const clickDispatch = (event)=>{ + const clickDispatch = (event) => { event.stopPropagation(); var action = { type: event.target.dataset.action, - payload: event.target.dataset.payload + payload: event.target.dataset.payload, }; - if(action.type){ - if(action.type!=action.type.toUpperCase()){ - Actions[action.type](action.payload,menu); - }else{ + if (action.type) { + if (action.type != action.type.toUpperCase()) { + Actions[action.type](action.payload, menu); + } else { dispatch(action); } - dispatch({type: "MENUHIDE"}); + dispatch({ type: "MENUHIDE" }); } - } + }; - const menuobj = (data)=>{ + const menuobj = (data) => { var mnode = []; - data.map(opt=>{ - if(opt.type=="hr"){ + data.map((opt) => { + if (opt.type == "hr") { mnode.push(
); - }else{ - mnode.push(
- {opt.name} - {opt.icon?:null} - {opt.opts?:null} - {opt.dot?:null} - {opt.check?:null} - {opt.opts?( -
- {menuobj(opt.opts)} + } else { + mnode.push( +
+
+ {opt.icon && opt.type=="svg" ? : null} + {opt.icon && opt.type=="fa" ? : null} + {opt.icon && opt.type==null ? : null}
- ):null} -
) +
{opt.name}
+ {opt.opts ? : null} + {opt.dot ? : null} + {opt.check ? : null} + {opt.opts ?
{menuobj(opt.opts)}
: null} +
+ ); } }); return mnode; - } + }; return ( -
+
{menuobj(menu.menus[menu.opts])}
); -} +}; export default ActMenu; diff --git a/src/components/menu/menu.scss b/src/components/menu/menu.scss index 8d0431de7..f41e617f6 100644 --- a/src/components/menu/menu.scss +++ b/src/components/menu/menu.scss @@ -1,18 +1,21 @@ .actmenu { + --bg1: rgba(249, 249, 249, 0.9); + --bg2: rgba(0, 0, 0, 0.08); + position: absolute; width: 310px; - background: rgba(255, 255, 255, 0.9); - backdrop-filter: blur(20px); + background: var(--bg1); + backdrop-filter: contrast(2) saturate(2) blur(20px); z-index: 10000; - opacity:1; - pointer-events:all; - border: solid 1px #ccc9; + opacity: 1; + pointer-events: all; + // border: solid 1px var(--comp-txt); border-radius: 8px; transition: opacity 0.1s ease; &[data-hide="true"] { - opacity:0; - pointer-events:none; + opacity: 0; + pointer-events: none; } &[data-left="false"] .minimenu { @@ -21,17 +24,23 @@ } } +body[data-theme="dark"] .actmenu { + --bg1: rgba(34, 36, 47, 0.8); + --bg2: rgba(255, 255, 255, 0.08); +} + .minimenu { position: absolute; display: none; top: 0; left: 99%; min-width: 200px; - background: rgba(255, 255, 255, 0.9); + background: var(--bg1); z-index: 9999; padding: 4px 0; - border: solid 1px #ccc9; + // border: solid 1px var(--comp-txt); animation: fadein 600ms ease-in-out; + // backdrop-filter: contrast(1) saturate(2) blur(20px); border-radius: 8px; } @@ -40,7 +49,7 @@ box-sizing: border-box; position: relative; width: calc(100% - 8px); - padding: 4px 32px; + padding: 4px 6px; font-size: 12px; cursor: default; margin: 6px; @@ -48,42 +57,34 @@ display: flex; align-items: center; font-weight: 500; - color: #333; + color: var(--txt-col); transition: all 0.1s ease; &:hover { - background: rgba(0, 0, 0, 0.08); + background: var(--bg2); .minimenu { display: block; } } - &[data-dsb="true"] { - color: #aaa; - font-weight: 400; + .spcont{ + width: 16px; + margin-right: 12px; } - .uicon { + .micon{ position: absolute; - top: 8px; - left: 8px; } - .prtclk { - left: unset; + .rightIcon { right: 8px; } .dotIcon, .checkIcon { - top: 8px; left: 8px; - right: unset; - } - - .checkIcon { - top: 6px; + color: var(--med-txt); } } diff --git a/src/components/start/index.js b/src/components/start/index.js index eab857eab..0928c87b5 100644 --- a/src/components/start/index.js +++ b/src/components/start/index.js @@ -4,339 +4,13 @@ import {Icon} from '../../utils/general'; import './startmenu.scss'; import './sidepane.scss'; import './searchpane.scss'; - import axios from 'axios'; -export const StartMenu = () => { - const {align} = useSelector(state=>state.taskbar); - const start = useSelector(state => { - var arr = state.startmenu, - ln = (6 - arr.pnApps.length % 6) % 6; - - for (var i = 0; i < ln; i++) { - arr.pnApps.push({ - empty: true - }); - } - - for (i = 0; i < arr.rcApps.length; i++) { - if (arr.rcApps[i].lastUsed < 0) { - arr.rcApps[i].lastUsed = "Recently Added" - } else if (arr.rcApps[i].lastUsed < 10) { - arr.rcApps[i].lastUsed = "Just Now" - } else if (arr.rcApps[i].lastUsed < 60) { - arr.rcApps[i].lastUsed += "m ago" - } else if (arr.rcApps[i].lastUsed < 360) { - arr.rcApps[i].lastUsed = Math.floor(arr.rcApps[i].lastUsed / 60) + "h ago" - } - } - - var allApps = [], - tmpApps = Object.keys(state.apps).filter(x=> x!="hz").map(key => { - return state.apps[key] - }) - - tmpApps.sort((a, b) => (a.name > b.name) ? 1 : ((b.name > a.name) ? -1 : 0)); - - for (i = 0; i < 27; i++) { - allApps[i] = []; - } - - for (i = 0; i < tmpApps.length; i++) { - var t1 = tmpApps[i].name.trim().toUpperCase().charCodeAt(0); - if (t1 > 64 && t1 < 91) { - allApps[t1 - 64].push(tmpApps[i]); - } else { - allApps[0].push(tmpApps[i]); - } - } - - arr.contApps = allApps - arr.allApps = tmpApps - return arr - }); +import {getTreeValue} from '../../actions'; +import * as Actions from '../../actions'; - const [query, setQuery] = useState(""); - const [match, setMatch] = useState({}); - const [atab, setTab] = useState("All"); - // const [pwctrl, setPowCtrl] = useState - - const dispatch = useDispatch(); - const tabSw = (e)=>{ - setTab(e.target.innerText.trim()); - } - - const clickDispatch = (event) => { - var action = { - type: event.target.dataset.action, - payload: event.target.dataset.payload - }; - - if (action.type) { - dispatch(action); - } - - if (action.type && (action.payload == "full" || action.type == "EDGELINK")) { - dispatch({ - type: "STARTHID" - }); - } - - if (action.type == "STARTALPHA") { - var target = document.getElementById("char" + action.payload); - if (target) { - target.parentNode.scrollTop = target.offsetTop; - } else { - var target = document.getElementById("charA"); - target.parentNode.scrollTop = 0; - } - } - } - - useEffect(() => { - if (query.length) { - for (var i = 0; i < start.allApps.length; i++) { - if (start.allApps[i].name.toLowerCase().includes(query.toLowerCase())) { - setMatch(start.allApps[i]); - break; - } - } - } - }, [query]) - - return ( -
- {start.menu?( - <>
-
-
-
-
Pinned
-
-
All apps
- -
-
-
- {start.pnApps.map((app,i)=>{ - return app.empty?( -
- ):( -
- -
{app.name}
-
- ); - })} -
-
-
-
-
Recommended
-
-
More
- -
-
-
- {start.rcApps.slice(0,6).map((app,i)=>{ - return app.name?( -
- -
-
{app.name}
-
{app.lastUsed}
-
-
- ):null - })} -
-
-
-
-
-
-
-
All apps
-
- -
Back
-
-
-
- {start.contApps.map((ldx,i)=>{ - if(ldx.length==0) return null; - - var tpApps = []; - tpApps.push( -
-
{i==0?"#":String.fromCharCode(i+64)}
-
- ); - - ldx.forEach((app,j) => { - tpApps.push( -
- -
{app.name}
-
- ); - }); - - return tpApps; - })} -
-
-
-
-
&
-
- {start.contApps.map((ldx,i)=>{ - return ( -
-
{i==0?"#":String.fromCharCode(i+64)}
-
- ); - })} -
-
-
-
-
-
- -
Blue Edge
-
-
-
-
- - Shut down -
-
- - Restart -
-
- - Lock -
-
- -
-
- ):( -
-
- - { - setQuery(event.target.value.trim()); - }} defaultValue={query} placeholder="Search something ..."/> -
-
-
-
All
-
Apps
-
Documents
-
Web
-
More
-
-
-
-
-
- {query.length?"Best match":"Top apps"} -
- {query.length?( -
-
- -
-
{match.name}
-
App
-
-
-
- -
-
Search online
-
Web
-
-
-
- ):( - <> -
- {start.rcApps.slice(2,7).map((app,i)=>{ - return( -
- -
{app.name}
-
- ); - })} -
-
- Quick Searches -
-
- {start.qksrch.map(srch=>{ - return ( -
- -
{srch[2]}
-
- ) - })} -
- - )} -
- {query.length?( -
- -
{match.name}
-
App
-
-
- -
Open
-
-
- ):( - null - )} -
-
- )} -
- ); -} +export * from './start'; +export * from './widget'; export const DesktopApp = () => { const deskApps = useSelector(state => { @@ -386,8 +60,10 @@ export const DesktopApp = () => { } export const SidePane = () => { - const paneApps = useSelector(state => state.sidepane); + const sidepane = useSelector(state => state.sidepane); + const setting = useSelector(state => state.setting); const tasks = useSelector(state=>state.taskbar); + const [pnstates,setPnstate] = useState([]); const dispatch = useDispatch(); const clickDispatch = (event) => { @@ -396,7 +72,11 @@ export const SidePane = () => { payload: event.target.dataset.payload }; - if(action.type) dispatch(action); + if(action.type){ + if(action.type!=action.type.toUpperCase()){ + Actions[action.type](action.payload); + }else dispatch(action); + } } let vSlider = document.querySelector(".vSlider"); @@ -415,47 +95,61 @@ export const SidePane = () => { function silderBackground(elem, e) { - elem.style.setProperty("--track-color", `linear-gradient(90deg, #005fba ${e}%, #888888 ${e}%)`) + elem.style.setProperty("--track-color", `linear-gradient(90deg, #005fba ${e-3}%, #888888 ${e}%)`) } const setBrightness = (e)=>{ - document.getElementById('brightoverlay').style.opacity = (100 - e.target.value)/100 - - silderBackground(bSlider, e.target.value); + var brgt = e.target.value + document.getElementById('brightoverlay').style.opacity = (100 - brgt)/100 + dispatch({type: "STNGSETV", payload: { + path: "system.display.brightness", + value: brgt + }}) + silderBackground(bSlider, brgt); } useEffect(()=>{ - paneApps.quicks.map(item=>{ + sidepane.quicks.map((item,i)=>{ if(item.src=="nightlight"){ - if(item.state) document.body.dataset.sepia = true; + if(pnstates[i]) document.body.dataset.sepia = true; else document.body.dataset.sepia = false; } }) }) + useEffect(()=>{ + // console.log("ok") + var tmp = [] + for (var i = 0; i < sidepane.quicks.length; i++) { + var val = getTreeValue(setting, sidepane.quicks[i].state) + if(sidepane.quicks[i].name=="Theme") val = val=="dark" + tmp.push(val) + } + + setPnstate(tmp) + }, [setting, sidepane]) + return ( -
- {paneApps.quicks.map((qk, idx)=>{ + {sidepane.quicks.map((qk, idx)=>{ return (
-
- +
+
{qk.name}
@@ -477,184 +171,6 @@ export const SidePane = () => { ); } -export const WidPane = () => { - const dispatch = useDispatch(); - const widget = useSelector(state => state.widpane); - - const getRandom = (x = 0) => { - return `hsl(${Math.floor(Math.random()*360)}deg 36% 84%)`; - } - - useEffect(async () => { - // console.log(process.env.REACT_APP_DEVELOPEMENT); - if (process.env.REACT_APP_DEVELOPEMENT != "development") { - if (!widget.updated && !widget.hide) { - var tmpWdgt = await fetchApi(widget); - console.log("Fetching Api's"); - if (tmpWdgt.updated) { - dispatch({ - type: "WIDGREST", - payload: tmpWdgt - }) - } - } - } - }) - - return ( -
-
-
- -
-
- {new Date().toLocaleTimeString("en-US",{ - hour: 'numeric', - minute: '2-digit' - })} -
-
-
-
-
WEATHER
-
- - {widget.data.weather.city}, {widget.data.weather.country} -
-
-
- -
{widget.data.weather.temp}
-
ºC
-
-
-
- {widget.data.weather.wstate} -
-
-
- - {widget.data.weather.rain}% -
-
- - {widget.data.weather.wind} -
-
-
-
-
- {widget.data.weather.days.map((item,i)=>{ - return ( -
-
{i==0?"Today":item.day}
- - -
{item.min}º
-
{item.max}º
-
- ) - })} -
-
-
-
-
MONEY | MARKET
-
-
- -
GOOGL
-
-
-
{widget.data.stock[0][0]}
-
- {widget.data.stock[0][2]?'+':'-'} - {widget.data.stock[0][1]}% -
-
-
-
-
- -
TSLA
-
-
-
{widget.data.stock[1][0]}
-
- {widget.data.stock[1][2]?'+':'-'} - {widget.data.stock[1][1]}% -
-
-
-
-
-
-
-  ON THIS DAY -
-
{widget.data.date}
-
-
-
- {widget.data.event.text} -
- more on wiki -
-
-
-
-
-
-
TOP STORIES
-
- {[...widget.data.news].splice(0,4).map((article,i)=>{ - return ( -
-
{article.source.name}
-
{article.title}
-
- ) - })} -
-
-
- {[...widget.data.news].splice(4, widget.data.news.length).map((article, i)=>{ - return ( - -
-
{article.source.name}
-
{article.title}
- {i%5==4? -
{article.content}
: - null} -
-
- ) - })} -
-
-
-
-
- ); -} - export const CalnWid = () => { const sidepane = useSelector(state => state.sidepane); const [loaded, setLoad] = useState(false); @@ -680,49 +196,3 @@ export const CalnWid = () => {
); } - -const fetchApi = async (widget) => { - var tmpWdgt = { - ...widget - }; - var date = new Date(); - - console.log('fetching ON THIS DAY'); - await axios.get(`https://en.wikipedia.org/api/rest_v1/feed/onthisday/events/${date.getMonth()}/${date.getDay()}`) - .then(res => res.data).then(data => { - console.log("Fetched"); - var event = data.events[Math.floor(Math.random() * data.events.length)]; - date.setYear(event.year); - - tmpWdgt.data.date = date.toLocaleDateString("en-US", { - year: "numeric", - month: "short", - day: "numeric" - }); - - tmpWdgt.data.event = event; - }).catch((error) => { - console.log("Fetch failed"); - }); - - console.log('fetching NEWS'); - await axios.get(`https://saurav.tech/NewsAPI/top-headlines/category/general/in.json`) - .then(res => res.data).then(data => { - console.log('NEWS Fetched'); - var newsList = []; - for (var i = 0; i < data.totalResults; i++) { - var item = { - ...data.articles[i] - }; - item.title = item.title.split("-").reverse().splice(1).reverse().join("-").trim(); - newsList.push(item); - } - - tmpWdgt.data.news = newsList; - }).catch((error) => { - console.log("Fetch failed"); - }); - - tmpWdgt.updated = true; - return tmpWdgt; -} diff --git a/src/components/start/searchpane.scss b/src/components/start/searchpane.scss index 5adf5dfcc..54f655933 100644 --- a/src/components/start/searchpane.scss +++ b/src/components/start/searchpane.scss @@ -6,9 +6,9 @@ .searchBar { height: 30px; - border: solid 2px #0e60e4; + border-bottom: solid 2px var(--clrPrm); border-radius: 6px; - background: #fefefe; + background: var(--bg1); display: flex; padding: 0 10px; @@ -19,16 +19,30 @@ input { width: 400px; - color: #222; + background: var(--bg1); + color: var(--txt-col); } } -.opts div { - border: solid 0 #1f4aff; - cursor: pointer; +.topApp { + background: var(--bg2); +} + +.smatch { + background: var(--bg2); +} + +.opts { + color: var(--med-txt); + + div { + border: solid 0 var(--clrPrm); + cursor: pointer; - &[value="true"] { - border-bottom-width: 2px; + &[value="true"] { + border-bottom-width: 2px; + color: var(--dark-txt); + } } } @@ -43,7 +57,7 @@ .rightSide { margin: 8px; height: 400px; - background: #fafafa; + background: var(--bg2); display: flex; flex-direction: column; align-items: center; @@ -52,7 +66,7 @@ width: 90%; height: 1px; border-radius: 10px; - background: #dfdfdf; + background: var(--bg2); } } @@ -65,22 +79,27 @@ } .qksrch { - color: #111; + color: var(--txt-col); + + &:hover { + background: var(--bg2); + } } .qksrch svg { - color: #333; + color: var(--med-txt); } .calnpane { + --bg1: rgba(242, 242, 242, 0.9); + position: absolute; bottom: 12px; right: 12px; - // width: 280px; - // min-height: 300px; - background: rgba(255, 255, 255, 0.88); - -webkit-backdrop-filter: blur(10px); - backdrop-filter: blur(10px); + background: var(--bg1); + color: var(--dark-txt); + -webkit-backdrop-filter: blur(20px); + backdrop-filter: blur(20px); overflow: hidden; transition: all ease-in-out 200ms; z-index: 9999; @@ -93,13 +112,17 @@ } } +body[data-theme="dark"] .calnpane { + --bg1: rgba(36, 36, 36, 0.8); +} + .powerCont { position: absolute; top: -90px; left: -68px; width: 96px; font-size: 12px; - background: #fefefe; + background: var(--bg2); padding: 4px 6px; border-radius: 6px; box-shadow: 2px 2px 12px rgba(46, 40, 40, 0.25); @@ -119,7 +142,7 @@ border-radius: 4px; &:hover { - background: #ededed; + background: var(--bg2); } } diff --git a/src/components/start/sidepane.scss b/src/components/start/sidepane.scss index d5f232517..c39f75d13 100644 --- a/src/components/start/sidepane.scss +++ b/src/components/start/sidepane.scss @@ -1,10 +1,15 @@ .sidePane { + --bg1: rgba(242, 242, 242, 0.9); + --bg2: #fbfbfb; + --bg3: #f5f5f5; + position: absolute; bottom: 1rem; right: 1rem; width: 360px; border-radius: 0.5rem; - background: rgba(255, 255, 255, 0.88); + color: var(--dark-txt); + background: var(--bg1); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); overflow: hidden; @@ -19,6 +24,16 @@ } } +body[data-theme="dark"] .sidePane { + --bg1: rgba(36, 36, 36, 0.8); + --bg2: rgba(255, 255, 255, 0.08); + --bg3: rgba(255, 255, 255, 0.12); + + .uicon { + filter: invert(1); + } +} + .quickSettings { display: flex; flex-direction: column; @@ -52,12 +67,16 @@ align-items: center; justify-content: center; border-bottom-color: rgba(0, 0, 0, 0.2); - background: rgba(255, 255, 255, 0.9); + background: var(--bg2); border: solid 0.1px rgba(17, 17, 17, 0.1); transition: all 0.1s ease; + &:hover { + background: var(--bg3); + } + &[data-state="true"] { - background: rgb(0, 90, 255); + background: var(--clrPrm); .qktext { color: #ececec; @@ -83,7 +102,7 @@ } .sliders[type="range"] { - --track-color: linear-gradient(90deg, #005fba 100%, #888888 100%); + --track-color: linear-gradient(90deg, var(--clrPrm) 100%, #888888 100%); -webkit-appearance: none; background-color: transparent; } @@ -95,11 +114,11 @@ border: 0; } .sliders[type="range"]::-webkit-slider-thumb { - border: 4px solid white; + border: 4px solid var(--bg1); height: 20px; width: 20px; border-radius: 10px; - background: #005fba; + background: var(--clrPrm); -webkit-appearance: none; margin-top: -9px; } @@ -114,11 +133,11 @@ border: 0; } .sliders[type="range"]::-moz-range-thumb { - border: 4px solid white; + border: 4px solid var(--bg1); height: 20px; width: 20px; border-radius: 10px; - background: #005fba; + background: var(--clrPrm); } .sliders[type="range"]::-ms-track { width: 100%; @@ -139,7 +158,7 @@ } .sliders[type="range"]::-ms-thumb { margin-top: 1px; - border: 4px solid white; + border: 4px solid var(--bg1); height: 20px; width: 20px; border-radius: 10px; @@ -152,31 +171,24 @@ background: var(--track-color); } -.managentf { - text-align: right; - padding: 13px 14px; -} - -.nonewnotif { - position: absolute; - top: 48%; - left: 32%; - font-size: 0.72em; - font-weight: 500; - color: #464646; -} - +// Widgets .widPaneCont { + --bg1: rgba(234, 234, 234, 0.25); + --bg2: rgba(255, 255, 255, 0.5); + --clr1: #fefefe; + --clrWeather: #fff3be; + --topStoriesClr: #c6a0ff; + position: absolute; - top: 0; - left: 0; + top: 12px; + left: 12px; + bottom: 12px; width: 610px; - height: 100%; - margin: 6px; + border-radius: 8px; overflow: hidden; transform: translateX(0); - -webkit-backdrop-filter: blur(40px); - backdrop-filter: blur(40px); + -webkit-backdrop-filter: blur(20px); + backdrop-filter: blur(20px); transition: all 0.3s cubic-bezier(0.77, 0, 0.18, 1); z-index: 9999; @@ -186,11 +198,19 @@ } } +body[data-theme="dark"] .widPaneCont { + --bg1: rgba(31, 31, 31, 0.25); + --bg2: rgba(255, 255, 255, 0.1); + --clr1: #534f88; + --clrWeather: #1b2257; + --topStoriesClr: #35264c; +} + .WidPane { width: 100%; - border-radius: 8px; - height: calc(100% - 12px); - background: rgba(255, 255, 255, 0.25); + height: 100%; + color: var(--dark-txt); + background: var(--bg1); display: flex; flex-direction: column; align-items: center; @@ -202,14 +222,14 @@ display: flex; padding: 18px 28px 0 0; justify-content: flex-end; - color: #222; + color: var(--txt-col); } .widTime { display: flex; justify-content: center; font-size: 1.5em; - color: #222; + color: var(--txt-col); } .widgetCont { @@ -228,10 +248,10 @@ padding: 12px 14px; border-radius: 6px; box-sizing: border-box; - background: rgb(255, 255, 255); - background: -webkit-linear-gradient(top left, #fefefe 0%, #fff3be 80%); - background: -o-linear-gradient(top left, #fefefe 0%, #fff3be 80%); - background: linear-gradient(to bottom right, #fefefe 0%, #fff3be 80%); + background: var(--clr1); + background: -webkit-linear-gradient(top left, var(--clr1) 0%, var(--clrWeather) 80%); + background: -o-linear-gradient(top left, var(--clr1) 0%, var(--clrWeather) 80%); + background: linear-gradient(to bottom right, var(--clr1) 0%, var(--clrWeather) 80%); display: flex; flex-direction: column; align-items: center; @@ -279,7 +299,7 @@ .wthunit { margin: 0 2px; font-size: 0.72em; - color: rgba(5, 5, 5, 0.4); + color: var(--sat-txt); padding-bottom: 6px; } } @@ -306,7 +326,7 @@ .uicon { margin-right: 2px; - color: rgba(0, 0, 0, 0.8); + color: var(--med-txt); } } } @@ -321,7 +341,7 @@ width: 23%; border-radius: 4px; padding: 4px 0; - background: rgba(255, 255, 255, 0.4); + background: var(--bg2); display: flex; flex-direction: column; justify-content: space-between; @@ -335,7 +355,7 @@ .tempCont { font-size: 1.36em; - color: #3b3b3b; + color: var(--med-txt); } } } @@ -352,7 +372,7 @@ width: 100%; height: 100%; margin: 4px 4px 6px; - background: #fefefe; + background: var(--clrWeather); border-radius: 6px; padding: 8px 12px 0; overflow: hidden; @@ -361,7 +381,7 @@ width: 100%; font-size: 0.6em; letter-spacing: 1px; - color: #666; + color: var(--gray-txt); margin-bottom: 16px; display: flex; justify-content: space-between; @@ -382,7 +402,7 @@ } .stName { - color: #4a4a4a; + color: var(--med-txt); padding-top: 1px; } } @@ -401,7 +421,7 @@ margin-left: 8px; font-size: 0.8em; background: #eb3535; - color: #fefefe; + color: var(--clr1); &[data-pos="true"] { background: #09d031; @@ -412,7 +432,7 @@ .short1 { position: relative; - background-color: #fefefe00; + background-color: transparent; background-repeat: no-repeat; background-size: cover; background-position: center; @@ -448,11 +468,10 @@ .shName { margin-bottom: 4px; - color: #fefefe; + color: #eee; div:nth-child(2) { font-weight: 600; - color: #fefefe; } } @@ -467,7 +486,7 @@ .dayInfo { max-height: 64px; font-size: 0.72em; - color: #fefefe; + color: #ddd; margin-top: auto; line-height: 14px; overflow: hidden; @@ -481,7 +500,7 @@ a { text-decoration: none; font-size: 0.64em; - color: #c1e2ff; + color: #c3c3c3; text-align: right; } } @@ -503,10 +522,10 @@ position: relative; border-radius: 4px; padding: 12px; - background: rgb(209, 209, 209); - background: -webkit-linear-gradient(top left, rgba(230, 230, 230, 1) 0%, rgba(255, 255, 255, 1) 100%); - background: -o-linear-gradient(top left, rgba(230, 230, 230, 1) 0%, rgba(255, 255, 255, 1) 100%); - background: linear-gradient(to bottom right, rgba(230, 230, 230, 1) 0%, rgba(255, 255, 255, 1) 100%); + background: var(--comp-txt); + background: -webkit-linear-gradient(top left, var(--topStoriesClr) 0%, var(--comp-txt) 100%); + background: -o-linear-gradient(top left, var(--topStoriesClr) 0%, var(--comp-txt) 100%); + background: linear-gradient(to bottom right, var(--topStoriesClr) 0%, var(--comp-txt) 100%); &::after { content: "source: saurav.tech/NewsAPI"; @@ -515,11 +534,12 @@ right: 0; font-size: 0.64em; padding: 6px; - color: #0e2d67; + color: var(--clrPrm); + opacity: 0.67; } .topNewsText { - color: #1f202e; + color: var(--txt-col); font-size: 0.72em; font-weight: 600; } @@ -535,7 +555,7 @@ padding: 16px 12px 0 0; .tpSource { - color: #666; + color: var(--gray-txt); font-size: 0.6em; } @@ -543,7 +563,7 @@ margin: 4px 0; font-size: 0.76em; font-weight: 600; - color: #1d1d25; + color: var(--txt-col); height: 48px; overflow: hidden; text-overflow: ellipsis; @@ -570,7 +590,7 @@ padding: 0 12px; border-radius: 6px; overflow: hidden; - background-color: #e6e6e6; + background-color: var(--comp-txt); background-repeat: no-repeat; background-size: cover; background-position: center; @@ -583,10 +603,10 @@ left: 0; width: 100%; height: 100%; - background: rgb(255, 255, 255); - background: -webkit-linear-gradient(hsl(0deg 12% 90% / 0%) 50%, var(--backgrad) 90%); - background: -o-linear-gradient(hsl(0deg 12% 90% / 0%) 50%, var(--backgrad) 90%); - background: linear-gradient(hsl(0deg 12% 90% / 0%) 50%, var(--backgrad) 90%); + background: var(--dark-txt); + background: -webkit-linear-gradient(transparent 50%, var(--backgrad) 90%); + background: -o-linear-gradient(transparent 50%, var(--backgrad) 90%); + background: linear-gradient(transparent 50%, var(--backgrad) 90%); z-index: 0; } @@ -596,17 +616,17 @@ padding: 0 12px 12px 0; .tpSource { - color: #222; + color: var(--txt-col); font-size: 0.6em; font-weight: 500; - text-shadow: 0 0 4px white; + text-shadow: 0 0 4px var(--comp-txt); } .tpArticle { margin-top: 4px; font-size: 0.8em; font-weight: 600; - color: #111; + color: var(--txt-col); max-height: 56px; overflow: hidden; text-overflow: ellipsis; @@ -630,10 +650,10 @@ left: 0; width: 100%; height: 100%; - background: rgb(255, 255, 255); - background: -webkit-linear-gradient(right, hsl(0deg 12% 90% / 0%) 0%, var(--backgrad) 60%); - background: -o-linear-gradient(right, hsl(0deg 12% 90% / 0%) 0%, var(--backgrad) 60%); - background: linear-gradient(to left, hsl(0deg 12% 90% / 0%) 0%, var(--backgrad) 60%); + background: var(--dark-txt); + background: -webkit-linear-gradient(right, transparent 0%, var(--backgrad) 60%); + background: -o-linear-gradient(right, transparent 0%, var(--backgrad) 60%); + background: linear-gradient(to left, transparent 0%, var(--backgrad) 60%); z-index: 0; } @@ -653,7 +673,7 @@ .tpdesc { font-size: 0.72em; font-weight: 400; - color: #4d4d4d; + color: var(--med-txt); max-height: 90px; overflow: hidden; text-overflow: ellipsis; diff --git a/src/components/start/start.js b/src/components/start/start.js new file mode 100644 index 000000000..594069996 --- /dev/null +++ b/src/components/start/start.js @@ -0,0 +1,322 @@ +import React, { useState, useEffect } from "react"; +import { useSelector, useDispatch } from "react-redux"; +import { Icon } from "../../utils/general"; + +export const StartMenu = () => { + const { align } = useSelector((state) => state.taskbar); + const start = useSelector((state) => { + var arr = state.startmenu, + ln = (6 - (arr.pnApps.length % 6)) % 6; + + for (var i = 0; i < ln; i++) { + arr.pnApps.push({ + empty: true, + }); + } + + for (i = 0; i < arr.rcApps.length; i++) { + if (arr.rcApps[i].lastUsed < 0) { + arr.rcApps[i].lastUsed = "Recently Added"; + } else if (arr.rcApps[i].lastUsed < 10) { + arr.rcApps[i].lastUsed = "Just Now"; + } else if (arr.rcApps[i].lastUsed < 60) { + arr.rcApps[i].lastUsed += "m ago"; + } else if (arr.rcApps[i].lastUsed < 360) { + arr.rcApps[i].lastUsed = Math.floor(arr.rcApps[i].lastUsed / 60) + "h ago"; + } + } + + var allApps = [], + tmpApps = Object.keys(state.apps) + .filter((x) => x != "hz") + .map((key) => { + return state.apps[key]; + }); + + tmpApps.sort((a, b) => (a.name > b.name ? 1 : b.name > a.name ? -1 : 0)); + + for (i = 0; i < 27; i++) { + allApps[i] = []; + } + + for (i = 0; i < tmpApps.length; i++) { + var t1 = tmpApps[i].name.trim().toUpperCase().charCodeAt(0); + if (t1 > 64 && t1 < 91) { + allApps[t1 - 64].push(tmpApps[i]); + } else { + allApps[0].push(tmpApps[i]); + } + } + + arr.contApps = allApps; + arr.allApps = tmpApps; + return arr; + }); + + const [query, setQuery] = useState(""); + const [match, setMatch] = useState({}); + const [atab, setTab] = useState("All"); + // const [pwctrl, setPowCtrl] = useState + + const dispatch = useDispatch(); + const tabSw = (e) => { + setTab(e.target.innerText.trim()); + }; + + const clickDispatch = (event) => { + var action = { + type: event.target.dataset.action, + payload: event.target.dataset.payload, + }; + + if (action.type) { + dispatch(action); + } + + if (action.type && (action.payload == "full" || action.type == "EDGELINK")) { + dispatch({ + type: "STARTHID", + }); + } + + if (action.type == "STARTALPHA") { + var target = document.getElementById("char" + action.payload); + if (target) { + target.parentNode.scrollTop = target.offsetTop; + } else { + var target = document.getElementById("charA"); + target.parentNode.scrollTop = 0; + } + } + }; + + useEffect(() => { + if (query.length) { + for (var i = 0; i < start.allApps.length; i++) { + if (start.allApps[i].name.toLowerCase().includes(query.toLowerCase())) { + setMatch(start.allApps[i]); + break; + } + } + } + }, [query]); + + return ( +
+ {start.menu ? ( + <> +
+
+
+
+
Pinned
+
+
All apps
+ +
+
+
+ {start.pnApps.map((app, i) => { + return app.empty ? ( +
+ ) : ( +
+ +
{app.name}
+
+ ); + })} +
+
+
+
+
Recommended
+
+
More
+ +
+
+
+ {start.rcApps.slice(0, 6).map((app, i) => { + return app.name ? ( +
+ +
+
{app.name}
+
{app.lastUsed}
+
+
+ ) : null; + })} +
+
+
+
+
+
+
+
All apps
+
+ +
Back
+
+
+
+ {start.contApps.map((ldx, i) => { + if (ldx.length == 0) return null; + + var tpApps = []; + tpApps.push( +
+
{i == 0 ? "#" : String.fromCharCode(i + 64)}
+
+ ); + + ldx.forEach((app, j) => { + tpApps.push( +
+ +
{app.name}
+
+ ); + }); + + return tpApps; + })} +
+
+
+
+
&
+
+ {start.contApps.map((ldx, i) => { + return ( +
+
{i == 0 ? "#" : String.fromCharCode(i + 64)}
+
+ ); + })} +
+
+
+
+
+
+ +
Blue Edge
+
+
+
+
+ + Shut down +
+
+ + Restart +
+
+ + Lock +
+
+ +
+
+ + ) : ( +
+
+ + { + setQuery(event.target.value.trim()); + }} + defaultValue={query} + placeholder="Type here to search" + /> +
+
+
+
+ All +
+
+ Apps +
+
+ Documents +
+
+ Web +
+
+ More +
+
+
+
+
+
{query.length ? "Best match" : "Top apps"}
+ {query.length ? ( +
+
+ +
+
{match.name}
+
App
+
+
+
+ +
+
Search online
+
Web
+
+
+
+ ) : ( + <> +
+ {start.rcApps.slice(2, 7).map((app, i) => { + return ( +
+ +
{app.name}
+
+ ); + })} +
+
Quick Searches
+
+ {start.qksrch.map((srch) => { + return ( +
+ +
{srch[2]}
+
+ ); + })} +
+ + )} +
+ {query.length ? ( +
+ +
{match.name}
+
App
+
+
+ +
Open
+
+
+ ) : null} +
+
+ )} +
+ ); +}; diff --git a/src/components/start/startmenu.scss b/src/components/start/startmenu.scss index a31ddc750..b2bbd6d38 100644 --- a/src/components/start/startmenu.scss +++ b/src/components/start/startmenu.scss @@ -29,7 +29,10 @@ } .startMenu { + --bg1: rgba(242, 242, 242, 0.9); + --bg2: rgba(255, 255, 255, 0.9); --roundRad: 6px; + position: absolute; bottom: 10px; width: 520px; @@ -45,32 +48,38 @@ left: 8px; } - background: rgba(255, 255, 255, 0.88); + color: var(--dark-txt); + background: var(--bg1); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border-radius: var(--roundRad); overflow: hidden; - transition: all .2s cubic-bezier(.79,.14,.15,.86); + transition: all 0.2s cubic-bezier(0.79, 0.14, 0.15, 0.86); z-index: 9999; - &[data-hide='true'] { + &[data-hide="true"] { transform: translateY(100px); opacity: 0; pointer-events: none; } } +body[data-theme="dark"] .startMenu { + --bg1: rgba(36, 36, 36, 0.8); + --bg2: rgba(255, 255, 255, 0.1); +} + .allCont, .stmenu { position: relative; width: 520px; height: 480px; - &[data-allapps='false'] { + &[data-allapps="false"] { transition: ease-in-out 200ms; } - &[data-allapps='true'] { + &[data-allapps="true"] { // margin-left: -520px; transform: translateX(-520px); transition: ease-in-out 200ms; @@ -92,7 +101,7 @@ flex-direction: row; justify-content: space-between; align-items: center; - background: rgba(175, 175, 175, 0.1); + background: rgba(0, 0, 0, 0.1); // fine in dark mode too :) } .profile { @@ -104,13 +113,12 @@ margin-left: 12px; font-size: 0.7em; font-weight: 400; - color: #111; + color: var(--txt-col); } } .menuUp { padding: 36px 48px; - // background: rgba(255, 255, 255, 0.84); } .stAcbar { @@ -120,11 +128,11 @@ .gpname { font-weight: 600; font-size: 0.74em; - color: #111; + color: var(--dark-col); } .gpbtn { - background: rgba(255, 255, 255, 0.9); + background: var(--bg2); padding: 0 8px 2px; font-size: 0.64em; font-weight: 400; @@ -137,7 +145,7 @@ svg { margin-left: 4px; padding-top: 2px; - color: #414141; + color: var(--med-txt); } .chevLeft svg { @@ -169,11 +177,10 @@ position: absolute; top: -2px; right: -2px; - width: 3px; - height: 3px; - border: solid 1px #88b7ee; + width: 4px; + height: 4px; border-radius: 6px; - background: #1372e3; + background: var(--clrPrm); } .pnIcon::after { @@ -183,7 +190,7 @@ height: 0; top: -12px; padding: 0 42px 60px; - background: rgba(255, 255, 255, 0); + background: transparent; z-index: -1; transition: all ease-in-out 100ms; border-radius: 4px; @@ -192,7 +199,7 @@ .appName { width: 24px; display: flex; - color: #2f2f2f; + color: var(--txt-col); margin-top: 4px; font-weight: 500; font-size: 0.64em; @@ -202,7 +209,7 @@ cursor: default; } - &:nth-child(6n+1) { + &:nth-child(6n + 1) { width: 10%; align-items: flex-start; } @@ -214,7 +221,7 @@ } .pnApp:hover .pnIcon::after { - background: rgba(255, 255, 255, 0.5); + background: var(--bg2); } } @@ -233,7 +240,7 @@ display: grid; grid-auto-flow: column; grid-template-columns: 240px 184px; - grid-template-rows: repeat(3,minmax(0,1fr)); + grid-template-rows: repeat(3, minmax(0, 1fr)); .rnApp { display: flex; @@ -245,13 +252,13 @@ margin: 0 12px; .appName { - color: #2f2f2f; + color: var(--txt-col); font-size: 0.7em; font-weight: 700; } .timeUsed { - color: #535353; + color: var(--gray-txt); font-size: 0.6em; font-weight: 500; } @@ -279,7 +286,7 @@ transition: all ease-in-out 200ms; transform-origin: center; - &[data-alpha='true'] { + &[data-alpha="true"] { transform: scale(0); opacity: 0; pointer-events: none; @@ -288,7 +295,7 @@ &::-webkit-scrollbar { display: none; width: 1.6px; - background-color: transparent; + background: transparent; } &:hover::-webkit-scrollbar { @@ -298,7 +305,7 @@ &::-webkit-scrollbar-thumb { width: 1.6px; border-radius: 10px; - background-color: rgba(0, 0, 0, 0.4); + background: var(--sat-txt); } .allApp { @@ -318,7 +325,7 @@ left: 0; z-index: -1; border-radius: 4px; - background: rgba(255, 255, 255, 0.4); + background: var(--bg2); } .ltName { @@ -332,7 +339,7 @@ text-align: left; width: 20%; padding-left: 4px; - color: #2f2f2f; + color: var(--txt-col); font-weight: 500; font-size: 0.6em; margin: 0 12px; @@ -351,7 +358,7 @@ transform-origin: center; transition: all ease-in-out 200ms; - &[data-alpha='false'] { + &[data-alpha="false"] { opacity: 0; transform: scale(2); pointer-events: none; @@ -363,9 +370,9 @@ width: 160px; height: 280px; display: grid; - grid-template-columns: repeat(4,minmax(0,1fr)); - grid-template-rows: repeat(7,minmax(0,1fr)); - color: #010101; + grid-template-columns: repeat(4, minmax(0, 1fr)); + grid-template-rows: repeat(7, minmax(0, 1fr)); + color: var(--txt-col); cursor: pointer; .allApp { @@ -375,6 +382,6 @@ .dullApp { cursor: default; - color: rgba(0, 0, 0, 0.36); + color: var(--sat-txt); } } diff --git a/src/components/start/widget.js b/src/components/start/widget.js new file mode 100644 index 000000000..108411e27 --- /dev/null +++ b/src/components/start/widget.js @@ -0,0 +1,228 @@ +import React, { useState, useEffect} from 'react'; +import { useSelector, useDispatch} from 'react-redux'; +import {Icon} from '../../utils/general'; + +import axios from 'axios'; + +export const WidPane = () => { + const dispatch = useDispatch(); + const widget = useSelector((state) => state.widpane); + const theme = useSelector((state) => state.setting.person.theme); + const getRandom = (x = 0) => { + if (theme=="light") return `hsl(${Math.floor(Math.random()*360)}deg 36% 84%)`; + if (theme=="dark") return `hsl(${Math.floor(Math.random()*360)}deg 36% 16%)`; + } + + useEffect(async () => { + if (process.env.REACT_APP_DEVELOPEMENT != "development") { + if (!widget.updated && !widget.hide) { + var tmpWdgt = await fetchApi(widget); + console.log("Fetching Api's"); + if (tmpWdgt.updated) { + dispatch({ + type: "WIDGREST", + payload: tmpWdgt + }) + } + } + } + }) + + return ( +
+
+
+ +
+
+ {new Date().toLocaleTimeString("en-US",{ + hour: 'numeric', + minute: '2-digit' + })} +
+
+
+
+
WEATHER
+
+ + {widget.data.weather.city}, {widget.data.weather.country} +
+
+
+ +
{widget.data.weather.temp}
+
ºC
+
+
+
+ {widget.data.weather.wstate} +
+
+
+ + {widget.data.weather.rain}% +
+
+ + {widget.data.weather.wind} +
+
+
+
+
+ {widget.data.weather.days.map((item,i)=>{ + return ( +
+
{i==0?"Today":item.day}
+ + +
{item.min}º
+
{item.max}º
+
+ ) + })} +
+
+
+
+
MONEY | MARKET
+
+
+ +
GOOGL
+
+
+
{widget.data.stock[0][0]}
+
+ {widget.data.stock[0][2]?'+':'-'} + {widget.data.stock[0][1]}% +
+
+
+
+
+ +
TSLA
+
+
+
{widget.data.stock[1][0]}
+
+ {widget.data.stock[1][2]?'+':'-'} + {widget.data.stock[1][1]}% +
+
+
+
+
+
+
+  ON THIS DAY +
+
{widget.data.date}
+
+
+
+ {widget.data.event.text} +
+ more on wiki +
+
+
+
+
+
+
TOP STORIES
+
+ {[...widget.data.news].splice(0,4).map((article,i)=>{ + return ( +
+
{article.source.name}
+
{article.title}
+
+ ) + })} +
+
+
+ {[...widget.data.news].splice(4, widget.data.news.length).map((article, i)=>{ + return ( + +
+
{article.source.name}
+
{article.title}
+ {i%5==4? +
{article.content}
: + null} +
+
+ ) + })} +
+
+
+
+
+ ); +} + +const fetchApi = async (widget) => { + var tmpWdgt = { + ...widget + }; + var date = new Date(); + + console.log('fetching ON THIS DAY'); + await axios.get(`https://en.wikipedia.org/api/rest_v1/feed/onthisday/events/${date.getMonth()}/${date.getDay()}`) + .then(res => res.data).then(data => { + console.log("Fetched"); + var event = data.events[Math.floor(Math.random() * data.events.length)]; + date.setYear(event.year); + + tmpWdgt.data.date = date.toLocaleDateString("en-US", { + year: "numeric", + month: "short", + day: "numeric" + }); + + tmpWdgt.data.event = event; + }).catch((error) => { + console.log("Fetch failed"); + }); + + console.log('fetching NEWS'); + await axios.get(`https://saurav.tech/NewsAPI/top-headlines/category/general/in.json`) + .then(res => res.data).then(data => { + console.log('NEWS Fetched'); + var newsList = []; + for (var i = 0; i < data.totalResults; i++) { + var item = { + ...data.articles[i] + }; + item.title = item.title.split("-").reverse().splice(1).reverse().join("-").trim(); + newsList.push(item); + } + + tmpWdgt.data.news = newsList; + }).catch((error) => { + console.log("Fetch failed"); + }); + + tmpWdgt.updated = true; + return tmpWdgt; +} diff --git a/src/components/taskbar/index.js b/src/components/taskbar/index.js index c3df9fad6..fce04f5ae 100644 --- a/src/components/taskbar/index.js +++ b/src/components/taskbar/index.js @@ -87,12 +87,12 @@ const Taskbar = ()=>{
- + {tasks.search?( - + ):null} {tasks.widgets?( - + ):null} {tasks.apps.map((task,i)=>{ var isHidden = apps[task.icon].hide; @@ -100,7 +100,7 @@ const Taskbar = ()=>{ return (
-
@@ -114,7 +114,7 @@ const Taskbar = ()=>{ return key!="hz" && !apps[key].task && !apps[key].hide?(
-
diff --git a/src/components/taskbar/taskbar.scss b/src/components/taskbar/taskbar.scss index 398f2dd18..17e8bfe27 100644 --- a/src/components/taskbar/taskbar.scss +++ b/src/components/taskbar/taskbar.scss @@ -1,42 +1,55 @@ .taskbar { + --bg1: rgba(243, 243, 243, 0.85); + position: absolute; width: 100vw; height: 39px; - background: rgb(243 243 243 / 85%); + color: var(--dark-txt); + background: var(--bg1); -webkit-backdrop-filter: saturate(3) blur(20px); backdrop-filter: saturate(3) blur(20px); bottom: 0; z-index: 10000; } +body[data-theme="dark"] { + .taskbar { + --bg1: rgba(32, 32, 32, 0.75); + } + + .taskIcon, + .searchIcon img { + filter: invert(1); + } +} + .battery { display: inline-block; - position:relative; - margin-top: 2px; + position: relative; + display: flex; - i{ - color: #222; + i { + color: #232323; } - .uicon{ + .uicon { position: absolute; - margin-top: 24%; + margin-top: -24%; margin-left: -12%; - filter: drop-shadow(1px 1px #fefefe) invert(0.1); + z-index: 1; + filter: drop-shadow(1px 1px #fefefe) invert(0.14); } } .battery .fa { - font: normal normal normal 14px/2 FontAwesome; + font: normal normal normal FontAwesome; + font-size: 13px; } -.battery .animate{ - width:88%; - position:absolute; - left:0; - top:0; +.battery .animate { + position: absolute; overflow: hidden; - z-index: -1; + z-index: 0; -webkit-transition: all 0.5s ease; -moz-transition: all 0.5s ease; transition: all 0.5s ease; @@ -114,12 +127,7 @@ background: rgba(254, 254, 254, 0); transform-origin: center; animation: popintro 800ms ease-in-out; - - &:hover { - background: rgba(#fefefe, 0.64); - border-radius: 4px; - transition: all ease-in-out 200ms; - } + border-radius: 4px; &:after { content: ""; @@ -132,14 +140,14 @@ background: #858585; transition: all 0.2s ease-in-out; } - + &[data-open="true"]:after { width: 6px; } &[data-active="true"]:after { width: 12px; - background: #1f4dcd; + background: var(--clrPrm); } } diff --git a/src/containers/applications/apps/about.js b/src/containers/applications/apps/about.js index 1036cbfa5..77f483ae7 100644 --- a/src/containers/applications/apps/about.js +++ b/src/containers/applications/apps/about.js @@ -1,83 +1,84 @@ -import React, {useState, useEffect} from 'react'; -import {useSelector, useDispatch} from 'react-redux'; -import {Icon, Image, ToolBar} from '../../../utils/general'; +import React, { useState, useEffect } from "react"; +import { useSelector, useDispatch } from "react-redux"; +import { Icon, Image, ToolBar } from "../../../utils/general"; -export const AboutWin = ()=>{ - const {abOpen} = useSelector(state=> state.desktop); - const {locked, booted} = useSelector(state => state.wallpaper); - const [open, setOpen] = useState(true && process.env.REACT_APP_ENV!="development"); - const [timer, setTimer] = useState(localStorage.getItem('closeAbout')=="true"?0:6); +export const AboutWin = () => { + const { abOpen } = useSelector((state) => state.desktop); + const { locked, booted } = useSelector((state) => state.wallpaper); + const [open, setOpen] = useState(true && process.env.REACT_APP_ENV != "development"); + const [timer, setTimer] = useState(localStorage.getItem("closeAbout") == "true" ? 0 : 6); const dispatch = useDispatch(); - const action = ()=>{ + const action = () => { setOpen(false); - localStorage.setItem('closeAbout',true); - dispatch({type: "DESKABOUT", payload: false}); - } + localStorage.setItem("closeAbout", true); + dispatch({ type: "DESKABOUT", payload: false }); + }; - useEffect(()=>{ - if(timer>0 && !locked && booted){ - setTimeout(()=>{ - setTimer(timer-1) - }, 1000) + useEffect(() => { + if (timer > 0 && !locked && booted) { + setTimeout(() => { + setTimer(timer - 1); + }, 1000); } - }, [timer, locked, booted]) + }, [timer, locked, booted]); - return open || abOpen?( + return open || abOpen ? (
-
+
About
- {/* */} - {/*
*/}
OS (In ReactJs)
Version 11
- {/*
© Blue Edge. All rights reserved.
*/} -
+
This open source project is made in the hope to replicate the Windows 11 desktop experience on web, using standard web technologies like React, CSS, and JavaScript. -

- This project is not in anyway affiliated with Microsoft and - should not be confused with Microsoft’s Operating System or Products. -

- This is also not Windows 365 cloud PC. +
+
+ This project is not in anyway affiliated with Microsoft and should not be confused with Microsoft’s Operating System or Products. +
+
+ This is also not{" "} + + Windows 365 cloud PC + + .
-
+
- This project is licensed under Creative Commons. + This project is licensed under{" "} + + Creative Commons + + .
-    -    - contact: blueedgetechno@gmail.com +       contact:{" "} + + blueedgetechno@gmail.com +
-
-
+
+
- - Microsoft, Windows and Other demonstrated Products in this project - are trademarks of the Microsoft group of companies. - + Microsoft, Windows and Other demonstrated Products in this project are trademarks of the Microsoft group of companies.
-
-
-
+
+
+
-
- Ok, I understand {timer>0?( - {"("+timer+")"} - ):null} +
+ Ok, I understand {timer > 0 ? {"(" + timer + ")"} : null}
- ):null; -} + ) : null; +}; diff --git a/src/containers/applications/apps/assets/spotify.ttf b/src/containers/applications/apps/assets/spotify.ttf new file mode 100644 index 000000000..fecd4ad61 Binary files /dev/null and b/src/containers/applications/apps/assets/spotify.ttf differ diff --git a/src/containers/applications/apps/assets/spotify.woff2 b/src/containers/applications/apps/assets/spotify.woff2 new file mode 100644 index 000000000..57bd11f22 Binary files /dev/null and b/src/containers/applications/apps/assets/spotify.woff2 differ diff --git a/src/containers/applications/apps/assets/store.scss b/src/containers/applications/apps/assets/store.scss index e8d7fef01..b0fa6acec 100644 --- a/src/containers/applications/apps/assets/store.scss +++ b/src/containers/applications/apps/assets/store.scss @@ -14,13 +14,13 @@ left: 0; height: 50%; border-radius: 10px; - background: #2570ff; + background: var(--nav-blue); } &:hover, &[data-payload="true"] { - background: #ffffff; - color: #2570ff; + background: var(--nav-btn-hov); + color: var(--nav-blue); } } } @@ -31,16 +31,16 @@ overflow-y: hidden; &:after { - content: ""; - width: 100%; - height: 100px; - position: absolute; - bottom: 0; - background: rgb(255,255,255); - background: -webkit-linear-gradient(bottom, #f4f4f4 10%, rgba(135, 135, 135, 0.4) 50%, rgba(0,0,0,0) 100%); - background: -o-linear-gradient(bottom, #f4f4f4 10%, rgba(135, 135, 135, 0.4) 50%, rgba(0,0,0,0) 100%); - background: linear-gradient(to top, #f4f4f4 10%, rgba(135, 135, 135, 0.4) 50%, rgba(0,0,0,0) 100%); - } + content: ""; + width: 100%; + height: 100px; + position: absolute; + bottom: 0; + background: var(--bg-color); + background: -webkit-linear-gradient(bottom, var(--page-bg) 10%, #87888766 50%, #00000000 100%); + background: -o-linear-gradient(bottom, var(--page-bg) 10%, #87888766 50%, #00000000 100%); + background: linear-gradient(to top, var(--page-bg) 10%, #87888766 50%, #00000000 100%); + } } .panelName { @@ -91,9 +91,10 @@ .pagecont{ border-radius: 6px; - background: #f9f9f9; - border: 1px solid #e2e2e2; + background: var(--page-bg); + border: 1px solid var(--page-bd-col); min-height: 100%; + overflow: hidden; } } @@ -124,12 +125,13 @@ } .ribcont { - background: rgba(255, 255, 255, 0.72); + background: var(--rib-bg); margin: auto 6px; height: auto; width: 120px; transform-origin: center; transition: all ease-in-out 200ms; + color: var(--dark-txt); &:hover{ transform: scale(1.06); @@ -152,10 +154,13 @@ border: solid 1px #ccc; border-radius: 100px; margin-right: 16px; + color: var(--txt-col); &[value="true"]{ - color: #0047ff; - border-color: #0047ff; + // color: #0047ff; + // border-color: #0047ff; + color: var(--nav-blue); + border-color: var(--nav-blue); } } @@ -165,7 +170,7 @@ } .appscont .ribcont{ - background: #fdfdfd; + background: var(--rib2-bg); margin-right: 1em; margin-bottom: 2em; width: auto; @@ -195,8 +200,9 @@ .detailcont, .briefcont{ border-radius: 6px; - background: #f9f9f9; - border: 1px solid #e2e2e2; + background: var(--det-bg); + border: 1px solid var(--page-bd-col); + color: var(--txt-col); } .instbtn{ @@ -211,7 +217,8 @@ .instbtn:hover { background: #0157a2; } -.instbtn:active , .instbtn:focus-visible{ + +.instbtn:active , .instbtn:focus-visible{ background: #03549b; } @@ -245,9 +252,17 @@ } & > div:nth-child(1){ - border: 0 solid #ddd; + border: 0 solid var(--comp-txt); border-bottom-width: 1px; } + + .bg-orange-200{ + --bg-opacity: 0.8; + } +} + +.reviewtxt{ + color: var(--med-txt); } .downbar{ diff --git a/src/containers/applications/apps/calculator.js b/src/containers/applications/apps/calculator.js index 4f03a3504..d563634ae 100644 --- a/src/containers/applications/apps/calculator.js +++ b/src/containers/applications/apps/calculator.js @@ -152,7 +152,7 @@ export const Calculator = ()=>{
- +
Standard
diff --git a/src/containers/applications/apps/edge.js b/src/containers/applications/apps/edge.js index cd8abfcec..3ef00be50 100644 --- a/src/containers/applications/apps/edge.js +++ b/src/containers/applications/apps/edge.js @@ -115,21 +115,22 @@ export const EdgeMenu = ()=>{
-
+
New Tab
-
- - - - +
+ + + +
{ payload={2} width={14} margin="0 10px"/>
-
+
{Object.keys(iframes).map(mark=>{ return( diff --git a/src/containers/applications/apps/explorer.js b/src/containers/applications/apps/explorer.js index a67ff59bf..25ad5c8bf 100644 --- a/src/containers/applications/apps/explorer.js +++ b/src/containers/applications/apps/explorer.js @@ -18,7 +18,7 @@ export const Explorer = ()=>{ zIndex: wnapp.z }} data-hide={wnapp.hide} id={wnapp.icon+"App"}> + name="File Explorer"/>
diff --git a/src/containers/applications/apps/notepad.js b/src/containers/applications/apps/notepad.js index 18b806c68..2746b229b 100644 --- a/src/containers/applications/apps/notepad.js +++ b/src/containers/applications/apps/notepad.js @@ -15,7 +15,7 @@ export const Notepad = ()=>{ zIndex: wnapp.z }} data-hide={wnapp.hide} id={wnapp.icon+"App"}> + name="Untitled - Notepad" noinvert/>
File
diff --git a/src/containers/applications/apps/store.js b/src/containers/applications/apps/store.js index 41aa0a25b..4f386ac8e 100644 --- a/src/containers/applications/apps/store.js +++ b/src/containers/applications/apps/store.js @@ -166,7 +166,7 @@ const DownPage = ({action, apps})=>{ 2.5?"bluestar":""} fafa="faStar" width={6}/> 3.5?"bluestar":""} fafa="faStar" width={6}/> 4.5?"bluestar":""} fafa="faStar" width={6}/> -
{reviews}k
+
{reviews}k
{"Free"}
@@ -208,7 +208,7 @@ const DetailPage = ({app})=>{ src={app.icon} err="img/asset/mixdef.jpg"/>
{app.name}
-
Community
+
Community
{dstate==0?
Get
:null} {dstate==1?
:null} @@ -257,7 +257,7 @@ const DetailPage = ({app})=>{
Ratings and reviews
-
{stars}
+
{stars}
{Math.round(reviews/100)/10}K RATINGS
@@ -332,7 +332,7 @@ const FrontPage = (props)=>{ 3?"bluestar":""} fafa="faStar" width={6}/> 4?"bluestar":""} fafa="faStar" width={6}/> -
{1+x.charCodeAt(3)%5}k
+
{1+x.charCodeAt(3)%5}k
{x.charCodeAt(4)%2?"Free":"Owned"}
@@ -361,7 +361,7 @@ const FrontPage = (props)=>{ 3?"bluestar":""} fafa="faStar" width={6}/> 4?"bluestar":""} fafa="faStar" width={6}/> -
{1+x.charCodeAt(3)%5}k
+
{1+x.charCodeAt(3)%5}k
{x.charCodeAt(4)%2?"Free":"Owned"}
@@ -390,7 +390,7 @@ const FrontPage = (props)=>{ 3?"bluestar":""} fafa="faStar" width={6}/> 4?"bluestar":""} fafa="faStar" width={6}/> -
{1+x.charCodeAt(3)%5}k
+
{1+x.charCodeAt(3)%5}k
{x.charCodeAt(4)%2?"Rent":"Owned"}
diff --git a/src/containers/applications/apps/terminal.js b/src/containers/applications/apps/terminal.js index f618c5418..0e88ca1fd 100644 --- a/src/containers/applications/apps/terminal.js +++ b/src/containers/applications/apps/terminal.js @@ -24,7 +24,7 @@ export const WnTerminal = ()=>{ if(pwd!="C:\\"){ for (var i = 0; i < curr.length; i++) { - console.log(tdir); + // console.log(tdir); tdir = tdir[curr[i]]; } } diff --git a/src/containers/applications/apps/whiteboard.js b/src/containers/applications/apps/whiteboard.js index 3206fb8ff..340229634 100644 --- a/src/containers/applications/apps/whiteboard.js +++ b/src/containers/applications/apps/whiteboard.js @@ -49,7 +49,7 @@ export const WhiteBoard = ()=>{ zIndex: wnapp.z }} data-hide={wnapp.hide} id={wnapp.icon+"App"}> + name="Whiteboard" bg="#f9f9f9" noinvert/>
diff --git a/src/containers/applications/index.js b/src/containers/applications/index.js index bd442df2d..e37e447b3 100644 --- a/src/containers/applications/index.js +++ b/src/containers/applications/index.js @@ -3,7 +3,7 @@ import {useSelector, useDispatch} from 'react-redux'; import './tabs.scss'; import './tabs2.scss'; -import './wnapp.css'; +import './wnapp.scss'; export * from './apps/whiteboard'; export * from './apps/edge'; diff --git a/src/containers/applications/tabs.scss b/src/containers/applications/tabs.scss index cef855b05..9511f5e80 100644 --- a/src/containers/applications/tabs.scss +++ b/src/containers/applications/tabs.scss @@ -116,8 +116,10 @@ width: 176px; height: 100%; margin: 0 4px; + background: var(--bg1); + color: var(--txt-col); border-radius: 4px 4px 0 0; - box-shadow: 2px 0 2px rgba(80, 80, 80, 0.2); + box-shadow: 2px 0 2px var(--shd); display: flex; justify-content: space-between; align-items: center; @@ -125,7 +127,7 @@ font-size: 0.72em; .uicon { - color: #505050; + color: var(--gray-txt); } } } @@ -138,14 +140,31 @@ scroll-behavior: smooth; } +.addressBar{ + background: var(--bg1); + + .uicon{ + color: var(--med-txt); + } +} + .addCont { width: 80%; input { box-sizing: border-box; + background: var(--ipbar); + color: var(--txt-col); + border-radius: 4px; + border: solid 1px var(--comp-txt); } } +.bookbar{ + background: var(--bg1); + color: var(--txt-col); +} + .cmdcont{ height: calc(100% - 24px); } diff --git a/src/containers/applications/tabs2.scss b/src/containers/applications/tabs2.scss index 79748c27e..609d6d7ad 100644 --- a/src/containers/applications/tabs2.scss +++ b/src/containers/applications/tabs2.scss @@ -8,15 +8,28 @@ } .aboutApp { + --bg1: #eee; + --bg2: #f9f9f9; + top: 12%; left: 30%; width: auto; height: auto; border-radius: 4px; - background: #eee; + color: var(--dark-txt); + background: var(--bg1); z-index: 0; } +body[data-theme="dark"] .aboutApp { + --bg1: #1f2232; + --bg2: #16161f; +} + +.aboutTop { + background: var(--bg2); +} + rediv { color: #eb4141; font-weight: 700; @@ -56,27 +69,26 @@ rediv { display: flex; flex-direction: column; align-items: flex-end; - // justify-content: flex-end; padding: 0 32px; - color: #333; + color: var(--dark-txt); } .eqCont { font-size: 0.22em; - color: #888; + color: var(--sat-txt); } .msrVal { display: flex; padding: 16px 0; font-size: 0.64em; - color: #888; + color: var(--sat-txt); div { margin: 0 24px; &:nth-child(n + 3) { - color: #111; + color: var(--txt-col); font-weight: 600; } } @@ -95,16 +107,19 @@ rediv { &[data-err="true"] { .oper { - color: #aaa; - pointer-events: none; - - &:nth-child(3) { - pointer-events: auto; - color: #444; - } - - &:last-child { - color: #ccc; + &:nth-child(1), + &:nth-child(5), + &:nth-child(6), + &:nth-child(7), + &:nth-child(8), + &:nth-child(12), + &:nth-child(16), + &:nth-child(20), + &:nth-child(21), + &:nth-child(23) { + background: var(--err-bg); + color: var(--err-txt); + pointer-events: none; } } } @@ -116,7 +131,8 @@ rediv { align-items: center; box-sizing: border-box; border: solid 1px rgb(0, 0, 0, 0.1); - background: #f9f9f9; + background: var(--bg2); + color: var(--dark-txt); font-size: 1.128em; cursor: pointer; border-radius: 4px; @@ -125,26 +141,27 @@ rediv { pointer-events: none; } - &:active { - background: rgba(255, 255, 255, 0.5); + &:hover { + background: var(--bg3); } &:nth-child(-n + 8), &:nth-child(4n) { - background: rgba(255, 255, 255, 0.5); - color: #444; + background: var(--bg3); + color: var(--dark-txt); - &:active { - background: rgba(255, 255, 255, 0.2); + &:hover { + background: var(--bg2); } } &:last-child { - background: #0067c0; - color: white; + background: var(--clrPrm); + color: var(--bg1); &:hover { - background: #1975c5; + background: var(--clrPrm); + filter: brightness(0.9); } } @@ -154,7 +171,7 @@ rediv { &:nth-child(4) { font-size: 1em; - color: #333; + color: var(--dark-txt); } &:nth-child(8) { @@ -256,7 +273,7 @@ rediv { .abCont { font-size: 12px; width: 24rem; - color: #222; + color: var(--txt-col); font-weight: 500; mark { @@ -266,7 +283,7 @@ rediv { } a { - color: #0068ff; + color: var(--clrPrm); text-decoration: underline; font-weight: 500; } @@ -279,15 +296,16 @@ rediv { align-items: flex-end; div { - border: solid 1px #007efb; + border: solid 1px var(--clrPrm); padding: 2px 24px; border-radius: 4px; cursor: pointer; + background: var(--bg2); &[data-allow="false"] { - color: #888; + color: var(--sat-txt); cursor: not-allowed; - background: #ddd; + background: var(--comp-txt); } } } @@ -428,8 +446,6 @@ rediv { flex-grow: 1; height: 100%; overflow: hidden; - // border: solid 4px red; - // box-sizing: border-box; } .vidwrap { diff --git a/src/containers/applications/wnapp.css b/src/containers/applications/wnapp.css deleted file mode 100644 index 2aee76158..000000000 --- a/src/containers/applications/wnapp.css +++ /dev/null @@ -1,61 +0,0 @@ -/* - www.OnlineWebFonts.Com -*/ -@font-face { - font-family: "Spotify"; - src: url("https://db.onlinewebfonts.com/t/1ccdd11fd9d1d81756c40d7acb17d0aa.eot"); /* IE9*/ - src: url("https://db.onlinewebfonts.com/t/1ccdd11fd9d1d81756c40d7acb17d0aa.eot?#iefix") format("embedded-opentype"), /* IE6-IE8 */ url("https://db.onlinewebfonts.com/t/1ccdd11fd9d1d81756c40d7acb17d0aa.woff2") format("woff2"), /* chrome firefox */ url("https://db.onlinewebfonts.com/t/1ccdd11fd9d1d81756c40d7acb17d0aa.woff") format("woff"), /* chrome firefox */ url("https://db.onlinewebfonts.com/t/1ccdd11fd9d1d81756c40d7acb17d0aa.ttf") format("truetype"), /* chrome firefox opera Safari, Android, iOS 4.2+*/ url("https://db.onlinewebfonts.com/t/1ccdd11fd9d1d81756c40d7acb17d0aa.svg#Spotify") format("svg"); /* iOS 4.1- */ -} - -.edgeBrowser { - background: rgb(231, 234, 236); -} - -.vscodeWn { - background: rgb(37, 37, 38); -} - -.wnstore { - background: #f3f3f3; -} - -.wnterm { - background: rgb(16, 16, 16); -} - -.notepad { - background: #fefefe; -} - -.calcApp { - background: hsla(0, 0%, 100%, 0.9); - -webkit-backdrop-filter: blur(21px); - backdrop-filter: blur(21px); -} - -.msfiles, -.whiteBoard { - background: #fefefe; -} - -.spotify { - background: rgb(24, 24, 24); - /* background: linear-gradient(0deg, #1d1d1f 75%, #1e1e1f 100%); */ - /* background: linear-gradient(0deg, #1d1d1f 75%, #2d2d2d 100%); */ -} - -.discordWn { - background: #36393f; -} - -.lightWindow { - background: rgb(231, 234, 236); -} - -.darkWindow { - background: rgb(25, 22, 20); -} - -.wnCam { - background: #060606; -} diff --git a/src/containers/applications/wnapp.scss b/src/containers/applications/wnapp.scss new file mode 100644 index 000000000..f7c7390e0 --- /dev/null +++ b/src/containers/applications/wnapp.scss @@ -0,0 +1,131 @@ +/* + www.OnlineWebFonts.Com +*/ +@font-face { + font-family: "Spotify"; + src: url("./apps/assets/spotify.woff2") format("woff2"), url("./apps/assets/spotify.ttf") format("truetype"); +} + +body { + --dark-txt: #000; + --txt-col: #222; + --med-txt: #3c3c3c; + --comp-txt: #ddd; + --gray-txt: #555; + --sat-txt: #777; + --clrPrm: #0067c0; +} + +body[data-theme="dark"] { + --dark-txt: #fff; + --txt-col: #ddd; + --med-txt: #c3c3c3; + --comp-txt: #222; + --gray-txt: #aaa; + --sat-txt: #999; + --clrPrm: #4cc2ff; +} + +.edgeBrowser { + --bg0: #e7eaec; + --bg1: #f7fafc; + --ipbar: #fefefe; + --shd: rgba(80, 80, 80, 0.2); + background: var(--bg0); +} + +body[data-theme="dark"] .edgeBrowser { + --bg0: #222228; + --ipbar: #222228; + --bg1: rgb(45, 45, 51); + --shd: rgba(0, 0, 0, 0.3); + + .edgenavicon{ + filter: invert(1); + } +} + +.vscodeWn { + background: rgb(37, 37, 38); +} + +.wnstore { + --bg-color: #f3f3f3; + --nav-btn-hov: #ffffff; + --nav-blue: #2570ff; + --page-bg: #f4f4f4; + --page-bd-col: #e2e2e2; + --rib-bg: #ffffffb8; + --rib2-bg: #fdfdfd; + --det-bg: #f9f9f9; + background: var(--bg-color); +} + +body[data-theme="dark"] .wnstore { + --bg-color: #1c2126; + --nav-btn-hov: #454545; + --nav-blue: #4cc2ff; + --page-bg: #24292c; + --page-bd-col: #292828; + --rib-bg: #2f2e30b8; + --rib2-bg: #2c2f32; + --det-bg: #282c32; + background: var(--bg-color); +} + +.wnterm { + background: rgb(16, 16, 16); +} + +.notepad { + background: #fefefe; +} + +.calcApp { + --bg1: rgba(243, 243, 243, 0.9); + --bg2: #ffffff; + --bg3: #f9f9f9; + --err-bg: rgb(255, 255, 255, 0.1); + --err-txt: #999; + background: var(--bg1); + color: var(--dark-txt); + -webkit-backdrop-filter: blur(21px); + backdrop-filter: blur(21px); +} + +body[data-theme="dark"] .calcApp { + --bg1: rgba(32, 32, 32, 0.9); + --bg2: rgba(255, 255, 255, 0.12); + --bg3: rgba(255, 255, 255, 0.08); + --err-bg: rgba(255, 255, 255, 0.033); + --err-txt: #777; + + .menuBars { + filter: invert(1); + } +} + +.msfiles, +.whiteBoard { + background: var(--comp-txt); +} + +.spotify { + background: rgb(24, 24, 24); +} + +.discordWn { + background: #36393f; +} + +.lightWindow { + background: #e7eaec; +} + +.darkWindow { + background: #1a1614; +} + +.wnCam { + background: #060606; +} diff --git a/src/containers/background/back.scss b/src/containers/background/back.scss index 050bc8d46..e447f58d2 100644 --- a/src/containers/background/back.scss +++ b/src/containers/background/back.scss @@ -25,20 +25,17 @@ place-items: center; } /* Loader css */ - #loader { position: relative; top: 0; left: 0; - /* height: 100%; */ - /* width: 100%; */ display: grid; text-align: center; align-items: center; justify-content: center; } -.circledots { +#dotcont { position: relative; top: 0; left: 0; @@ -47,7 +44,7 @@ height: 50px; } -.circledots .circle { +#dotcont .circle { position: absolute; width: 40px; height: 40px; @@ -59,7 +56,7 @@ animation-duration: 5.5s; } -.circledots .circle:after { +#dotcont .circle:after { content: ''; position: absolute; width: 4px; @@ -69,19 +66,19 @@ background: #aaa; } -.circledots .circle:nth-child(2) { +#dotcont .circle:nth-child(2) { animation-delay: 240ms; } -.circledots .circle:nth-child(3) { +#dotcont .circle:nth-child(3) { animation-delay: 480ms; } -.circledots .circle:nth-child(4) { +#dotcont .circle:nth-child(4) { animation-delay: 720ms; } -.circledots .circle:nth-child(5) { +#dotcont .circle:nth-child(5) { animation-delay: 960ms; } @keyframes orbit { @@ -142,7 +139,7 @@ align-items: center; transition: all 1s ease-in-out; - &[data-unlock="true"]{ + &[data-unlock="true"] { opacity: 0; } @@ -203,7 +200,7 @@ transform: translateY(0px); } - &[data-unlock="true"]{ + &[data-unlock="true"] { opacity: 0; } @@ -223,21 +220,21 @@ } } -.lockOpt{ +.lockOpt { margin-top: 10px; - .uicon{ + .uicon { margin: 0 4px; cursor: pointer; - &[data-payload="true"]{ + &[data-payload="true"] { box-sizing: border-box; border: 1px solid #888; } } } -.slowfadein{ +.slowfadein { opacity: 1; animation: slowfadein 1s ease-in-out; } diff --git a/src/containers/background/index.js b/src/containers/background/index.js index eef545a05..2b28e75c1 100644 --- a/src/containers/background/index.js +++ b/src/containers/background/index.js @@ -56,7 +56,7 @@ export const BootScreen = (props) => {
-
+
diff --git a/src/index.css b/src/index.css index 11899f395..becaf5dc2 100644 --- a/src/index.css +++ b/src/index.css @@ -257,7 +257,7 @@ input { } .hvlight:hover { - background: rgba(255, 255, 255, 0.88); + background: rgba(255, 255, 255, 0.8); transition: all 200ms ease-in-out; } @@ -266,6 +266,10 @@ input { transition: all 200ms ease-in-out; } +body[data-theme="dark"] .hvlight:hover { + background: rgba(255, 255, 255, 0.1); +} + a { text-decoration: none; color: #0080e1; diff --git a/src/reducers/index.js b/src/reducers/index.js index 0883b0b7e..1455b1bee 100644 --- a/src/reducers/index.js +++ b/src/reducers/index.js @@ -10,6 +10,7 @@ import widReducer from './widpane'; import appReducer from './apps'; import menusReducer from './menu'; import globalReducer from './globals'; +import settReducer from './settings'; const allReducers = combineReducers({ wallpaper: wallReducer, @@ -21,6 +22,7 @@ const allReducers = combineReducers({ apps: appReducer, menus: menusReducer, globals: globalReducer, + setting: settReducer }); var store = createStore( diff --git a/src/reducers/menu.js b/src/reducers/menu.js index 022862762..f3cfa443d 100644 --- a/src/reducers/menu.js +++ b/src/reducers/menu.js @@ -1,7 +1,7 @@ const defState = { hide: true, - top: 272, - left: 430, + top: 80, + left: 360, opts: "desk", attr: null, dataset: null, @@ -9,7 +9,8 @@ const defState = { desk: [ { name: "View", - icon: "ui/view", + icon: "view", + type: "svg", opts: [ { name: "Large icons", @@ -39,7 +40,8 @@ const defState = { }, { name: "Sort by", - icon: "ui/sort", + icon: "sort", + type: "svg", opts: [ { name: "Name", @@ -60,16 +62,17 @@ const defState = { }, { name: "Refresh", - icon: "ui/refresh", action: "refresh", + type: "svg", + icon: "refresh", }, { type: "hr", }, { name: "New", - icon: "ui/new", - // dsb: true, + icon: "New", + type: "svg", opts: [ { name: "Folder", @@ -90,12 +93,13 @@ const defState = { }, { name: "Display settings", - icon: "ui/display", + icon: "display", + type: "svg", }, { name: "Personalize", - icon: "ui/personalize", - // dsb: true, + icon: "personalize", + type: "svg", }, { type: "hr", @@ -116,13 +120,6 @@ const defState = { icon: "win/info", payload: true, }, - { - type: "hr", - }, - { - name: "Show more options", - icon: "ui/more", - }, ], task: [ { diff --git a/src/reducers/settings.js b/src/reducers/settings.js new file mode 100644 index 000000000..f1818424d --- /dev/null +++ b/src/reducers/settings.js @@ -0,0 +1,81 @@ +import { + desktopApps +} from '../utils'; + +const defState = { + system: { + power: { + saver: { + state: false + } + }, + display: { + brightness: 100, + nightlight: { + state: false + }, + connect: false + } + }, + person: { + theme: "light", + color: "blue" + }, + devices: { + bluetooth: false + }, + network: { + wifi: { + state: true + }, + airplane: false + }, + privacy: { + location: { + state: false + } + } +} + +document.body.dataset.theme = defState.person.theme + +const changeVal = (obj, path, val="togg")=>{ + var tmp = obj + path = path.split(".") + for (var i = 0; i < path.length - 1; i++) { + tmp = tmp[path[i]] + } + + if(val=="togg"){ + tmp[path[path.length-1]] = !tmp[path[path.length-1]] + }else{ + tmp[path[path.length-1]] = val + } + + return obj +} + +const settReducer = (state = defState, action) => { + var tmpState = {...state}, changed = false + switch (action.type) { + case 'STNGTHEME': + changed = true + tmpState.person.theme = action.payload + break + case 'STNGTOGG': + changed = true + tmpState = changeVal(tmpState, action.payload) + break + case 'STNGSETV': + changed = true + tmpState = changeVal(tmpState,action.payload.path,action.payload.value) + break + case 'SETTLOAD': + tmpState = {... action.payload} + } + + if(changed) localStorage.setItem("setting", JSON.stringify(tmpState)) + return tmpState; +} + +export default settReducer; diff --git a/src/reducers/sidepane.js b/src/reducers/sidepane.js index ef738635e..8151122eb 100644 --- a/src/reducers/sidepane.js +++ b/src/reducers/sidepane.js @@ -1,68 +1,66 @@ const defState = { - quicks: [ - { + quicks: [{ ui: true, src: "wifi", name: "WiFi", - state: true, - }, - { + state: "network.wifi.state", + action: "STNGTOGG" + },{ ui: true, src: "bluetooth", name: "Bluetooth", - state: false, - }, - { + state: "devices.bluetooth", + action: "STNGTOGG" + },{ ui: true, src: "airplane", name: "Airplane Mode", - state: false, - }, - { + state: "network.airplane", + action: "STNGTOGG" + },{ ui: true, src: "saver", name: "Battery Saver", - state: false, - }, - { + state: "system.power.saver.state", + action: "STNGTOGG" + },{ ui: true, - src: "moon", - name: "Focus assist", - state: false, - }, - { + src: "sun", + name: "Theme", + state: "person.theme", + action: "changeTheme" + },{ ui: true, src: "location", name: "Location", - state: false, - }, - { + state: "privacy.location.state", + action: "STNGTOGG" + },{ ui: true, src: "nightlight", name: "Night Light", - state: false, - }, - { + state: "system.display.nightlight.state", + action: "STNGTOGG" + },{ ui: true, src: "connect", name: "Connect", - state: false, - }, - { + state: "system.display.connect", + action: "STNGTOGG" + },{ ui: true, src: "project", - name: "Project", - state: false, - }, + name: "Project" + } ], hide: true, calhide: true, }; const paneReducer = (state = defState, action) => { - if (action.type == "PANEQBTN") { + if (action.type == "PANETHEM") { var tmpState = { ...state }; - tmpState.quicks[action.payload].state = !tmpState.quicks[action.payload].state; + tmpState.quicks[4].src = action.payload; return tmpState; } else if (action.type == "PANETOGG") { return { ...state, hide: !state.hide }; diff --git a/src/reducers/wallpaper.js b/src/reducers/wallpaper.js index 53f00f8c7..54dfd4083 100644 --- a/src/reducers/wallpaper.js +++ b/src/reducers/wallpaper.js @@ -25,8 +25,8 @@ const walls = [ const defState = { wps: wps, src: walls[wps], - locked: !(locked=='false'), - booted: false || process.env.REACT_APP_ENV=="development", + locked: !(locked == 'false'), + booted: false || process.env.REACT_APP_ENV == "development", act: '', dir: 0 } @@ -63,6 +63,11 @@ const wallReducer = (state = defState, action) => { ...state, booted: false, dir: -1, locked: true, act: 'shutdn' }; + case 'WALLSET': + return { + ...state, wps: action.payload, + src: walls[action.payload] + }; default: return state } diff --git a/src/utils/general.js b/src/utils/general.js index 595fbf55a..aba77dedb 100644 --- a/src/utils/general.js +++ b/src/utils/general.js @@ -218,7 +218,7 @@ export const ToolBar = (props)=>{ return (
+ }} data-float={props.float!=null} data-noinvert={props.noinvert!=null}>
diff --git a/src/utils/general.scss b/src/utils/general.scss index 3814b84ab..73fdeb16e 100644 --- a/src/utils/general.scss +++ b/src/utils/general.scss @@ -5,6 +5,7 @@ justify-content: space-between; align-items: center; position: relative; + // background: inherit; &[data-float="false"]{ z-index: 10; @@ -199,3 +200,28 @@ .imageCont.rounded{ overflow: hidden; } + +body[data-theme="dark"] .toolbar[data-noinvert="false"]{ + + .snapcont{ + background: #222; + + .snapper{ + background: #444; + border: solid 1px #333; + &:hover{ + background: #0066ff; + } + } + } + + .appFullName{ + color: #fefefe; + } + + .actbtns{ + .uicon img{ + filter: invert(1); + } + } +} diff --git a/src/utils/icons.js b/src/utils/icons.js index e4d329e76..67303f9c5 100644 --- a/src/utils/icons.js +++ b/src/utils/icons.js @@ -1,127 +1,227 @@ -'use babel'; -import React from 'react' +"use babel"; +import React from "react"; export const home = (props) => { return ( - - - - ) -} + + + + ); +}; export const shuffle = (props) => { return ( - + - ) -} + ); +}; export const previous = (props) => { return ( - + - ) -} + ); +}; export const next = (props) => { return ( - + - ) -} + ); +}; export const repeat = (props) => { return ( - + - ) -} + ); +}; export const play = (props) => { return ( - + - ) -} + ); +}; export const pause = (props) => { return ( - + - ) -} + ); +}; export const search = (props) => { return ( - - ) -} + + ); +}; -export const camera = (props)=>{ - return ( - +export const camera = (props) => { + return ( + - ) -} + ); +}; + +export const view = (props) => { + return ( + + + + ); +}; +export const sort = (props) => { + return ( + + + + + ); +}; +export const refresh = (props) => { + return ( + + + + ); +}; +export const New = (props) => { + return ( + + + + + ); +}; +export const display = (props) => { + return ( + + + + + ); +}; +export const personalize = (props) => { + return ( + + + + + ); +}; +export const terminal = (props) => { + return ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ); +}; +export const info = (props) => { + return ( + + + + + ); +}; diff --git a/src/utils/index.js b/src/utils/index.js index 91fcb3c6b..a6a90dbc2 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -33,7 +33,7 @@ export const pinnedApps = icons.filter(x => pinned.includes(x.name)).sort((a, b) export const recentApps = icons.filter(x => recent.includes(x.name)).sort((a, b) => { return recent.indexOf(a.name) > recent.indexOf(b.name) ? 1 : -1; -});; +}); export const allApps = icons.filter(app => { return app.type == 'app'