mirror of
https://github.com/cupcakearmy/unpixel.git
synced 2026-04-02 12:25:22 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 99a70c662f | |||
| 49afc7fccd |
12
CHANGELOG.md
12
CHANGELOG.md
@@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file.
|
|||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [1.2.0] - 2021-06-01
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Progress bar
|
||||||
|
|
||||||
|
## [1.1.2] - 2021-05-31
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Bug with update window when banner is currently open
|
||||||
|
|
||||||
## [1.1.1] - 2021-05-28
|
## [1.1.1] - 2021-05-28
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.3 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 2.8 KiB |
BIN
design/tray.afdesign
LFS
BIN
design/tray.afdesign
LFS
Binary file not shown.
@@ -11,7 +11,7 @@
|
|||||||
"repository": {
|
"repository": {
|
||||||
"url": "https://github.com/cupcakearmy/unpixel"
|
"url": "https://github.com/cupcakearmy/unpixel"
|
||||||
},
|
},
|
||||||
"version": "1.1.1",
|
"version": "1.2.0",
|
||||||
"main": "./dist/back/index.js",
|
"main": "./dist/back/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "electron .",
|
"start": "electron .",
|
||||||
@@ -62,7 +62,7 @@
|
|||||||
"electron": "^12.0.0",
|
"electron": "^12.0.0",
|
||||||
"electron-builder": "^22.10.5",
|
"electron-builder": "^22.10.5",
|
||||||
"npm-run-all": "^4.1.5",
|
"npm-run-all": "^4.1.5",
|
||||||
"parcel": "next",
|
"parcel": "^2.0.0-beta.3.1",
|
||||||
"postcss": "^8.2.10",
|
"postcss": "^8.2.10",
|
||||||
"typescript": "^4.2.3"
|
"typescript": "^4.2.3"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,11 +60,11 @@ export default class TrayUtility {
|
|||||||
|
|
||||||
static init() {
|
static init() {
|
||||||
if (!this.tray) {
|
if (!this.tray) {
|
||||||
const file = path.join(__dirname, '../../assets/trayTemplate.png')
|
const file = path.join(__dirname, '../../assets/tray.png')
|
||||||
// const resized = nativeImage.createFromPath(file).resize({ width: 24, height: 24 })
|
const resized = nativeImage.createFromPath(file).resize({ width: 24, height: 24 })
|
||||||
// resized.setTemplateImage(true)
|
resized.setTemplateImage(true)
|
||||||
// resized.isMacTemplateImage = true
|
resized.isMacTemplateImage = true
|
||||||
this.tray = new Tray(file)
|
this.tray = new Tray(resized)
|
||||||
this.build()
|
this.build()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import logger from 'electron-log'
|
|||||||
import { dialog, shell } from 'electron'
|
import { dialog, shell } from 'electron'
|
||||||
|
|
||||||
import pkg from '../../package.json'
|
import pkg from '../../package.json'
|
||||||
|
import Banner from './banner'
|
||||||
|
|
||||||
const current = semver.coerce(pkg.version)
|
const current = semver.coerce(pkg.version)
|
||||||
const url = 'https://api.github.com/repos/cupcakearmy/unpixel/tags'
|
const url = 'https://api.github.com/repos/cupcakearmy/unpixel/tags'
|
||||||
@@ -25,7 +26,9 @@ export default class Updater {
|
|||||||
if (!current) throw new Error('Could not determine current version')
|
if (!current) throw new Error('Could not determine current version')
|
||||||
if (semver.lt(current, latest)) {
|
if (semver.lt(current, latest)) {
|
||||||
logger.info('New version available')
|
logger.info('New version available')
|
||||||
|
Banner.close()
|
||||||
dialog
|
dialog
|
||||||
|
// @ts-ignore
|
||||||
.showMessageBox(null, {
|
.showMessageBox(null, {
|
||||||
title: 'Update available',
|
title: 'Update available',
|
||||||
message: 'A newer version is available, please download.',
|
message: 'A newer version is available, please download.',
|
||||||
@@ -35,7 +38,6 @@ export default class Updater {
|
|||||||
.then(({ response }) => {
|
.then(({ response }) => {
|
||||||
if (response === 0) {
|
if (response === 0) {
|
||||||
shell.openExternal('https://github.com/cupcakearmy/unpixel/releases')
|
shell.openExternal('https://github.com/cupcakearmy/unpixel/releases')
|
||||||
process.exit(0)
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -19,11 +19,6 @@ main {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
h1 {
|
|
||||||
border-bottom: 0.5em solid currentColor;
|
|
||||||
padding-bottom: 0.15em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.countdown {
|
.countdown {
|
||||||
font-size: min(8rem, 25vh);
|
font-size: min(8rem, 25vh);
|
||||||
}
|
}
|
||||||
@@ -58,3 +53,16 @@ button {
|
|||||||
button:hover {
|
button:hover {
|
||||||
background-color: #2c2cce;
|
background-color: #2c2cce;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.progress {
|
||||||
|
width: 100%;
|
||||||
|
height: 3rem;
|
||||||
|
border: 0.125rem solid currentColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progress > div {
|
||||||
|
background-color: currentColor;
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
transition: width ease-out 250ms;
|
||||||
|
}
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ const Banner: React.FC = () => {
|
|||||||
|
|
||||||
const [done, setDone] = useState(false)
|
const [done, setDone] = useState(false)
|
||||||
const [auto, setAuto] = useState(false)
|
const [auto, setAuto] = useState(false)
|
||||||
|
const [progress, setProgress] = useState(100)
|
||||||
|
const [max, setMax] = useState(0)
|
||||||
const [countdown, setCountdown] = useState<null | number>(null)
|
const [countdown, setCountdown] = useState<null | number>(null)
|
||||||
|
|
||||||
const handler = useCallback(
|
const handler = useCallback(
|
||||||
@@ -57,16 +59,26 @@ const Banner: React.FC = () => {
|
|||||||
}
|
}
|
||||||
}, [countdown])
|
}, [countdown])
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (countdown !== null) {
|
||||||
|
setProgress((countdown / max) * 100)
|
||||||
|
}
|
||||||
|
}, [countdown, max])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const autoClose = ipcRenderer.sendSync('load', { key: 'autoClose' })
|
const autoClose = ipcRenderer.sendSync('load', { key: 'autoClose' })
|
||||||
setAuto(autoClose)
|
setAuto(autoClose)
|
||||||
const time = ipcRenderer.sendSync('load', { key: 'duration' })
|
const time = ipcRenderer.sendSync('load', { key: 'duration' })
|
||||||
setCountdown(time)
|
setCountdown(time)
|
||||||
|
setMax(time)
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<h1 className="ma0 mb4">Look Away</h1>
|
<h1 className="ma0 mb3">Look Away</h1>
|
||||||
|
<div className="progress mb4">
|
||||||
|
<div style={{ width: progress.toFixed(2) + '%' }} />
|
||||||
|
</div>
|
||||||
<div className="code countdown">{countdown}</div>
|
<div className="code countdown">{countdown}</div>
|
||||||
<div className="tile message">
|
<div className="tile message">
|
||||||
Look at least <b>6 meters</b> away. <br />
|
Look at least <b>6 meters</b> away. <br />
|
||||||
|
|||||||
Reference in New Issue
Block a user