diff --git a/LICENSE.md b/LICENSE.md index 9ab5364..16fc79d 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -2,7 +2,7 @@ * css/UbuntuRegular.ttf licensed by [Ubuntu Font License](./LICENSE_UFL.txt). -* icons/Suru licensed by [Creative Commons Attribution-ShareAlike 4.0 License](./LICENSE_CCBYSA.txt). (Read icons/Suru/README.md and cons/Suru/CONTRIBUTING.md to learn about)(Forked from https://github.com/ubuntu/yaru) +* icons/Suru and assets licensed by [Creative Commons Attribution-ShareAlike 4.0 License](./LICENSE_CCBYSA.txt). (Read icons/Suru/README.md and cons/Suru/CONTRIBUTING.md to learn about)(Forked from https://github.com/ubuntu/yaru) * icons/unsplash licensed by [Unsplash License](./LICENSE_UNSPLASH.txt). (Read icons/unsplash/Attribution.html to learn about) diff --git a/apps/terminal/js/main.js b/apps/terminal/js/main.js index 737e80e..694718e 100644 --- a/apps/terminal/js/main.js +++ b/apps/terminal/js/main.js @@ -93,9 +93,9 @@ function runBashCommand(__command){ if(__command.length==1 || __command[1]=="--help"){ writeOutput("Usage: wine PROGRAM [ARGUMENTS...] Run the specified program\n wine --help Display this help and exit\n wine --version Output version information and exit"); } else if(__command[1]=="--version"){ - writeOutput("wine-6.21") + writeOutput("wine-7.0-rc5") } else { - writeOutput("Uygulama başlatılamadı veya belirtilen dosya ile ilişkili bir uygulama yok.") + writeOutput("The application could not be started or there is no application associated with the specified file.") } }else if(__the_command=="sh"||__the_command=="bash"){ writeOutput(__console_info); diff --git a/assets/144.png b/assets/144.png new file mode 100644 index 0000000..eebb48b Binary files /dev/null and b/assets/144.png differ diff --git a/assets/192.png b/assets/192.png new file mode 100644 index 0000000..1834ad0 Binary files /dev/null and b/assets/192.png differ diff --git a/assets/512.png b/assets/512.png new file mode 100644 index 0000000..9ac51a0 Binary files /dev/null and b/assets/512.png differ diff --git a/assets/Vector.svg b/assets/Vector.svg new file mode 100644 index 0000000..b9115ca --- /dev/null +++ b/assets/Vector.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/css/login.css b/css/login.css new file mode 100644 index 0000000..0513ee8 --- /dev/null +++ b/css/login.css @@ -0,0 +1,55 @@ +*:not(body,html){ + visibility:hidden !important; +} + +.panel-notification, .panel-status, .panel-status > *, .login-user, .login-user > *, .login-ubuntu{ + visibility: visible !important; +} + +.panel-notification, .panel-status{ + pointer-events: none; +} + +.login-user, .login-ubuntu{ + display: unset !important; +} + +.login-user{ + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%,-50%); + margin: 0; + background: #66666666; + border-radius: 5px; + width: 260px; + height: 65px; + color: #ffffff; +} + +.login-user > img { + position: relative; + top: 8.5px; + left: 8.5px; + width: 48px; + height: 48px; + filter: brightness(2); + border-radius: 50%; + background: #33333333; +} + +.login-user > div{ + position: relative; + bottom: 29px; + left: 65px; + font-size: 18px; +} + +.login-ubuntu{ + position: fixed; + bottom: 20px; + font-size: 45px; + color: #ffffff; + left: 50%; + transform: translate(-50%,0); +} \ No newline at end of file diff --git a/css/panel.css b/css/panel.css index be0b6d6..19681e3 100644 --- a/css/panel.css +++ b/css/panel.css @@ -94,6 +94,11 @@ transition-duration: 0.2s; } +.panel-status-no-wifi{ + grid-template-columns: 0px auto auto !important; + width: 55px !important; +} + .panel-status-icon{ height: 16px; filter: brightness(2); diff --git a/index.html b/index.html index 1cd1f29..e243261 100644 --- a/index.html +++ b/index.html @@ -3,8 +3,9 @@ Ubuntu - + + @@ -26,6 +27,17 @@ + + + + + + + + + + + @@ -37,8 +49,8 @@
- - + +
@@ -85,6 +97,11 @@
Text
+ +
\ No newline at end of file diff --git a/js/login.js b/js/login.js new file mode 100644 index 0000000..d82f399 --- /dev/null +++ b/js/login.js @@ -0,0 +1,7 @@ +loginSession=()=>{ + document.querySelector("link#login-css").remove(); +} + +lockSession=()=>{ + document.head.insertAdjacentHTML("beforeend",''); +} \ No newline at end of file diff --git a/js/panel.js b/js/panel.js index 9eb950e..d17d411 100644 --- a/js/panel.js +++ b/js/panel.js @@ -1,4 +1,5 @@ monthShortNames=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]; + if(navigator.getBattery!=undefined){ batteryIcon=document.querySelector("#battery"); (async ()=>{ @@ -7,23 +8,53 @@ if(navigator.getBattery!=undefined){ updateBatteryIcon=()=>{ if(deviceBattery.charging){ batteryIcon.src="icons/Suru/Suru/scalable/status/battery-level-"+(Math.round(deviceBattery.level*10)*10)+"-charging-symbolic.svg"; + document.querySelector(".status-about").contentDocument.querySelector("#battery").src="icons/Suru/Suru/scalable/status/battery-level-"+(Math.round(deviceBattery.level*10)*10)+"-charging-symbolic.svg"; + if(deviceBattery.level==1){ + document.querySelector(".status-about").contentDocument.querySelector("#battery-info").innerText="Full"; + } else { + if(deviceBattery.chargingTime!=Infinity){ + document.querySelector(".status-about").contentDocument.querySelector("#battery-info").innerText=Math.floor(((1-deviceBattery.level)*100*60*3) / 3600)+":"+Math.floor(((1-deviceBattery.level)*100*60*3) % 3600 / 60)+" Until Full ("+(deviceBattery.level*100)+" %)"; + } + } } else { batteryIcon.src="icons/Suru/Suru/scalable/status/battery-level-"+(Math.round(deviceBattery.level*10)*10)+"-symbolic.svg"; + document.querySelector(".status-about").contentDocument.querySelector("#battery").src="icons/Suru/Suru/scalable/status/battery-level-"+(Math.round(deviceBattery.level*10)*10)+"-symbolic.svg"; + if(deviceBattery.dischargingTime!=Infinity){ + document.querySelector(".status-about").contentDocument.querySelector("#battery-info").innerText=Math.floor(deviceBattery.dischargingTime / 3600)+":"+Math.floor(deviceBattery.dischargingTime % 3600 / 60)+" Remaining ("+(deviceBattery.level*100)+" %)"; + } else { + document.querySelector(".status-about").contentDocument.querySelector("#battery-info").innerText=Math.floor((deviceBattery.level*100*60*3) / 3600)+":"+Math.floor((deviceBattery.level*100*60*3) % 3600 / 60)+" Remaining ("+(deviceBattery.level*100)+" %)"; + } } } - updateBatteryIcon(); deviceBattery.addEventListener("chargingchange",updateBatteryIcon); deviceBattery.addEventListener("levelchange",updateBatteryIcon); })(); } -function UpdatePanelTime(){ +wifiIcon=document.querySelector("#wifi"); +wifiOfflineSVG="data:image/svg+xml,%3Csvg viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cg transform='translate(-1073 267)'%3E%3Cpath d='M1081.003-265c-2.61 0-5.22.838-7.4 2.518l-.266.205.205.263 7.457 9.672 7.668-9.931-.264-.206a12.105 12.105 0 0 0-7.4-2.521zm0 1c2.181 0 4.344.672 6.227 1.951l-6.229 8.07-6.226-8.074c1.883-1.278 4.047-1.948 6.228-1.947z' fill='gray' font-family='sans-serif' font-weight='400' opacity='.5' overflow='visible' style='font-feature-settings:normal;font-variant-alternates:normal;font-variant-caps:normal;font-variant-ligatures:none;font-variant-numeric:normal;font-variant-position:normal;isolation:auto;mix-blend-mode:normal;shape-padding:0;text-decoration-color:%23000;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-transform:none' white-space='normal'/%3E%3C/g%3E%3C/svg%3E"; // from Suru icons, licensed by (CC-BY-SA 4.0). Learn more about license from LICENSE.md + +window.addEventListener("offline",()=>{ + wifiIcon.src="data:image/svg+xml,%3Csvg viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3C/svg%3E"; + document.querySelector(".status-about").contentDocument.querySelector("#wifi").src=wifiOfflineSVG; + document.querySelector(".status-about").contentDocument.querySelector("#wifi-info").innerText="Wi-Fi Not Connected"; + document.querySelector(".panel-status").className+=" panel-status-no-wifi"; +}); + +window.addEventListener("online",()=>{ + wifiIcon.src="icons/Suru/Suru/scalable/status/network-wireless-connected-symbolic.svg"; + document.querySelector(".status-about").contentDocument.querySelector("#wifi").src="icons/Suru/Suru/scalable/status/network-wireless-connected-symbolic.svg"; + document.querySelector(".status-about").contentDocument.querySelector("#wifi-info").innerText="Wi-Fi"; + document.querySelector(".panel-status").className=document.querySelector(".panel-status").className.replace(" panel-status-no-wifi",""); +}); + +function UpdatePanel(){ now = new Date(); document.getElementsByClassName("panel-notification")[0].innerHTML=now.getDate()+" "+(monthShortNames[now.getMonth()])+ " " + now.toString().match("..:..")[0]; } -setInterval(UpdatePanelTime,1000) +setInterval(UpdatePanel,1000) function changePanelActiveAppIcon(icon,name,brightness=1){ if(name==""){ diff --git a/js/pwa.js b/js/pwa.js new file mode 100644 index 0000000..15d7e1a --- /dev/null +++ b/js/pwa.js @@ -0,0 +1,13 @@ +if ('serviceWorker' in navigator) { + window.addEventListener('load', function () { + navigator.serviceWorker.register('service-worker.js').then(function (registration) { + console.log('Registered!'); + }, function (err) { + console.log('ServiceWorker registration failed: ', err); + }).catch(function (err) { + console.log(err); + }); + }); +} else { + console.log('service worker is not supported'); +} diff --git a/js/status.js b/js/status.js index f9331b1..602802a 100644 --- a/js/status.js +++ b/js/status.js @@ -1,5 +1,18 @@ function changeBrightness(){ - parent.document.getElementById("brightness").style.opacity=1-document.getElementById("brightness-change").value/100; + parent.document.getElementById("brightness").style.opacity=1-window.event.target.value/100; +} + +function changeVolume(){ + let _volume=window.event.target.value; + if(_volume==0){ + parent.document.querySelector("#sound").src="icons/Suru/Suru/scalable/status/audio-volume-muted-symbolic.svg" + } else if(_volume<26){ + parent.document.querySelector("#sound").src="icons/Suru/Suru/scalable/status/audio-volume-low-symbolic.svg" + } else if(_volume<76){ + parent.document.querySelector("#sound").src="icons/Suru/Suru/scalable/status/audio-volume-medium-symbolic.svg" + } else { + parent.document.querySelector("#sound").src="icons/Suru/Suru/scalable/status/audio-volume-high-symbolic.svg" + } } function openSettings(){ @@ -9,4 +22,9 @@ function openSettings(){ openShutdown = ()=>{ parent.showDialog("Shutdown Computer","Do you want to shutdown your computer?","Cancel","Shutdown","","location.href='https://github.com/malisipi/ubuntu-tour'") +} + +lockSession=()=>{ + parent.showStatusAbout(); + parent.lockSession(); } \ No newline at end of file diff --git a/manifest.webmanifest b/manifest.webmanifest new file mode 100644 index 0000000..1d24ba6 --- /dev/null +++ b/manifest.webmanifest @@ -0,0 +1,29 @@ +{ + "short_name": "Ubuntu", + "name": "Ubuntu", + "icons": [ + { + "src": "/assets/Vector.svg", + "type": "image/svg+xml", + "sizes": "512x512" + }, + { + "src": "/assets/192.png", + "type": "image/png", + "sizes": "192x192" + }, + { + "src": "/assets/512.png", + "type": "image/png", + "sizes": "512x512" + } + ], + "start_url": "/?pwa=true", + "background_color": "#550055", + "display": "fullscreen", + "scope": "/", + "theme_color": "#550055", + "shortcuts": [], + "description": "Ubuntu", + "screenshots": [] +} diff --git a/service-worker.js b/service-worker.js new file mode 100644 index 0000000..d4c4d62 --- /dev/null +++ b/service-worker.js @@ -0,0 +1,3 @@ +self.addEventListener('install', function(e) {}); +self.addEventListener("activate", event => {}); +self.addEventListener('fetch', function (event){}); \ No newline at end of file diff --git a/status.html b/status.html index 05e5dcb..d26296f 100644 --- a/status.html +++ b/status.html @@ -7,15 +7,16 @@ - +
-
Wifi
+
Wi-Fi
Bluetooth is off
-
Full
+
Full
Settings
-
Lock
+
Lock
Shutdown
+ \ No newline at end of file