Skip to content

Commit

Permalink
v0.3.2 - dev preview
Browse files Browse the repository at this point in the history
  • Loading branch information
ahqsoftwares committed Oct 5, 2024
1 parent 1131673 commit 2cf4abf
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 13 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Thanks to [WallpaperFlare](https://www.wallpaperflare.com/stars-sky-night-space-star-space-astronomy-full-frame-wallpaper-gtuqz) for the background image.

# Required Tools

- NodeJS
Expand All @@ -13,3 +11,7 @@ npm i -g pnpm
pnpm install
pnpm dev
```

### Attributions

- Background Photo by [Jasper Garratt](https://unsplash.com/@jaspergarrattphotography?utm_content=creditCopyText&utm_medium=referral&utm_source=unsplash) on [Unsplash](https://unsplash.com/photos/a-star-trail-is-seen-in-the-night-sky-SCJ5lmQ5mlQ?utm_content=creditCopyText&utm_medium=referral&utm_source=unsplash)
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<title>Updater</title>
</head>

<body data-tauri-drag-region>
<body data-tauri-drag-region oncontextmenu="return false">
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "amber-dchat",
"private": true,
"version": "0.3.1",
"version": "0.3.2",
"type": "module",
"scripts": {
"dev": "tauri dev",
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cargo-features = ["profile-rustflags", "trim-paths"]

[package]
name = "amberdchat"
version = "0.3.1"
version = "0.3.2"
description = "A Tauri App"
authors = ["Amber DChat"]
edition = "2021"
Expand Down
9 changes: 7 additions & 2 deletions src/ui/bg.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
.bg {
background: url("./bg.jpg");
.bg1 {
background: url("./bg1.jpg");
background-size: cover;
}

.bg2 {
background: url("./bg2.jpg");
background-size: cover;
}
Binary file removed src/ui/bg.jpg
Binary file not shown.
Binary file added src/ui/bg1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/ui/bg2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 6 additions & 4 deletions src/ui/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import "./bg.css"
export default function Updater() {
const { text, progress } = useUpdaterStatus();

const dark = window.matchMedia("(prefers-color-scheme: dark)").matches;

useEffect(() => {
window.addEventListener("keyup", (e) => {
if (e.key == "q" || e.key == "Q") {
Expand All @@ -15,11 +17,11 @@ export default function Updater() {
})
}, []);

return <div data-tauri-drag-region className="w-screen h-screen bg flex flex-col items-center text-center justify-center py-2 pb-0">
<img data-tauri-drag-region src="/favicon.png" className="h-32 w-32 mb-3 mt-auto" />
return <div data-tauri-drag-region className={`w-screen h-screen ${dark ? Math.random() >= 0.5 ? `bg1` : `bg2` : ""} flex flex-col items-center text-center justify-center py-2 pb-0`}>
<img data-tauri-drag-region src="/favicon.png" className="h-32 w-32 mb-3 mt-auto border border-base-content rounded-full shadow-lg" />

<h1 data-tauri-drag-region className="font-sans text-2xl md:text-3xl">Amber DChat</h1>
<h2 data-tauri-drag-region className="text-sm font-extrabold mt-2">&#169; Amber DChat {new Date().getFullYear()}</h2>
<h1 data-tauri-drag-region className="font-sans dark:text-white font-extrabold text-2xl md:text-3xl">Amber DChat</h1>
<h2 data-tauri-drag-region className="text-sm font-bold dark:text-white mt-2">&#169; Amber DChat {new Date().getFullYear()}</h2>

<h1 data-tauri-drag-region className="mt-auto pr-3 mb-2 mx-auto md:mr-0 md:ml-auto">{text}</h1>

Expand Down
2 changes: 1 addition & 1 deletion src/ui/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function useUpdaterStatus() {

setTimeout(() => {
invoke("launch");
}, 1000);
}, 3000);
} else if (payload === "Installing") {
setText("Installing");
window.setProgressBar({
Expand Down

0 comments on commit 2cf4abf

Please sign in to comment.