Merge branch 'Flow-Works:master' into master
This commit is contained in:
commit
06ebe17e62
7 changed files with 43 additions and 11 deletions
|
|
@ -9,7 +9,7 @@ export const run = (element: HTMLDivElement): void => {
|
||||||
element.style.alignItems = 'center'
|
element.style.alignItems = 'center'
|
||||||
element.style.justifyContent = 'center'
|
element.style.justifyContent = 'center'
|
||||||
element.style.aspectRatio = '1 / 1'
|
element.style.aspectRatio = '1 / 1'
|
||||||
element.innerHTML = '<i class=\'bx bx-rocket\'></i>'
|
element.innerHTML = '<i class=\'bx bx-category\'></i>'
|
||||||
|
|
||||||
element.onclick = () => {
|
element.onclick = () => {
|
||||||
window.wm.toggleLauncher()
|
window.wm.toggleLauncher()
|
||||||
|
|
@ -9,15 +9,17 @@ export const meta = {
|
||||||
export const run = (element: HTMLDivElement): void => {
|
export const run = (element: HTMLDivElement): void => {
|
||||||
element.style.display = 'flex'
|
element.style.display = 'flex'
|
||||||
element.style.alignItems = 'center'
|
element.style.alignItems = 'center'
|
||||||
element.style.gap = '10px'
|
element.style.gap = '5px'
|
||||||
element.style.paddingLeft = '15px'
|
element.style.flex = '1'
|
||||||
element.style.paddingRight = '15px'
|
|
||||||
|
|
||||||
window.addEventListener('app_opened', (e: AppOpenedEvent): void => {
|
window.addEventListener('app_opened', (e: AppOpenedEvent): void => {
|
||||||
const appIcon = document.createElement('app')
|
const appIcon = document.createElement('app')
|
||||||
const app = e.detail.app
|
const app = e.detail.app
|
||||||
const win = e.detail.win
|
const win = e.detail.win
|
||||||
appIcon.innerHTML = `<img data-id="${win.id}" src="${app.icon}"/>`
|
appIcon.style.background = 'var(--surface-0)'
|
||||||
|
appIcon.style.padding = '5px 7.5px'
|
||||||
|
appIcon.style.borderRadius = '5px'
|
||||||
|
appIcon.innerHTML = `<img data-id="${win.id}" src="${app.icon}"/> ${app.name}`
|
||||||
appIcon.onclick = async () => {
|
appIcon.onclick = async () => {
|
||||||
const win = await e.detail.win
|
const win = await e.detail.win
|
||||||
win.focus()
|
win.focus()
|
||||||
|
|
|
||||||
13
src/modules/battery.ts
Normal file
13
src/modules/battery.ts
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
export const meta = {
|
||||||
|
name: 'Battery',
|
||||||
|
description: 'Tells you your device\'s battery.',
|
||||||
|
id: 'battery'
|
||||||
|
}
|
||||||
|
|
||||||
|
export const run = (element: HTMLDivElement): void => {
|
||||||
|
element.style.display = 'flex'
|
||||||
|
element.style.alignItems = 'center'
|
||||||
|
element.style.paddingLeft = '15px'
|
||||||
|
element.style.paddingRight = '15px'
|
||||||
|
element.innerHTML = '100%'
|
||||||
|
}
|
||||||
|
|
@ -5,6 +5,8 @@ export const meta = {
|
||||||
}
|
}
|
||||||
|
|
||||||
export const run = (element: HTMLDivElement): void => {
|
export const run = (element: HTMLDivElement): void => {
|
||||||
|
let date: Date = new Date()
|
||||||
|
|
||||||
element.style.display = 'flex'
|
element.style.display = 'flex'
|
||||||
element.style.flexDirection = 'column'
|
element.style.flexDirection = 'column'
|
||||||
element.style.padding = '5px 10px'
|
element.style.padding = '5px 10px'
|
||||||
|
|
@ -20,8 +22,6 @@ export const run = (element: HTMLDivElement): void => {
|
||||||
return date.toLocaleTimeString('en-US', { hour12: false, hour: 'numeric', minute: 'numeric' })
|
return date.toLocaleTimeString('en-US', { hour12: false, hour: 'numeric', minute: 'numeric' })
|
||||||
}
|
}
|
||||||
|
|
||||||
let date: Date = new Date()
|
|
||||||
|
|
||||||
refreshDate()
|
refreshDate()
|
||||||
refreshClock()
|
refreshClock()
|
||||||
|
|
||||||
|
|
|
||||||
13
src/modules/weather.ts
Normal file
13
src/modules/weather.ts
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
export const meta = {
|
||||||
|
name: 'Weather',
|
||||||
|
description: 'Tells you the weather.',
|
||||||
|
id: 'weather'
|
||||||
|
}
|
||||||
|
|
||||||
|
export const run = (element: HTMLDivElement): void => {
|
||||||
|
element.style.display = 'flex'
|
||||||
|
element.style.alignItems = 'center'
|
||||||
|
element.style.paddingLeft = '15px'
|
||||||
|
element.style.paddingRight = '15px'
|
||||||
|
element.innerHTML = '☁️ 26*C'
|
||||||
|
}
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
import * as clock from './modules/clock.ts'
|
import * as clock from './modules/clock.ts'
|
||||||
import * as switcher from './modules/switcher.ts'
|
import * as switcher from './modules/switcher.ts'
|
||||||
import * as appView from './modules/appView.ts'
|
import * as appView from './modules/appLauncher.ts'
|
||||||
import * as apps from './modules/apps.ts'
|
import * as apps from './modules/apps.ts'
|
||||||
|
import * as weather from './modules/weather.ts'
|
||||||
|
import * as battery from './modules/battery.ts'
|
||||||
|
|
||||||
import { StatusItem } from './types'
|
import { StatusItem } from './types'
|
||||||
|
|
||||||
|
|
@ -16,8 +18,10 @@ class StatusBar {
|
||||||
|
|
||||||
this.add(appView)
|
this.add(appView)
|
||||||
this.add(apps)
|
this.add(apps)
|
||||||
|
this.add(weather)
|
||||||
this.add(clock)
|
this.add(clock)
|
||||||
this.add(switcher)
|
this.add(switcher)
|
||||||
|
this.add(battery)
|
||||||
}
|
}
|
||||||
|
|
||||||
add (item: StatusItem): void {
|
add (item: StatusItem): void {
|
||||||
|
|
|
||||||
|
|
@ -44,10 +44,10 @@ body, html {
|
||||||
}
|
}
|
||||||
|
|
||||||
toolbar {
|
toolbar {
|
||||||
width: 100%;
|
width: calc(100% - 40px);
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
margin-bottom: 10px;
|
margin: 0 0 0 0;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
& > div {
|
& > div {
|
||||||
|
|
@ -75,7 +75,7 @@ toolbar {
|
||||||
window-area {
|
window-area {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: calc(100% - 40px);
|
width: calc(100% - 40px);
|
||||||
margin-left: 20px;
|
margin-top: 20px;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue