Skip to content

Commit

Permalink
Support configurable branding of graphics
Browse files Browse the repository at this point in the history
Allows the image and icon folders to be set as part of the branding
configuration.
  • Loading branch information
llewelld committed Apr 26, 2022
1 parent 690bebf commit 85af22f
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 16 deletions.
6 changes: 5 additions & 1 deletion branding.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,9 @@
"support-url": "https://askubuntu.com/questions/tagged/ubuntu-touch",
"contact-name": "Telegram",
"contact-url": "https://t.me/WelcomePlus",
"update-url": "https://api.github.com/repos/ubports/ubports-installer/releases/latest"
"update-url": "https://api.github.com/repos/ubports/ubports-installer/releases/latest",
"screens": "public/screens",
"images": "public/img",
"icons": "build/icons/",
"logo": "yumi.svg"
}
8 changes: 6 additions & 2 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,13 @@ var buildConfig = {
publish: [],
files: [
"src/**/*",
"public/**/*",
"public/*",
"public/build/**/*",
"public/fonts/**/*",
`${branding.screens}/**/*`,
`${branding.images}/**/*`,
"node_modules/**/*",
"build/icons/icon.*",
`${branding.icons}/icon.*`,
"branding.json",
// exclude binaries for other operating systems
...PLATFORMS.filter(p => p !== opts.os).map(
Expand Down
5 changes: 3 additions & 2 deletions src/ui/modals/specific-modals/DeveloperModeModal.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script>
import { createEventDispatcher } from "svelte";
import Modal from "./Modal.svelte";
import branding from "../../../../branding.json";
const dispatch = createEventDispatcher();
const close = () => dispatch("close");
Expand Down Expand Up @@ -41,7 +42,7 @@
</div>
<div class="col-6">
<img
src="./screens/ubuntu-dev-mode.gif"
src="../{branding.screens}/ubuntu-dev-mode.gif"
alt="ubuntu-dev-mode"
style="width: 100%"
/>
Expand Down Expand Up @@ -83,7 +84,7 @@
</div>
<div class="col-6">
<img
src="./screens/android-dev-mode.gif"
src="../{branding.screens}/android-dev-mode.gif"
alt="android-dev-mode"
style="width: 100%"
/>
Expand Down
5 changes: 3 additions & 2 deletions src/ui/partials/Animation.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import { tsParticles } from "tsparticles";
import CircuitBoard from "./CircuitBoard.svelte";
import Squares from "./Squares.svelte";
import branding from "../../../branding.json";
onMount(updateAnimations);
animationType.subscribe(updateAnimations);
Expand Down Expand Up @@ -98,12 +99,12 @@
}
.download-animation {
background-image: url("../img/arrow-down.png");
background-image: url("../../{branding.images}/arrow-down.png");
animation: download-animation 8s linear infinite;
}
.push-animation {
background-image: url("../img/arrow-right.png");
background-image: url("../../{branding.images}/arrow-right.png");
animation: push-animation 10s linear infinite;
}
Expand Down
4 changes: 3 additions & 1 deletion src/ui/partials/Yumi.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<script>
import branding from "../../../branding.json";
let ubpRobotFoot = true;
let ubpRobotSide = false;
Expand Down Expand Up @@ -26,7 +28,7 @@
</script>

<img
src="./img/yumi.svg"
src="../{branding.images}/{branding.logo}"
alt="yumi"
class="yumi"
class:yumi-foot={ubpRobotFoot}
Expand Down
2 changes: 1 addition & 1 deletion src/ui/views/Done.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<div class="row">
<div class="col-6">
<img
src="./screens/Screen6.jpg"
src="../{branding.screens}/Screen6.jpg"
alt="Screen6"
style="height: 350px; margin: auto; display: block;"
/>
Expand Down
3 changes: 2 additions & 1 deletion src/ui/views/ManualDownload.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
manualDownloadGroup,
eventObject
} from "../../stores.mjs";
import branding from "../../../branding.json";
let downloadedFile;
Expand All @@ -18,7 +19,7 @@
<div class="row">
<div class="col-6">
<img
src="./screens/Screen6.jpg"
src="../{branding.screens}/Screen6.jpg"
alt="Screen6"
style="height: 350px; margin: auto; display: block;"
/>
Expand Down
2 changes: 1 addition & 1 deletion src/ui/views/NotSupported.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div class="row">
<div class="col-6">
<img
src="./screens/Screen5.jpg"
src="../{branding.screens}/Screen5.jpg"
alt="Screen5"
style="height: 350px; margin: auto; display: block;"
/>
Expand Down
4 changes: 2 additions & 2 deletions src/ui/views/SelectOs.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script>
const { ipcRenderer } = require("electron");
const branding = require("../../../branding.json");
import branding from "../../../branding.json";
import {
osSelectOptions,
Expand All @@ -18,7 +18,7 @@
<div class="row">
<div class="col-6">
<img
src="./screens/Screen6.jpg"
src="../{branding.screens}/Screen6.jpg"
alt="Screen6"
style="height: 350px; margin: auto; display: flex;"
/>
Expand Down
5 changes: 3 additions & 2 deletions src/ui/views/UserAction.svelte
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<script>
import { userActionEventObject, actionData } from "../../stores.mjs";
import branding from "../../../branding.json";
</script>

<div class="row">
<div class="col-6">
<img
src={$actionData.image
? `./img/${$actionData.image}.jpg`
: "./screens/Screen6.jpg"}
? `../${branding.images}/${$actionData.image}.jpg`
: `../${branding.screens}/Screen6.jpg`}
alt="Screen6"
style="height: 350px; margin: auto; display: block;"
/>
Expand Down
2 changes: 1 addition & 1 deletion src/ui/views/WaitForDevice.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<div class="row">
<div class="col-6">
<img
src="./screens/Screen1.jpg"
src="../{branding.screens}/Screen1.jpg"
alt="screen1"
style="height: 350px; margin: auto;"
/>
Expand Down

0 comments on commit 85af22f

Please sign in to comment.