diff --git a/angular.json b/angular.json index 588d13f7..68f8d34b 100644 --- a/angular.json +++ b/angular.json @@ -31,6 +31,7 @@ "tsConfig": "tsconfig.app.json", "inlineStyleLanguage": "css", "assets": [ + "src/favicon.ico", "src/assets", "src/osdrive", { diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 00000000..02a07516 Binary files /dev/null and b/favicon.ico differ diff --git a/src/app/app.module.ts b/src/app/app.module.ts index fa3f6cfb..da636bf3 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -35,6 +35,7 @@ import { CodeEditorComponent } from './user-apps/codeeditor/codeeditor.component import { PropertiesComponent } from './shared/system-component/properties/properties.component'; import { MarkDownViewerComponent } from './user-apps/markdownviewer/markdownviewer.component'; import { FileTreeViewComponent } from './shared/system-component/filetreeview/filetreeview.component'; +import { AboutComponent } from './system-apps/about/about.component'; import { SafeUrlPipe } from './shared/system-pipes/safe.resource.url.pipe'; import { TruncatePipe } from './shared/system-pipes/string.shorten.pipe'; @@ -77,6 +78,7 @@ import { KeyPressCaptureDirective } from './system-apps/terminal/key.press.captu CodeEditorComponent, MarkDownViewerComponent, FileTreeViewComponent, + AboutComponent, HighlightDirective, diff --git a/src/app/system-apps/about/about.component.css b/src/app/system-apps/about/about.component.css new file mode 100644 index 00000000..4fa744df --- /dev/null +++ b/src/app/system-apps/about/about.component.css @@ -0,0 +1,28 @@ +.cheetah-main-contianer{ + height: 100%; + width: 100%; + background-color: #f0f0f0; +} + +.os-info{ + height: 100%; + width: 100%; + padding:8px 8px 4px 8px; +} + +.os-image{ + width: 626px; + height: 235px; + margin-inline: auto; +} + +.os-name{ + font-size: 30px; + text-align: center; + color: #000; +} +.os-version{ + font-size: 15px; + text-align: center; + color: #000; +} \ No newline at end of file diff --git a/src/app/system-apps/about/about.component.html b/src/app/system-apps/about/about.component.html new file mode 100644 index 00000000..400ba2a5 --- /dev/null +++ b/src/app/system-apps/about/about.component.html @@ -0,0 +1,10 @@ +
+
+
+ +
+

CheetahOS

+

Version: 2.10.27

+
+ +
\ No newline at end of file diff --git a/src/app/system-apps/about/about.component.ts b/src/app/system-apps/about/about.component.ts new file mode 100644 index 00000000..4a3a21c9 --- /dev/null +++ b/src/app/system-apps/about/about.component.ts @@ -0,0 +1,97 @@ +import { Component, ElementRef, ViewChild, OnDestroy, AfterViewInit } from '@angular/core'; +import { Subscription } from 'rxjs'; +import { ProcessIDService } from 'src/app/shared/system-service/process.id.service'; +import { RunningProcessService } from 'src/app/shared/system-service/running.process.service'; +import { BaseComponent } from 'src/app/system-base/base/base.component'; +import { ComponentType } from 'src/app/system-files/component.types'; +import { Process } from 'src/app/system-files/process'; +import * as htmlToImage from 'html-to-image'; +import { TaskBarPreviewImage } from 'src/app/system-apps/taskbarpreview/taskbar.preview'; +import { Constants } from "src/app/system-files/constants"; + +@Component({ + selector:'cos-about', + templateUrl: './about.component.html', + styleUrls: ["./about.component.css"] +}) + +export class AboutComponent implements BaseComponent, OnDestroy, AfterViewInit{ + + @ViewChild('titleContent', {static: true}) titleContent!: ElementRef; + + private _processIdService:ProcessIDService; + private _runningProcessService:RunningProcessService; + private _maximizeWindowSub!: Subscription; + + private _consts:Constants = new Constants(); + SECONDS_DELAY = 250; + + + hasWindow = true; + icon = `${this._consts.IMAGE_BASE_PATH}cheetah.png`; + name = 'hello'; + processId = 0; + type = ComponentType.User; + displayName = 'Hello'; + + constructor( processIdService:ProcessIDService,runningProcessService:RunningProcessService) { + this._processIdService = processIdService; + this._runningProcessService = runningProcessService; + + this.processId = this._processIdService.getNewProcessId() + this._runningProcessService.addProcess(this.getComponentDetail()); + + this._maximizeWindowSub = this._runningProcessService.maximizeProcessWindowNotify.subscribe(() =>{this.maximizeWindow()}); + } + + + ngAfterViewInit(): void { + this.setTitleWindowToFocus(this.processId); + + setTimeout(()=>{ + this.captureComponentImg(); + },this.SECONDS_DELAY) + } + + ngOnDestroy():void{ + this._maximizeWindowSub?.unsubscribe(); + } + + captureComponentImg():void{ + htmlToImage.toPng(this.titleContent.nativeElement).then(htmlImg =>{ + //console.log('img data:',htmlImg); + + const cmpntImg:TaskBarPreviewImage = { + pid: this.processId, + imageData: htmlImg + } + this._runningProcessService.addProcessImage(this.name, cmpntImg); + }) + } + + maximizeWindow():void{ + + const uid = `${this.name}-${this.processId}`; + const evtOriginator = this._runningProcessService.getEventOrginator(); + + if(uid === evtOriginator){ + + this._runningProcessService.removeEventOriginator(); + const mainWindow = document.getElementById('vanta'); + //window title and button bar, and windows taskbar height + const pixelTosubtract = 30 + 40; + this.titleContent.nativeElement.style.height = `${(mainWindow?.offsetHeight || 0) - pixelTosubtract}px`; + this.titleContent.nativeElement.style.width = `${mainWindow?.offsetWidth}px`; + + } + } + + setTitleWindowToFocus(pid:number):void{ + this._runningProcessService.focusOnCurrentProcessNotify.next(pid); + } + + private getComponentDetail():Process{ + return new Process(this.processId, this.name, this.icon, this.hasWindow, this.type) + } + +} \ No newline at end of file diff --git a/src/app/system-apps/desktop/desktop.component.ts b/src/app/system-apps/desktop/desktop.component.ts index 6ce1c3b8..8e5f154d 100644 --- a/src/app/system-apps/desktop/desktop.component.ts +++ b/src/app/system-apps/desktop/desktop.component.ts @@ -608,7 +608,7 @@ export class DesktopComponent implements OnInit, OnDestroy, AfterViewInit{ const newFolder:NestedMenuItem={ icon:`${this._consts.IMAGE_BASE_PATH}empty_folder.png`, label:'Folder', action: this.createFolder.bind(this), variables:true , emptyline:false, styleOption:'C' } - const textEditor:NestedMenuItem={ icon:`${this._consts.IMAGE_BASE_PATH}text_editor.png`, label:'Rich Text', action: this.openTextEditor.bind(this), variables:true , + const textEditor:NestedMenuItem={ icon:`${this._consts.IMAGE_BASE_PATH}quill.png`, label:'Rich Text', action: this.openTextEditor.bind(this), variables:true , emptyline:false, styleOption:'C' } const codeEditor:NestedMenuItem={ icon:`${this._consts.IMAGE_BASE_PATH}vs_code.png`, label:'Code Editor', action: this.openCodeEditor.bind(this), variables:true , diff --git a/src/app/user-apps/title/title.component.ts b/src/app/user-apps/title/title.component.ts index 8c8d617f..685315f3 100644 --- a/src/app/user-apps/title/title.component.ts +++ b/src/app/user-apps/title/title.component.ts @@ -7,6 +7,7 @@ import { ComponentType } from 'src/app/system-files/component.types'; import { Process } from 'src/app/system-files/process'; import * as htmlToImage from 'html-to-image'; import { TaskBarPreviewImage } from 'src/app/system-apps/taskbarpreview/taskbar.preview'; +import { Constants } from "src/app/system-files/constants"; @Component({ selector:'cos-title', @@ -21,10 +22,13 @@ export class TitleComponent implements BaseComponent, OnDestroy, AfterViewInit{ private _processIdService:ProcessIDService; private _runningProcessService:RunningProcessService; private _maximizeWindowSub!: Subscription; + + private _consts:Constants = new Constants(); SECONDS_DELAY = 250; + hasWindow = true; - icon = 'osdrive/Pictures/favicon_nice.png'; + icon = `${this._consts.IMAGE_BASE_PATH}angular.png`; name = 'hello'; processId = 0; type = ComponentType.User; diff --git a/src/favicon.ico b/src/favicon.ico new file mode 100644 index 00000000..02a07516 Binary files /dev/null and b/src/favicon.ico differ diff --git a/src/index.html b/src/index.html index 29953596..0a766f14 100644 --- a/src/index.html +++ b/src/index.html @@ -1,13 +1,17 @@ + - CheetahOs + CheetahOS - + + + - \ No newline at end of file + + diff --git a/src/osdrive/Users/Pictures/favicon_nice.png b/src/osdrive/Cheetah/System/Imageres/angular.png similarity index 100% rename from src/osdrive/Users/Pictures/favicon_nice.png rename to src/osdrive/Cheetah/System/Imageres/angular.png diff --git a/src/osdrive/Cheetah/System/Imageres/cheetah-midsprint-dash.jpg b/src/osdrive/Cheetah/System/Imageres/cheetah-midsprint-dash.jpg new file mode 100644 index 00000000..beb8eb2a Binary files /dev/null and b/src/osdrive/Cheetah/System/Imageres/cheetah-midsprint-dash.jpg differ diff --git a/src/osdrive/Cheetah/System/Imageres/cheetah.png b/src/osdrive/Cheetah/System/Imageres/cheetah.png new file mode 100644 index 00000000..5228dc31 Binary files /dev/null and b/src/osdrive/Cheetah/System/Imageres/cheetah.png differ diff --git a/src/osdrive/Cheetah/System/Imageres/details_view.ico b/src/osdrive/Cheetah/System/Imageres/details_view.ico deleted file mode 100644 index 19327747..00000000 Binary files a/src/osdrive/Cheetah/System/Imageres/details_view.ico and /dev/null differ diff --git a/src/osdrive/Cheetah/System/Imageres/empty_recycle.ico b/src/osdrive/Cheetah/System/Imageres/empty_recycle.ico deleted file mode 100644 index c9c1a762..00000000 Binary files a/src/osdrive/Cheetah/System/Imageres/empty_recycle.ico and /dev/null differ diff --git a/src/osdrive/Cheetah/System/Imageres/imgviewer.png b/src/osdrive/Cheetah/System/Imageres/imgviewer.png new file mode 100644 index 00000000..6d006f50 Binary files /dev/null and b/src/osdrive/Cheetah/System/Imageres/imgviewer.png differ diff --git a/src/osdrive/Cheetah/System/Imageres/shell32_51380.ico b/src/osdrive/Cheetah/System/Imageres/shell32_51380.ico deleted file mode 100644 index df18674c..00000000 Binary files a/src/osdrive/Cheetah/System/Imageres/shell32_51380.ico and /dev/null differ diff --git a/src/osdrive/Cheetah/System/Imageres/vertical_stacks.png b/src/osdrive/Cheetah/System/Imageres/vertical_stacks.png new file mode 100644 index 00000000..bed3b932 Binary files /dev/null and b/src/osdrive/Cheetah/System/Imageres/vertical_stacks.png differ diff --git a/src/osdrive/Users/Desktop/heat.url b/src/osdrive/Users/Desktop/heat.url index 3d931a50..0efa2cce 100644 --- a/src/osdrive/Users/Desktop/heat.url +++ b/src/osdrive/Users/Desktop/heat.url @@ -1,6 +1,6 @@ [InternetShortcut] -FileName=heat -IconPath=osdrive/Users/Pictures/heat.png +FileName=Fire Storm +IconPath=osdrive/Cheetah/System/Imageres/imgviewer.png FileType=.png -ContentPath=osdrive/Users/Pictures/heat.png +ContentPath= OpensWith=imageviewer diff --git a/src/osdrive/Users/Desktop/hello.url b/src/osdrive/Users/Desktop/hello.url index 35d9f884..2c0cafde 100644 --- a/src/osdrive/Users/Desktop/hello.url +++ b/src/osdrive/Users/Desktop/hello.url @@ -1,6 +1,6 @@ [InternetShortcut] FileName=hello -IconPath=osdrive/Users/Pictures/favicon_nice.png -FileType=.ico -ContentPath=hello +IconPath=osdrive/Cheetah/System/Imageres/angular.png +FileType=.png +ContentPath= OpensWith=hello \ No newline at end of file diff --git a/src/osdrive/Users/Pictures/cheetah-midsprint-dash.jpg b/src/osdrive/Users/Pictures/cheetah-midsprint-dash.jpg new file mode 100644 index 00000000..beb8eb2a Binary files /dev/null and b/src/osdrive/Users/Pictures/cheetah-midsprint-dash.jpg differ diff --git a/src/osdrive/Users/Pictures/favicon.ico b/src/osdrive/Users/Pictures/favicon.ico deleted file mode 100644 index 997406ad..00000000 Binary files a/src/osdrive/Users/Pictures/favicon.ico and /dev/null differ diff --git a/src/osdrive/Users/Pictures/favicon1.ico b/src/osdrive/Users/Pictures/favicon1.ico deleted file mode 100644 index 3b4df1c3..00000000 Binary files a/src/osdrive/Users/Pictures/favicon1.ico and /dev/null differ diff --git a/src/osdrive/Users/Pictures/heat-guy-j.jpeg b/src/osdrive/Users/Pictures/heat-guy-j.jpeg new file mode 100644 index 00000000..40eb8c91 Binary files /dev/null and b/src/osdrive/Users/Pictures/heat-guy-j.jpeg differ diff --git a/src/osdrive/Users/Pictures/heat.png b/src/osdrive/Users/Pictures/heat.png deleted file mode 100644 index f1401788..00000000 Binary files a/src/osdrive/Users/Pictures/heat.png and /dev/null differ