Skip to content

Commit

Permalink
Switch to an SVG variant of the LiveSplit icon
Browse files Browse the repository at this point in the history
This makes it scale better to HiDPI displays and is also smaller in
terms of file size.
  • Loading branch information
CryZe committed Apr 7, 2024
1 parent c54123f commit d15665e
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 19 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# <img src="https://raw.githubusercontent.com/LiveSplit/LiveSplit/master/LiveSplit/Resources/Icon.png" alt="LiveSplit" height="42" width="45" align="top"/> LiveSplit One
# <img src="https://raw.githubusercontent.com/LiveSplit/LiveSplitOne/master/src/assets/icon.svg" alt="LiveSplit" height="42" align="top"/> LiveSplit One

[![Build Status](https://github.com/LiveSplit/LiveSplitOne/workflows/CI/badge.svg)](https://github.com/LiveSplit/LiveSplitOne/actions)

Expand Down
20 changes: 9 additions & 11 deletions buildCore.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,27 @@ import fs from "fs";
let toolchain = "";
let targetFolder = "debug";
let cargoFlags = "";
let rustFlags = "-C target-feature=+bulk-memory,+mutable-globals,+nontrapping-fptoint,+sign-ext,+simd128";
let rustFlags = "-C target-feature=+bulk-memory,+mutable-globals,+nontrapping-fptoint,+sign-ext,+simd128,+extended-const";
let wasmBindgenFlags = "";

// Do an optimized build.
if (process.argv.some((v) => v === "--release")) {
if (process.argv.some((v) => v === "--max-opt")) {
// Do a fully optimized build ready for deployment.
targetFolder = "max-opt";
cargoFlags = "--profile max-opt";
} else if (process.argv.some((v) => v === "--release")) {
// Do an optimized build.
targetFolder = "release";
cargoFlags = "--release";
} else {
// Do a debug build.
wasmBindgenFlags += " --keep-debug";
}

// Do a fully optimized build ready for deployment.
if (process.argv.some((v) => v === "--max-opt")) {
targetFolder = "max-opt";
cargoFlags = "--profile max-opt";
}

// Use WASM features that may not be supported by all the browsers.
if (process.argv.some((v) => v === "--unstable")) {
// Extended const is not supported by Safari yet.
// Relaxed SIMD is not supported by Firefox and Safari yet.
// Tail calls are not supported by Safari and wasm-bindgen yet.
rustFlags += ",+extended-const,+relaxed-simd"; //,+tail-call";
rustFlags += ",+relaxed-simd"; //,+tail-call";
}

// Use the nightly toolchain, which enables some more optimizations.
Expand Down
Binary file removed src/assets/icon.png
Binary file not shown.
Binary file removed src/assets/icon_small.png
Binary file not shown.
2 changes: 1 addition & 1 deletion src/type-definitions/images.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
declare module '*.png'
declare module '*.svg'
4 changes: 2 additions & 2 deletions src/ui/About.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from "react";

import LiveSplitIcon from "../assets/icon_small.png";
import LiveSplitIcon from "../assets/icon.svg";

import "../css/About.scss";

Expand Down Expand Up @@ -36,7 +36,7 @@ export class About extends React.Component<Props> {
</a>
</p>
<p>LiveSplit One is a multiplatform version of LiveSplit, the sleek,
highly-customizable timer for speedrunners.</p>
highly-customizable timer for speedrunners.</p>
<p>
<a href="https://github.com/LiveSplit/LiveSplitOne" target="_blank">
View Source Code on GitHub
Expand Down
1 change: 0 additions & 1 deletion src/ui/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1186,7 +1186,6 @@ export class SettingsComponent<T> extends React.Component<Props<T>> {
new Uint8Array(file),
true,
);
console.log(`new image id: ${imageId}`);
this.props.editorUrlCache.cache(imageId);
const value = expect(
factory.fromBackgroundImage(imageId, brightness / 100, opacity / 100, blur / 100),
Expand Down
2 changes: 1 addition & 1 deletion src/ui/TimerView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import DragUpload from "./DragUpload";
import AutoRefresh from "../util/AutoRefresh";
import AutoRefreshLayout from "../layout/AutoRefreshLayout";

import LiveSplitIcon from "../assets/icon_small.png";
import LiveSplitIcon from "../assets/icon.svg";

import "../css/TimerView.scss";
import { UrlCache } from "../util/UrlCache";
Expand Down
4 changes: 2 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default async (env, argv) => {
plugins: [
...(isProduction ? [new CleanWebpackPlugin()] : []),
new FaviconsWebpackPlugin({
logo: path.resolve("src/assets/icon.png"),
logo: path.resolve("src/assets/icon.svg"),
inject: true,
favicons: {
appName: "LiveSplit One",
Expand Down Expand Up @@ -161,7 +161,7 @@ export default async (env, argv) => {
],
},
{
test: /\.(png|jpg|gif|woff|ico)$/,
test: /\.(png|jpg|gif|woff|ico|svg)$/,
type: 'asset/resource'
},
],
Expand Down

0 comments on commit d15665e

Please sign in to comment.