misc: new icons
No files matched your search
@@ -1,31 +1,50 @@
|
|||||||
import type { ConfigContext, ExpoConfig } from "expo/config"
|
import type { ConfigContext, ExpoConfig } from "expo/config"
|
||||||
|
|
||||||
export default ({ config }: ConfigContext): ExpoConfig => {
|
export default ({ config }: ConfigContext): ExpoConfig => {
|
||||||
const variant = process.env.APP_VARIANT ?? "production"
|
const variant =
|
||||||
if (!["development", "preview", "production"].includes(variant)) {
|
process.env.APP_VARIANT ?? process.env.EAS_BUILD_PROFILE ?? "production"
|
||||||
|
if (
|
||||||
|
variant !== "development" &&
|
||||||
|
variant !== "preview" &&
|
||||||
|
variant !== "production"
|
||||||
|
) {
|
||||||
throw new Error(`Unsupported APP_VARIANT: ${variant}`)
|
throw new Error(`Unsupported APP_VARIANT: ${variant}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
const suffix = variant === "production" ? "" : `.${variant}`
|
const suffix = variant === "production" ? "" : `.${variant}`
|
||||||
|
const iconSuffix = variant === "production" ? "" : `-${variant}`
|
||||||
const nameSuffix =
|
const nameSuffix =
|
||||||
variant === "development"
|
variant === "development"
|
||||||
? " (Development)"
|
? " (Development)"
|
||||||
: variant === "preview"
|
: variant === "preview"
|
||||||
? " (Preview)"
|
? " (Preview)"
|
||||||
: ""
|
: ""
|
||||||
|
const composer = {
|
||||||
|
development: "oTunes Dev",
|
||||||
|
preview: "oTunes Preview",
|
||||||
|
production: "oTunes",
|
||||||
|
}[variant]
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...config,
|
...config,
|
||||||
name: `${config.name}${nameSuffix}`,
|
name: `${config.name}${nameSuffix}`,
|
||||||
slug: config.slug!,
|
slug: config.slug!,
|
||||||
scheme: variant === "production" ? "otunes" : `otunes-${variant}`,
|
scheme: variant === "production" ? "otunes" : `otunes-${variant}`,
|
||||||
|
icon: `./assets/icon${iconSuffix}.png`,
|
||||||
ios: {
|
ios: {
|
||||||
...config.ios,
|
...config.ios,
|
||||||
bundleIdentifier: `${config.ios!.bundleIdentifier}${suffix}`,
|
bundleIdentifier: `${config.ios!.bundleIdentifier}${suffix}`,
|
||||||
|
icon: `./assets/${composer}.icon`,
|
||||||
},
|
},
|
||||||
android: {
|
android: {
|
||||||
...config.android,
|
...config.android,
|
||||||
package: `${config.android!.package}${suffix}`,
|
package: `${config.android!.package}${suffix}`,
|
||||||
|
icon: `./assets/android-icon${iconSuffix}.png`,
|
||||||
|
adaptiveIcon: {
|
||||||
|
monochromeImage: "./assets/android-icon-monochrome.png",
|
||||||
|
foregroundImage: `./assets/android-icon-foreground${iconSuffix}.png`,
|
||||||
|
backgroundImage: `./assets/android-icon-background${iconSuffix}.png`,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -26,10 +26,11 @@
|
|||||||
"adaptiveIcon": {
|
"adaptiveIcon": {
|
||||||
"monochromeImage": "./assets/android-icon-monochrome.png",
|
"monochromeImage": "./assets/android-icon-monochrome.png",
|
||||||
"foregroundImage": "./assets/android-icon-foreground.png",
|
"foregroundImage": "./assets/android-icon-foreground.png",
|
||||||
"backgroundColor": "#C60322"
|
"backgroundImage": "./assets/android-icon-background.png"
|
||||||
},
|
},
|
||||||
"userInterfaceStyle": "dark",
|
"userInterfaceStyle": "dark",
|
||||||
"softwareKeyboardLayoutMode": "resize"
|
"softwareKeyboardLayoutMode": "resize",
|
||||||
|
"icon": "./assets/android-icon.png"
|
||||||
},
|
},
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"expo-router",
|
"expo-router",
|
||||||
|
|||||||
|
After Width: | Height: | Size: 8.1 KiB |
|
After Width: | Height: | Size: 8.0 KiB |
|
After Width: | Height: | Size: 7.9 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 324 KiB |
|
After Width: | Height: | Size: 310 KiB |
|
After Width: | Height: | Size: 286 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 284 KiB |
|
Before Width: | Height: | Size: 1.3 MiB After Width: | Height: | Size: 324 KiB |
|
Before Width: | Height: | Size: 963 KiB After Width: | Height: | Size: 284 KiB |
|
After Width: | Height: | Size: 8.8 KiB |
@@ -0,0 +1,53 @@
|
|||||||
|
{
|
||||||
|
"fill" : {
|
||||||
|
"linear-gradient" : [
|
||||||
|
"display-p3:0.00000,0.55106,0.91748,1.00000",
|
||||||
|
"display-p3:0.00320,0.24546,0.91602,1.00000"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"groups" : [
|
||||||
|
{
|
||||||
|
"layers" : [
|
||||||
|
{
|
||||||
|
"fill-specializations" : [
|
||||||
|
{
|
||||||
|
"value" : "automatic"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"appearance" : "dark",
|
||||||
|
"value" : {
|
||||||
|
"linear-gradient" : [
|
||||||
|
"display-p3:0.00000,0.55106,0.91748,1.00000",
|
||||||
|
"display-p3:0.00320,0.24546,0.91602,1.00000"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"image-name" : "music.note.png",
|
||||||
|
"name" : "music.note",
|
||||||
|
"position" : {
|
||||||
|
"scale" : 1.5,
|
||||||
|
"translation-in-points" : [
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"shadow" : {
|
||||||
|
"kind" : "neutral",
|
||||||
|
"opacity" : 0.6
|
||||||
|
},
|
||||||
|
"translucency" : {
|
||||||
|
"enabled" : false,
|
||||||
|
"value" : 0.2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"supported-platforms" : {
|
||||||
|
"circles" : [
|
||||||
|
"watchOS"
|
||||||
|
],
|
||||||
|
"squares" : "shared"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 8.8 KiB |
@@ -0,0 +1,53 @@
|
|||||||
|
{
|
||||||
|
"fill" : {
|
||||||
|
"linear-gradient" : [
|
||||||
|
"display-p3:0.03297,0.65562,0.91748,1.00000",
|
||||||
|
"display-p3:0.01787,0.85470,0.91602,1.00000"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"groups" : [
|
||||||
|
{
|
||||||
|
"layers" : [
|
||||||
|
{
|
||||||
|
"fill-specializations" : [
|
||||||
|
{
|
||||||
|
"value" : "automatic"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"appearance" : "dark",
|
||||||
|
"value" : {
|
||||||
|
"linear-gradient" : [
|
||||||
|
"display-p3:0.03297,0.65562,0.91748,1.00000",
|
||||||
|
"display-p3:0.01787,0.85470,0.91602,1.00000"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"image-name" : "music.note.png",
|
||||||
|
"name" : "music.note",
|
||||||
|
"position" : {
|
||||||
|
"scale" : 1.5,
|
||||||
|
"translation-in-points" : [
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"shadow" : {
|
||||||
|
"kind" : "neutral",
|
||||||
|
"opacity" : 0.6
|
||||||
|
},
|
||||||
|
"translucency" : {
|
||||||
|
"enabled" : false,
|
||||||
|
"value" : 0.2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"supported-platforms" : {
|
||||||
|
"circles" : [
|
||||||
|
"watchOS"
|
||||||
|
],
|
||||||
|
"squares" : "shared"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
"image-name" : "music.note.png",
|
"image-name" : "music.note.png",
|
||||||
"name" : "music.note",
|
"name" : "music.note",
|
||||||
"position" : {
|
"position" : {
|
||||||
"scale" : 1,
|
"scale" : 1.5,
|
||||||
"translation-in-points" : [
|
"translation-in-points" : [
|
||||||
0,
|
0,
|
||||||
0
|
0
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 8.6 KiB |
|
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 7.7 KiB |
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 8.6 KiB |
|
Before Width: | Height: | Size: 1.3 MiB After Width: | Height: | Size: 324 KiB |
|
Before Width: | Height: | Size: 963 KiB After Width: | Height: | Size: 284 KiB |
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 3.7 KiB |
@@ -0,0 +1,79 @@
|
|||||||
|
"""Export Composer artwork with Xcode, then resize with Pillow.
|
||||||
|
|
||||||
|
Run on macOS with Xcode and Pillow installed: python3 scripts/generate-icons.py
|
||||||
|
"""
|
||||||
|
import json
|
||||||
|
from pathlib import Path
|
||||||
|
import shutil
|
||||||
|
import subprocess
|
||||||
|
import tempfile
|
||||||
|
from PIL import Image
|
||||||
|
|
||||||
|
ROOT = Path(__file__).resolve().parents[1]
|
||||||
|
ASSETS = ROOT / "apps/mobile/assets"
|
||||||
|
ICTOOL = "/Applications/Xcode.app/Contents/Applications/Icon Composer.app/Contents/Executables/ictool"
|
||||||
|
|
||||||
|
|
||||||
|
def export(source, output, rendition="Default"):
|
||||||
|
subprocess.run([
|
||||||
|
ICTOOL, str(source), "--export-image", "--output-file", str(output),
|
||||||
|
"--platform", "iOS", "--rendition", rendition,
|
||||||
|
"--width", "1024", "--height", "1024", "--scale", "1",
|
||||||
|
], check=True)
|
||||||
|
return Image.open(output).convert("RGBA")
|
||||||
|
|
||||||
|
|
||||||
|
def save(image, path, size=1024):
|
||||||
|
image.resize((size, size), Image.Resampling.LANCZOS).save(ROOT / path)
|
||||||
|
|
||||||
|
|
||||||
|
with tempfile.TemporaryDirectory(prefix="otunes-icons-") as directory:
|
||||||
|
temp = Path(directory)
|
||||||
|
for variant, composer in [("production", "oTunes"), ("development", "oTunes Dev"), ("preview", "oTunes Preview")]:
|
||||||
|
source = ASSETS / f"{composer}.icon"
|
||||||
|
icon = export(source, temp / "icon.png")
|
||||||
|
dark = export(source, temp / "dark.png", "Dark")
|
||||||
|
suffix = "" if variant == "production" else f"-{variant}"
|
||||||
|
save(icon, f"apps/mobile/assets/icon{suffix}.png")
|
||||||
|
|
||||||
|
# Android uses the Composer artwork without Apple's rounded glass base.
|
||||||
|
document = json.loads((source / "icon.json").read_text())
|
||||||
|
layer = document["groups"][0]["layers"][0]
|
||||||
|
artwork = Image.open(source / "Assets" / layer["image-name"]).convert("RGBA")
|
||||||
|
position = layer["position"]
|
||||||
|
scale = position["scale"]
|
||||||
|
artwork = artwork.resize(tuple(round(size * scale) for size in artwork.size), Image.Resampling.LANCZOS)
|
||||||
|
x, y = position["translation-in-points"]
|
||||||
|
foreground = Image.new("RGBA", (1024, 1024))
|
||||||
|
foreground.alpha_composite(artwork, (round((1024 - artwork.width) / 2 + x), round((1024 - artwork.height) / 2 + y)))
|
||||||
|
# Android's adaptive canvas includes an outer area reserved for motion.
|
||||||
|
adaptive = Image.new("RGBA", (1024, 1024))
|
||||||
|
adaptive.alpha_composite(foreground.resize((682, 682), Image.Resampling.LANCZOS), (171, 171))
|
||||||
|
save(adaptive, f"apps/mobile/assets/android-icon-foreground{suffix}.png")
|
||||||
|
# Use the rendered background's center column to retain Composer colors.
|
||||||
|
background_source = temp / "background.icon"
|
||||||
|
shutil.copytree(source, background_source, dirs_exist_ok=True)
|
||||||
|
document = json.loads((source / "icon.json").read_text())
|
||||||
|
document["groups"] = []
|
||||||
|
(background_source / "icon.json").write_text(json.dumps(document))
|
||||||
|
background = export(background_source, temp / "background.png")
|
||||||
|
background = background.crop((512, 0, 513, 1024)).resize((1024, 1024))
|
||||||
|
save(background, f"apps/mobile/assets/android-icon-background{suffix}.png")
|
||||||
|
save(Image.alpha_composite(background, foreground), f"apps/mobile/assets/android-icon{suffix}.png")
|
||||||
|
if variant != "production":
|
||||||
|
continue
|
||||||
|
monochrome = Image.new("RGBA", adaptive.size, "white")
|
||||||
|
monochrome.putalpha(adaptive.getchannel("A"))
|
||||||
|
save(monochrome, "apps/mobile/assets/android-icon-monochrome.png")
|
||||||
|
for name, image in [("icon-dark", dark), ("ios-icon", icon), ("ios-icon-dark", dark)]:
|
||||||
|
save(image, f"apps/mobile/assets/{name}.png")
|
||||||
|
for name, image in [("logo", icon), ("logo-dark", dark)]:
|
||||||
|
save(image, f"apps/web/public/{name}.png")
|
||||||
|
for path, size, image in [
|
||||||
|
("favicon.png", 64, icon),
|
||||||
|
("apps/mobile/assets/favicon.png", 64, icon),
|
||||||
|
("apps/web/app/favicon.png", 128, icon),
|
||||||
|
("apps/web/public/favicon.png", 128, icon),
|
||||||
|
("apps/web/public/favicon-dark.png", 128, dark),
|
||||||
|
]:
|
||||||
|
save(image, path, size)
|
||||||