Skip to content

Commit

Permalink
Misato Katsuragi (#5)
Browse files Browse the repository at this point in the history
* Initial Misato

* Updated changelog and bumped version to v2.0.0

* Updated manifest version

* Is this right?

* Restored high res

* Cleaning up before writing high res

* Updated changelog

* Bump manifest version to 2.0

* Added set the version once and the build takes care of the rest

* Why can't i do anything right?

* Added a pr template so I can remember things that need to be done
  • Loading branch information
Unthrottled authored Jul 13, 2020
1 parent b9125ee commit 67f4a01
Show file tree
Hide file tree
Showing 99 changed files with 612 additions and 127 deletions.
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Bug Report
about: Create a report to help me improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
<!-- A clear and concise description of what the bug is. -->

**To Reproduce**
<!-- Steps to reproduce the behavior -->
1.

**Expected Behavior**
<!-- A clear and concise description of what you expected to happen. -->

**Environment**
<!-- Please go to *IntelliJ IDEA -> About IntelliJ IDEA (Mac)* or *Help -> About IntelliJ IDEA (Windows)* and copy the infos
to the clipboard and paste it here.
It should contain:
* OS (Windows, Linux, Mac)
* IntelliJ Product + version (IDEA, RubyMine...)
* Plugin version
* If needed a list of enabled plugins -->


**Screenshots**
<!-- If applicable, add screenshots to help explain your problem. -->
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
27 changes: 27 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!-- Provide a general summary of your changes in the Title above -->

#### Description
<!-- Describe your changes in detail -->

#### Motivation and Context
<!-- Why is this change required? What problem does it solve? -->
<!-- If it fixes an open issue, please link to the issue here. -->

#### How Has This Been Tested?
<!-- Please describe in detail how you tested your changes. -->
<!-- See how your change affects other areas of the code, etc. -->

#### Screenshots (if appropriate):

#### Types of changes
<!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Non-Functional Change (non-user facing changes)

#### Checklist:
<!-- Go over all the following points, and put an `x` in all the boxes . -->
<!-- If you're unsure about any of these, don't hesitate to ask. I'm here to help! -->
- [ ] I updated the version (base package.json and re-built the master extension).
- [ ] I updated the changelog with the new functionality.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Changelog
---

# 3.0.0 [Misato Katsuragi]

- Added Neon Genesis Evangelion's `Misato Katsuragi` as a dark theme!
- Actually adding all 2560x1440 background images rather than some of them.

![The New Woman](https://doki.assets.unthrottled.io/misc/v9_girl.png?version=1)

# 2.0.0 [Full Edge Support]

- While it is not automatic, you can get the full Doki Theme experience in Microsoft Edge now!
Expand Down
14 changes: 7 additions & 7 deletions buildAssets/templates/manifest.template.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "The Doki Theme",
"version": "1.0",
"version": "3.0.0",
"description": "Anime based themes for your chrome browser!",
"theme": {
"images" : {
"theme_ntp_background" : "",
"theme_ntp_background_incognito" : "",
"images": {
"theme_ntp_background": "",
"theme_ntp_background_incognito": "",
"theme_toolbar": "images/tab_highlight.png",
"theme_tab_background": "images/tab_inactive.png"
},
Expand All @@ -31,10 +31,10 @@
"buttons": "&accentColor&",
"frame": "&accentColor&"
},
"properties" : {
"ntp_background_alignment" : "center",
"properties": {
"ntp_background_alignment": "center",
"ntp_logo_alternate": 0
}
},
"manifest_version": 2
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"id": "8e8773ee-4bbb-4812-b311-005f04f6bb20",
"overrides": {
"theme": {
"colors": {
"omnibox_text": "&keywordColor&"
}
}
},
"laf": {},
"syntax": {},
"colors": {}
}
104 changes: 66 additions & 38 deletions buildSrc/src/BuildThemes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -466,37 +466,61 @@ function buildActiveTabImage(tabHeight: number, highlightColor: number, accentCo
type ChromeDokiTheme = { path: string; manifest: ManifestTemplate; definition: MasterDokiThemeDefinition; theme: {} }

function buildThemeDirectoryStruct(
theme: ChromeDokiTheme,
tabHeight: number,
backgroundDirectory: string,
themeDirectory: string,
manifestDecorator: (manifest: ManifestTemplate) => ManifestTemplate = m => m
theme: ChromeDokiTheme,
tabHeight: number,
backgroundDirectory: string,
themeDirectory: string,
manifestDecorator: (manifest: ManifestTemplate) => ManifestTemplate = m => m
): Promise<void> {

fs.mkdirSync(backgroundDirectory, {recursive: true});
//write manifest
fs.writeFileSync(
path.resolve(themeDirectory, 'manifest.json'),
JSON.stringify(manifestDecorator(theme.manifest), null, 2)
path.resolve(themeDirectory, 'manifest.json'),
JSON.stringify(manifestDecorator(theme.manifest), null, 2)
);

const colors = theme.definition.colors;
const highlightColor = jimp.cssColorToHex(colors.highlightColor)
const accentColor = jimp.cssColorToHex(colors.accentColor)
return buildActiveTabImage(
tabHeight,
highlightColor,
accentColor,
backgroundDirectory
tabHeight,
highlightColor,
accentColor,
backgroundDirectory
)
.then(() => buildInactiveTabImage(theme, backgroundDirectory))
.then(() => buildInactiveTabImage(theme, backgroundDirectory))
}

function getBackgroundDirectory(themeDirectory: string) {
return path.resolve(themeDirectory, 'images');
}

walkDir(chromeDefinitionDirectoryPath)
function overrideVersion(masterExtensionPackageJson: string, masterVersion: any) {
fs.writeFileSync(
masterExtensionPackageJson,
JSON.stringify({
...JSON.parse(fs.readFileSync(masterExtensionPackageJson, {encoding: 'utf-8'})),
version: masterVersion.version,
}, null, 2)
)
}


function preBuild(): Promise<void> {
// write versions
const masterVersion = JSON.parse(fs.readFileSync(path.resolve(repoDirectory, 'package.json'), {encoding: 'utf-8'}));
const themeManifestTemplate = path.resolve(chromeTemplateDefinitionDirectoryPath, 'manifest.template.json');
overrideVersion(themeManifestTemplate, masterVersion)
const masterExtensionPackageJson = path.resolve(repoDirectory, 'masterExtension', 'package.json');
overrideVersion(masterExtensionPackageJson, masterVersion);
const masterExtensionManifest = path.resolve(repoDirectory, 'masterExtension', 'public', 'manifest.json');
overrideVersion(masterExtensionManifest, masterVersion)
return Promise.resolve()
}

preBuild()
.then(() => walkDir(chromeDefinitionDirectoryPath))
.then((files) =>
files.filter((file) => file.endsWith("chrome.definition.json"))
)
Expand Down Expand Up @@ -579,20 +603,20 @@ walkDir(chromeDefinitionDirectoryPath)
const stickers = getStickers(theme.definition, theme);
const themeDirectoryName = `${theme.definition.name}'s Theme`;
const themeDirectory = path.resolve(
generatedThemesDirectory,
themeDirectoryName
generatedThemesDirectory,
themeDirectoryName
);
const backgroundDirectory = getBackgroundDirectory(themeDirectory);

const edgeThemeDirectory = path.resolve(
edgeGeneratedThemesDirectory,
themeDirectoryName
edgeGeneratedThemesDirectory,
themeDirectoryName
)
return buildThemeDirectoryStruct(
theme,
tabHeight,
backgroundDirectory,
themeDirectory,
theme,
tabHeight,
backgroundDirectory,
themeDirectory,
)
.then(() => buildThemeDirectoryStruct(
theme,
Expand All @@ -619,23 +643,27 @@ walkDir(chromeDefinitionDirectoryPath)
].filter(hiResWaifu => fs.existsSync(hiResWaifu))[0];
if (highResTheme) {
const highResThemeDirectory = path.resolve(hiResGeneratedThemesDirectory, themeDirectoryName);
return new Promise((resolve, reject) => {
ncp(themeDirectory, highResThemeDirectory, {
clobber: true,
}, (err: Error[] | null) => {
if (err) {
console.log(err)
reject(err)
} else {
const highResbackgroundDirectory = path.resolve(highResThemeDirectory, 'images');
fs.copyFileSync(
highResTheme,
path.resolve(highResbackgroundDirectory, path.basename(highResTheme))
)
resolve()
}
})
})
return walkDir(highResThemeDirectory)
.then(items => items.forEach(item => fs.unlinkSync(item)))
.then(() => new Promise((resolve, reject) => {
ncp(themeDirectory, highResThemeDirectory, {
clobber: false,
}, (err: Error[] | null) => {
if (err) {
console.log(err)
reject(err)
} else {
const highResBackgroundDirectory = path.resolve(highResThemeDirectory, 'images');
const highResFile = path.resolve(highResBackgroundDirectory, path.basename(highResTheme));
fs.copyFileSync(
highResTheme,
highResFile
)
resolve()
}
})
})
)
} else {
return Promise.resolve()
}
Expand Down
2 changes: 1 addition & 1 deletion chromeThemes/Asuna's Theme/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Doki Theme: Asuna",
"version": "1.0",
"version": "3.0.0",
"description": "A light theme modeled after Asuna from Sword Art Online",
"theme": {
"images": {
Expand Down
2 changes: 1 addition & 1 deletion chromeThemes/Beatrice's Theme/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Doki Theme: Beatrice",
"version": "1.0",
"version": "3.0.0",
"description": "A light theme modeled after Beatrice from Re Zero",
"theme": {
"images": {
Expand Down
2 changes: 1 addition & 1 deletion chromeThemes/Darkness Dark's Theme/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Doki Theme: Darkness Dark",
"version": "1.0",
"version": "3.0.0",
"description": "A dark theme modeled after Darkness from KonoSuba",
"theme": {
"images": {
Expand Down
2 changes: 1 addition & 1 deletion chromeThemes/Darkness Light's Theme/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Doki Theme: Darkness Light",
"version": "1.0",
"version": "3.0.0",
"description": "A light theme modeled after Darkness from KonoSuba",
"theme": {
"images": {
Expand Down
2 changes: 1 addition & 1 deletion chromeThemes/Emilia Dark's Theme/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Doki Theme: Emilia Dark",
"version": "1.0",
"version": "3.0.0",
"description": "A dark theme modeled after Emilia from Re Zero",
"theme": {
"images": {
Expand Down
2 changes: 1 addition & 1 deletion chromeThemes/Emilia Light's Theme/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Doki Theme: Emilia Light",
"version": "1.0",
"version": "3.0.0",
"description": "A light theme modeled after Emilia from Re Zero",
"theme": {
"images": {
Expand Down
2 changes: 1 addition & 1 deletion chromeThemes/Hatsune Miku's Theme/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Doki Theme: Hatsune Miku",
"version": "1.0",
"version": "3.0.0",
"description": "A dark theme modeled after Miku from Miscellaneous",
"theme": {
"images": {
Expand Down
2 changes: 1 addition & 1 deletion chromeThemes/Konata's Theme/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Doki Theme: Konata",
"version": "1.0",
"version": "3.0.0",
"description": "A light theme modeled after Konata from Lucky Star",
"theme": {
"images": {
Expand Down
2 changes: 1 addition & 1 deletion chromeThemes/Megumin's Theme/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Doki Theme: Megumin",
"version": "1.0",
"version": "3.0.0",
"description": "A dark theme modeled after Megumin from KonoSuba",
"theme": {
"images": {
Expand Down
2 changes: 1 addition & 1 deletion chromeThemes/Mioda Ibuki Dark's Theme/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Doki Theme: Mioda Ibuki Dark",
"version": "1.0",
"version": "3.0.0",
"description": "A dark theme modeled after Ibuki from DanganRonpa",
"theme": {
"images": {
Expand Down
2 changes: 1 addition & 1 deletion chromeThemes/Mioda Ibuki Light's Theme/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Doki Theme: Mioda Ibuki Light",
"version": "1.0",
"version": "3.0.0",
"description": "A light theme modeled after Ibuki from DanganRonpa",
"theme": {
"images": {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 67f4a01

Please sign in to comment.