From 98f25cbedbb1c777c077e3dc6afd04a71f203d7e Mon Sep 17 00:00:00 2001 From: Mehmet Ali <87281783+malisipi@users.noreply.github.com> Date: Sat, 13 Nov 2021 23:13:38 +0300 Subject: [PATCH] Updates * Support to dialog and notification * Fix window resize bug * Location api for weather and maps * App demo mode (Read README.md to learn more) * Update style of interface * New terminal commands (uname, notify-send, wine) and support to start apps from terminal * New app (VSCode) * Fix context menu bug --- LICENSE.md | 2 + README.md | 16 ++- apps/filemanager/js/app.js | 10 +- apps/filemanager/js/folderview.js | 2 +- apps/filemanager/other_locations.html | 2 +- apps/filemanager/trash.html | 4 +- apps/help/js/app.js | 6 +- apps/imageviewer/js/app.js | 4 +- apps/libreoffice/calc/index.html | 2 +- apps/libreoffice/writer/index.html | 2 +- apps/maps/js/app.js | 10 +- apps/maps/map.html | 4 +- apps/settings/about.html | 6 +- apps/settings/js/app.js | 4 +- apps/settings/js/background.js | 2 +- apps/settings/js/side.js | 8 +- apps/terminal/js/app.js | 6 +- apps/terminal/js/main.js | 25 +++- apps/weather/app.html | 6 +- apps/weather/js/app.js | 6 +- apps/webbrowser/js/app.js | 6 +- apps/wine/notepad.html | 2 +- contextmenu.html | 6 +- css/activities.css | 6 +- css/app-menu.css | 6 +- css/dialog.css | 76 ++++++++++ css/dock.css | 4 +- css/main.css | 1 - css/notify.css | 36 +++++ css/panel.css | 4 + index.html | 39 +++--- js/app-manager.js | 164 ++++++++++++++++++++++ js/dialogs.js | 12 ++ js/localStorage.js | 28 +++- js/notify.js | 9 ++ js/status.js | 6 +- js/window.js | 192 ++++++++------------------ main.js | 6 +- status.html | 2 +- 39 files changed, 515 insertions(+), 217 deletions(-) mode change 100644 => 100755 apps/maps/map.html mode change 100644 => 100755 apps/settings/js/background.js mode change 100644 => 100755 apps/settings/js/side.js mode change 100644 => 100755 apps/weather/app.html mode change 100644 => 100755 css/activities.css mode change 100644 => 100755 css/app-menu.css create mode 100644 css/dialog.css mode change 100644 => 100755 css/dock.css create mode 100644 css/notify.css create mode 100644 js/app-manager.js create mode 100644 js/dialogs.js mode change 100644 => 100755 js/localStorage.js create mode 100644 js/notify.js diff --git a/LICENSE.md b/LICENSE.md index cac506e..9ab5364 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -12,6 +12,8 @@ * Brython licensed by [BSD-3-Clause License](./LICENCE_BSD3Clause.TXT) +* Also used Geolocation Services of [CodeTabs](https://github.com/jolav/codetabs) + > Ubuntu and Canonical are registered trademarks of Canonical Ltd. > Gnome are registered trademarks of Gnome. diff --git a/README.md b/README.md index 7617e0d..6f5d7f4 100644 --- a/README.md +++ b/README.md @@ -20,10 +20,24 @@ For introduce the Ubuntu environment' beauty (on web) and for fun. :) I was insp ## To-Do List * Increase clone apps' functionality -* [12] Create more clone application +* [13] Create more clone application * [+] Update interface to similar Ubuntu 21.10 interface * [-] Update interface to similar Ubuntu 22.04 interface +## App Demo Mode + + You can present your demo app with that project. + +> `https://malisipi.github.io/ubuntu-tour/?[`name`,`icon`,`location`]` + +* name: Your app's name +* icon: Your app's icon +* location: Your app's website + +> You can't send notification or create a new window. Because your app demo that hosted on another domain will be blocked by CORS policy. If you need to create a more powerful app demo, You can host the project with together your app demo. + +> https://malisipi.github.io/ubuntu-tour/?[%22Ubuntu-Tour%22,%22https://malisipi.github.io/ubuntu-tour/%22,%22https://malisipi.github.io/ubuntu-tour/icons/Suru/Suru/scalable/places/start-here-symbolic.svg%22] + ## Notes > Ubuntu Tour is compatible with touch devices. (Window resize on mobile is harder than on computer. And some browsers may not support resize on mobile.) diff --git a/apps/filemanager/js/app.js b/apps/filemanager/js/app.js index 5116029..e814849 100644 --- a/apps/filemanager/js/app.js +++ b/apps/filemanager/js/app.js @@ -8,22 +8,22 @@ function goToForward(){ function goTo(){ if (window.event.keyCode == '13'){ - alert("It's just a demo :)") + parent.parent.showNotification("It's just a demo :)","","",1250); } } function showMenu(){ - alert("It's just a demo :)"); + parent.parent.showNotification("It's just a demo :)","","",1250); } function showAsList(){ - alert("It's just a demo :)") + parent.parent.showNotification("It's just a demo :)","","",1250); } function changeLook(){ - alert("It's just a demo :)") + parent.parent.showNotification("It's just a demo :)","","",1250); } function searchAnything(){ - alert("It's just a demo :)") + parent.parent.showNotification("It's just a demo :)","","",1250); } \ No newline at end of file diff --git a/apps/filemanager/js/folderview.js b/apps/filemanager/js/folderview.js index f2f0570..cdda1dd 100644 --- a/apps/filemanager/js/folderview.js +++ b/apps/filemanager/js/folderview.js @@ -33,6 +33,6 @@ function openFile(theFile){ if(theFile=="Tjbk79TARiE.jpg") aboutFile=["../../icons/unsplash/Tjbk79TARiE.jpg","picture"]; if(aboutFile[1]=="picture"){ - parent.parent.window_create_special(parent.parent.createRandomWindowID(),'apps/imageviewer/index.html?file='+aboutFile[0],'Image Viewer','icons/Suru/Suru/48x48/apps/image-viewer-app.png'); + parent.parent.start_app('eog',"file="+aboutFile[0]); } } \ No newline at end of file diff --git a/apps/filemanager/other_locations.html b/apps/filemanager/other_locations.html index 716a634..f6170bc 100644 --- a/apps/filemanager/other_locations.html +++ b/apps/filemanager/other_locations.html @@ -7,7 +7,7 @@
On This PC
-
+
diff --git a/apps/filemanager/trash.html b/apps/filemanager/trash.html index 63a3d46..29a2807 100644 --- a/apps/filemanager/trash.html +++ b/apps/filemanager/trash.html @@ -10,8 +10,8 @@
Trash - - + +
diff --git a/apps/help/js/app.js b/apps/help/js/app.js index de0a40b..8d7f2f8 100644 --- a/apps/help/js/app.js +++ b/apps/help/js/app.js @@ -7,15 +7,15 @@ function goToForward(){ } function showBookmarks(){ - alert("It's just a demo :)"); + parent.parent.showNotification("It's just a demo :)","","",1250); } function searchbutton(){ - alert("It's just a demo :)"); + parent.parent.showNotification("It's just a demo :)","","",1250); } function showMenu(){ - alert("It's just a demo :)"); + parent.parent.showNotification("It's just a demo :)","","",1250); } function reloadWebpage(){ diff --git a/apps/imageviewer/js/app.js b/apps/imageviewer/js/app.js index 0c4f89e..97cb457 100644 --- a/apps/imageviewer/js/app.js +++ b/apps/imageviewer/js/app.js @@ -16,11 +16,11 @@ function zoomOut(){ } function doFullscreen(){ - alert("It's just a demo :)"); + parent.parent.showNotification("It's just a demo :)","","",1250); } function showMenu(){ - alert("It's just a demo :)"); + parent.parent.showNotification("It's just a demo :)","","",1250); } function showImage(){ diff --git a/apps/libreoffice/calc/index.html b/apps/libreoffice/calc/index.html index fce903e..e1a2737 100644 --- a/apps/libreoffice/calc/index.html +++ b/apps/libreoffice/calc/index.html @@ -41,7 +41,7 @@ diff --git a/apps/libreoffice/writer/index.html b/apps/libreoffice/writer/index.html index 4253516..6ffde54 100644 --- a/apps/libreoffice/writer/index.html +++ b/apps/libreoffice/writer/index.html @@ -54,7 +54,7 @@ diff --git a/apps/maps/js/app.js b/apps/maps/js/app.js index d90c1f4..4af8678 100644 --- a/apps/maps/js/app.js +++ b/apps/maps/js/app.js @@ -1,9 +1,9 @@ function myLocation(){ - alert("It's just a demo :)") + parent.parent.showNotification("It's just a demo :)","","",1250); } function layers(){ - alert("It's just a demo :)") + parent.parent.showNotification("It's just a demo :)","","",1250); } function zoomIn(){ @@ -17,15 +17,15 @@ function zoomOut(){ } function star(){ - alert("It's just a demo :)"); + parent.parent.showNotification("It's just a demo :)","","",1250); } function showMenu(){ - alert("It's just a demo :)"); + parent.parent.showNotification("It's just a demo :)","","",1250); } function goTo(){ if (window.event.keyCode == '13'){ - alert("It's just a demo :)"); + parent.parent.showNotification("It's just a demo :)","","",1250); } } diff --git a/apps/maps/map.html b/apps/maps/map.html old mode 100644 new mode 100755 index 225e2fb..61b3358 --- a/apps/maps/map.html +++ b/apps/maps/map.html @@ -2,11 +2,13 @@
diff --git a/apps/weather/js/app.js b/apps/weather/js/app.js index 8627b47..63d1445 100644 --- a/apps/weather/js/app.js +++ b/apps/weather/js/app.js @@ -3,13 +3,13 @@ function reload(){ } function showMenu(){ - alert("It's just a demo :)"); + parent.parent.showNotification("It's just a demo :)","","",1250); } function hourly(){ - alert("It's just a demo :)"); + parent.parent.showNotification("It's just a demo :)","","",1250); } function daily(){ - alert("It's just a demo :)"); + parent.parent.showNotification("It's just a demo :)","","",1250); } \ No newline at end of file diff --git a/apps/webbrowser/js/app.js b/apps/webbrowser/js/app.js index 030975e..5022f0f 100644 --- a/apps/webbrowser/js/app.js +++ b/apps/webbrowser/js/app.js @@ -11,11 +11,11 @@ function goToForward(){ } function openNewTab(){ - alert("It's just a demo :)"); + parent.parent.showNotification("It's just a demo :)","","",1250); } function showBookmarks(){ - alert("It's just a demo :)"); + parent.parent.showNotification("It's just a demo :)","","",1250); } function goTo(){ @@ -26,7 +26,7 @@ function goTo(){ function showMenu(){ - alert("It's just a demo :)"); + parent.parent.showNotification("It's just a demo :)","","",1250); } function reloadWebpage(){ diff --git a/apps/wine/notepad.html b/apps/wine/notepad.html index 0e470ca..0be5b84 100644 --- a/apps/wine/notepad.html +++ b/apps/wine/notepad.html @@ -33,7 +33,7 @@ diff --git a/contextmenu.html b/contextmenu.html index 6256392..9b722a4 100644 --- a/contextmenu.html +++ b/contextmenu.html @@ -5,7 +5,7 @@ @@ -15,9 +15,9 @@
Select All
Arrange Icons
Arrange By...
-
Open Desktop On Files
+
Open Desktop On Files
Open In Terminal
-
Change Wallpaper...
+
Change Wallpaper...
Display Settings
Desktop Symbol Settings
diff --git a/css/activities.css b/css/activities.css old mode 100644 new mode 100755 index f344024..a3d3658 --- a/css/activities.css +++ b/css/activities.css @@ -1,10 +1,10 @@ .activities{ position: fixed; top: 26px; - left: 80px; - width: calc(100% - 80px); + left: 0px; + width: 100%; height: calc(100% - 26px); - z-index: 99999999999999999999999999999999999999999; + z-index: 999999999; background: #222222; } diff --git a/css/app-menu.css b/css/app-menu.css old mode 100644 new mode 100755 index c347658..357b9fd --- a/css/app-menu.css +++ b/css/app-menu.css @@ -1,11 +1,11 @@ .app-menu{ position: fixed; - left:80px; + left:0px; top:26px; height: calc(100% - 26px); - width: calc(100% - 80px); + width: 100%; background: #222222; - z-index: 99999999999999999999999999999999999999999; + z-index: 999999999; } .app-menu-container{ diff --git a/css/dialog.css b/css/dialog.css new file mode 100644 index 0000000..f9c3590 --- /dev/null +++ b/css/dialog.css @@ -0,0 +1,76 @@ +#dialog-box-container{ + position: fixed; + top: 0px; + left: 0px; + width: 100%; + height: 100%; + z-index: 9999999999999999999999999999999999999999999; + background: #222222cc; +} + +#dialog-box{ + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%,-50%); + background: #222222; + width: 400px; + height: 175px; + color: #ffffff; + border-radius: 15px; + border: 1px #777777 solid; +} + +#dialog-title{ + position: absolute; + top: 35px; + left: 15px; + width: calc(100% - 30px); + text-align: center; + font-size: 25px; +} + +#dialog-text{ + position: absolute; + top: 85px; + left: 15px; + width: calc(100% - 30px); + text-align: center; + font-size: 16px; +} + +#dialog-option-1{ + position: absolute; + bottom: 0px; + left: 0px; + width: calc(50% - 1px); + background: #333333; + border-right: #111111 1px solid; + border-top: #111111 1px solid; + border-bottom-left-radius: 15px; + height: 40px; + display: flex; + align-items: center; + place-content: center; + transition-duration: 0.2s; +} + +#dialog-option-2{ + position: absolute; + bottom: 0px; + right: 0px; + width: 50%; + background: #333333; + border-top: #111111 1px solid; + border-bottom-right-radius: 15px; + height: 40px; + display: flex; + align-items: center; + place-content: center; + transition-duration: 0.2s; +} + +#dialog-option-1:hover, #dialog-option-2:hover{ + background: #555555; + transition-duration: 0.2s; +} \ No newline at end of file diff --git a/css/dock.css b/css/dock.css old mode 100644 new mode 100755 index 6a52dc4..2b5d224 --- a/css/dock.css +++ b/css/dock.css @@ -2,7 +2,7 @@ position: fixed; top:26px; left: 0px; - background: #111111; + background: #11111166; width: 80px; z-index: 99999999999999999999999999999999999999999; height: calc(100% - 106px); @@ -44,7 +44,7 @@ left: 0px; width: 80px; height: 80px; - background: #111111; + background: #11111166; z-index: 99999999999999999999999999999999999999999; } diff --git a/css/main.css b/css/main.css index 8ffbf56..01bacb9 100644 --- a/css/main.css +++ b/css/main.css @@ -57,7 +57,6 @@ input,textarea{ .panel-activities:hover, .panel-notification:hover, .panel-status:hover, .panel-active-app:hover { background: #ffffff44; - border-radius: 50px; transition-duration: 0.2s; } diff --git a/css/notify.css b/css/notify.css new file mode 100644 index 0000000..c416579 --- /dev/null +++ b/css/notify.css @@ -0,0 +1,36 @@ +#notify-box{ + position: fixed; + top: 30px; + left: 50%; + transform: translate(-50%,0px); + border-radius: 6px; + width: 500px; + height: 70px; + background: #222222; + border: #111111 solid 1px; + z-index: 999999999999999999999999999999999999999999; +} + +#notify-title{ + position: absolute; + top: 12px; + left: 12px; + font-size: 18px; + color: #ffffff; +} + +#notify-text{ + position: absolute; + top: 42px; + left: 12px; + font-size: 14px; + color: #777777; +} + +#notify-close{ + position: absolute; + top: 8px; + right: 8px; + width: 16px; + filter: brightness(1.5); +} \ No newline at end of file diff --git a/css/panel.css b/css/panel.css index ef4fd0a..be0b6d6 100644 --- a/css/panel.css +++ b/css/panel.css @@ -16,6 +16,7 @@ top: 2px; font-size: 16px; color: #ffffff; + border-radius: 50px; text-align: center; display: flex; justify-content: center; @@ -31,6 +32,7 @@ width: 0px; height: 22px; top: 2px; + border-radius: 50px; transition-duration: 0.2s; cursor: default; } @@ -64,6 +66,7 @@ top: 2px; transform: translate(-50%,0); font-size: 16px; + border-radius: 50px; color: #ffffff; text-align: center; display: flex; @@ -82,6 +85,7 @@ top: 2px; font-size: 16px; color: #ffffff; + border-radius: 50px; cursor: default; display: grid; grid-template-columns: auto auto auto; diff --git a/index.html b/index.html index c1d817f..8ca9b81 100644 --- a/index.html +++ b/index.html @@ -18,9 +18,14 @@ - + + + + + + @@ -40,7 +45,7 @@
-
+

Home
@@ -51,27 +56,14 @@
- +
"; changePanelActiveAppIcon(icon_grayscale,title,icon_brightness); changeWindowZIndex(name); + showNotification(title,"\""+title+"\" is ready","",2000); } function window_create_special(name,url,title,icon,icon_grayscale="",icon_brightness=1){ @@ -234,6 +149,7 @@ function window_create_special(name,url,title,icon,icon_grayscale="",icon_bright
"; changePanelActiveAppIcon(icon_grayscale,title,icon_brightness); changeWindowZIndex(name); + showNotification(title,"\""+title+"\" is ready","",2000); } function window_delete(w){ @@ -254,4 +170,16 @@ latest_window_id=0; function createRandomWindowID(){ latest_window_id+=1; return "w"+latest_window_id; -} \ No newline at end of file +} + +// /?[,,] +// for example; ?[%22Ubuntu-Tour%22,%22https://malisipi.github.io/ubuntu-tour/%22,%22https://malisipi.github.io/ubuntu-tour/icons/Suru/Suru/scalable/places/start-here-symbolic.svg%22] +window.addEventListener("load",()=>{ + if(window.location.search!=""){ + __hide_location_confirm=1; + __the_app=JSON.parse(decodeURIComponent(window.location.search).replace("?","")); + console.info(__the_app); + window_create(createRandomWindowID(),__the_app[1],__the_app[0],__the_app[2]); + window_maximize("w1"); + } +}); \ No newline at end of file diff --git a/main.js b/main.js index 1812e2d..03b3d82 100644 --- a/main.js +++ b/main.js @@ -1,11 +1,11 @@ function rightclick(event) { - showHideContextMenu(event.clientY,event.clientX); + if(event.target.className=="desktop" || event.target.className=="context-menu-container"){ + showHideContextMenu(event.clientY,event.clientX); + } } function showHideContextMenu(top=0,left=0){ if(document.getElementsByClassName("context-menu-container")[0].hidden){ - if(top<=26) return false; - if(left<=80) return false; if(document.querySelector(".activities").style.visibility!="hidden") return false; if(document.querySelector(".app-menu").style.visibility!="hidden") return false; document.getElementsByClassName("context-menu-container")[0].hidden=false; diff --git a/status.html b/status.html index cdc11b2..05e5dcb 100644 --- a/status.html +++ b/status.html @@ -16,6 +16,6 @@
Settings
Lock
-
Shutdown
+
Shutdown
\ No newline at end of file