diff --git a/public/blabla-npcs.json b/public/blabla-npcs.json new file mode 100644 index 0000000..2dc6210 --- /dev/null +++ b/public/blabla-npcs.json @@ -0,0 +1,89 @@ +[ + ["marian", "si_c013_00_s"], + + ["male generic", "si_c911_00_s"], + ["female generic", "si_c912_00_s"], + + ["male commander", "si_c916_00_s"], + ["female commander", "si_c917_00_s"], + + ["andersen", "si_c903_00_s"], + ["andersen: soaky shower", "si_c903_01_00_s"], + ["shifty", "si_c907_00_s"], + ["shifty: old", "si_c907_01_00_s"], + ["ingrid", "si_c900_00_s"], + ["syuen", "si_c901_00_s"], + ["mustang", "si_c902_00_s"], + + ["einkk", "si_c928_00_s"], + ["enikk", "si_c904_00_s"], + + ["burningum", "si_c914_00_s"], + ["cecil", "si_c929_00_s"], + ["doban", "si_c939_00_s"], + ["e.h.", "si_c940_00_s"], + ["johan", "si_c925_00_s"], + ["legendary commander", "si_c942_00_s"], + + ["ade", "si_c310_00_s"], + ["anachiro", "si_c944_00_s"], + ["cinderella", "si_c944_00_s"], + ["ein", "si_c391_00_s"], + ["indivilia", "si_c263_00_s"], + ["k", "si_c041_00_s"], + ["liberalio", "si_c262_00_s"], + ["liliweiss", "si_c943_00_s"], + ["mana", "si_c290_00_s"], + ["moran", "si_c281_00_s"], + ["papillion", "si_c908_00_s"], + ["pinne", "si_c941_00_s"], + ["rian", "si_c905_00_s"], + ["rouge", "si_c272_00_s"], + ["rumani", "si_c240_00_s"], + ["zwei", "si_c390_00_s"], + + ["boss: blacksmith", "si_bbg003_00_s"], + ["boss: gravedigger", "si_mbg002_00_s"], + ["boss: alteisen", "si_mbg001_00_s"], + ["boss: chatterbox", "si_bbg002_00_s"], + ["boss: land eater", "si_ebg001_00_s"], + ["boss: modernia", "si_mbg004_00_s"], + ["boss: mother whale", "si_bba001_00_s"], + ["boss: harvester", "si_bbg001_00_s"], + ["boss: material h", "si_ebg002_00_s"], + ["boss: storm bringer", "si_eba001_00_s"], + ["boss: nihilister", "si_mba002_00_s"], + ["boss: gatekeeper red", "si_eba003_hsta_00_s"], + ["boss: gatekeeper green", "si_eba003_green_00_s"], + ["boss: gatekeeper blue", "si_eba003_00_s"], + + ["angelina", "si_c934_00_s"], + ["joseph", "si_c935_00_s"], + ["beatrice", "si_c930_00_s"], + ["booboo", "si_c937_00_s"], + ["max", "si_c936_00_s"], + + ["9s", "si_c813_00_s"], + + ["aki hayakawa", "si_c804_00_s"], + ["denji", "si_c803_00_s"], + ["denji chainsaw man", "si_c803_01_00_s"], + + ["oswald", "si_c961_00_s"], + ["ruru", "si_c946_00_s"], + ["bolt", "si_c933_00_s"], + ["bolt junior", "si_c932_00_s"], + + ["mass produced red", "si_c250_00_s"], + ["mass produced blue", "si_c251_00_s"], + ["mass produced orange", "si_c252_00_s"], + ["mass produced green", "si_c253_00_s"], + ["mass produced purple", "si_c254_00_s"], + ["mass produced white", "si_c255_00_s"], + + ["rose", "si_c971_00_s"], + ["mass produced melee old", "si_c974_00_s"], + ["mass produced melee", "si_c974_01_00_s"], + + ["timi", "si_c975_00_s"] +] \ No newline at end of file diff --git a/public/fonts/AbolitionTest-Regular.ttf b/public/fonts/AbolitionTest-Regular.ttf new file mode 100644 index 0000000..d217aab Binary files /dev/null and b/public/fonts/AbolitionTest-Regular.ttf differ diff --git a/public/fonts/Voltec.ttf b/public/fonts/Voltec.ttf new file mode 100644 index 0000000..a29b7b4 Binary files /dev/null and b/public/fonts/Voltec.ttf differ diff --git a/public/fonts/desktop.ini b/public/fonts/desktop.ini deleted file mode 100644 index 11cb277..0000000 --- a/public/fonts/desktop.ini +++ /dev/null @@ -1,3 +0,0 @@ -[LocalizedFileNames] -Pretendard-ExtraBold.ttf=@Pretendard-ExtraBold.ttf,0 -Pretendard-Bold.ttf=@Pretendard-Bold.ttf,0 diff --git a/public/images/icon_blabla.png b/public/images/icon_blabla.png new file mode 100644 index 0000000..45a76a5 Binary files /dev/null and b/public/images/icon_blabla.png differ diff --git a/public/images/icon_boss.png b/public/images/icon_boss.png new file mode 100644 index 0000000..4123c58 Binary files /dev/null and b/public/images/icon_boss.png differ diff --git a/public/images/icon_dialogue.png b/public/images/icon_dialogue.png new file mode 100644 index 0000000..aaf44bb Binary files /dev/null and b/public/images/icon_dialogue.png differ diff --git a/public/images/icon_logo.png b/public/images/icon_logo.png new file mode 100644 index 0000000..e636228 Binary files /dev/null and b/public/images/icon_logo.png differ diff --git a/public/images/nikkefont/a.png b/public/images/nikkefont/a.png index e37bfb9..7ff52ae 100644 Binary files a/public/images/nikkefont/a.png and b/public/images/nikkefont/a.png differ diff --git a/public/images/nikkefont/qmark.png b/public/images/nikkefont/qmark.png index 9dd6637..4faec39 100644 Binary files a/public/images/nikkefont/qmark.png and b/public/images/nikkefont/qmark.png differ diff --git a/public/images/warning/border.png b/public/images/warning/border.png new file mode 100644 index 0000000..1f4810a Binary files /dev/null and b/public/images/warning/border.png differ diff --git a/public/images/warning/bossicon.png b/public/images/warning/bossicon.png new file mode 100644 index 0000000..c5908ab Binary files /dev/null and b/public/images/warning/bossicon.png differ diff --git a/public/images/warning/chevron.png b/public/images/warning/chevron.png new file mode 100644 index 0000000..fc51fe0 Binary files /dev/null and b/public/images/warning/chevron.png differ diff --git a/public/images/warning/hexbackdrop.png b/public/images/warning/hexbackdrop.png new file mode 100644 index 0000000..06b2247 Binary files /dev/null and b/public/images/warning/hexbackdrop.png differ diff --git a/public/images/warning/row.png b/public/images/warning/row.png new file mode 100644 index 0000000..d40a454 Binary files /dev/null and b/public/images/warning/row.png differ diff --git a/public/images/warning/row2.png b/public/images/warning/row2.png new file mode 100644 index 0000000..34e824a Binary files /dev/null and b/public/images/warning/row2.png differ diff --git a/public/images/warning/square.png b/public/images/warning/square.png new file mode 100644 index 0000000..732e2cc Binary files /dev/null and b/public/images/warning/square.png differ diff --git a/src/components/Credits.astro b/src/components/Credits.astro index 574c10d..c105da5 100644 --- a/src/components/Credits.astro +++ b/src/components/Credits.astro @@ -7,10 +7,16 @@ Caught a bug? Report it here!

- more tools: logo generator | dialogue generator | blabla generator +

+

more tools:

+ Logo Generator + Dialogue Generator + Blabla Generator + Boss Warning Generator +

- made by skuqre. more at skuqre.github.io | credits | usage | source code | update log | translation notice + made by skuqre. more at skuqre.github.io | credits | usage | source code | update log

@@ -25,4 +31,31 @@ opacity: 1; transition: opacity 0.2s ease-in-out; } + + div.toolbox { + display: flex; + margin: auto; + margin-top: 8px; + justify-content: center; + align-items: center; + gap: 16px; + } + + img.pnglink { + filter: hue-rotate(355deg); + opacity: 0.5; + scale: 1; + + transition-property: filter, opacity, scale; + transition: 0.2s ease-in-out; + } + + img.pnglink:hover { + filter: brightness(0) saturate(100%) grayscale(0) invert(82%) sepia(19%) saturate(1288%) hue-rotate(355deg) brightness(105%) contrast(91%); + opacity: 1; + scale: 1.1; + + transition-property: filter, opacity, scale; + transition: 0.2s ease-in-out; + } \ No newline at end of file diff --git a/src/components/WarningDisplay.astro b/src/components/WarningDisplay.astro new file mode 100644 index 0000000..264a2e2 --- /dev/null +++ b/src/components/WarningDisplay.astro @@ -0,0 +1,31 @@ +--- + +--- + +
+ +
+ + + + \ No newline at end of file diff --git a/src/components/WarningFields.astro b/src/components/WarningFields.astro new file mode 100644 index 0000000..e876c8c --- /dev/null +++ b/src/components/WarningFields.astro @@ -0,0 +1,235 @@ +--- + +--- + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
Background (X, Y, and Scale)
+ + + +
Boss Name (X, Y, and Size)
+ + + +
Canvas (width and height)
+ + +
+
+ + diff --git a/src/pages/blabla-npcs.astro b/src/pages/blabla-npcs.astro new file mode 100644 index 0000000..c2ebebc --- /dev/null +++ b/src/pages/blabla-npcs.astro @@ -0,0 +1,109 @@ +--- +import '../components/GlobalStyle.astro'; +import Credits from '../components/Credits.astro'; + +import npcs from '../../public/blabla-npcs.json' +--- + + + + + + + + Blabla NPCS + + + + + + + + + + + + + +

Blabla NPCs

+

All of the available Blabla NPCs are displayed here. Click their image to copy their search term.
Looking for (playable) NIKKEs? Please head to nikke.gg's character list for that!

+
+ { + npcs.map((e) => {e[0]}) + } +
+ +

Copied!

+ + + +

go back

+ + diff --git a/src/pages/blabla.astro b/src/pages/blabla.astro index 20dbb70..e032d3c 100644 --- a/src/pages/blabla.astro +++ b/src/pages/blabla.astro @@ -33,6 +33,9 @@ import Credits from '../components/Credits.astro'; creations in Safari may have the text look offset.
this is unfortunately a browser issue, nothing much I can do about it.
use a different browser, if possible. sorry! +

+ curious on what npcs can be searched?
+ look into the the blabla npc list!

diff --git a/src/pages/credits.md b/src/pages/credits.md index 638faee..229d6cf 100644 --- a/src/pages/credits.md +++ b/src/pages/credits.md @@ -6,8 +6,7 @@ embeddesc: The site's credits! # Credits -## Site -| | | +|

Site

| | | --- | --- | | **skuqre** | Programming, some research, and all that jazz. | | [**NIKKE-DB**](https://nikke-db.pages.dev) | This site uses some assets from NIKKE-DB.
Their work has been really helpful for the dialogue generator!
This site also uses their GitHub Database for character profile pictures for the BlaBla generator!!! | @@ -16,15 +15,24 @@ embeddesc: The site's credits! | [**Boxicons**](https://boxicons.com) | Some good web icons for everyone to use. No freemium bullshit. | | [**Astro**](https://astro.build) | For being dope to work with. | -
+--- -## Fonts -| | | +|

Special Thanks

| | +| --- | --- | +| **Koshirei** | Being an overall good fella on me using NIKKE-DB stuff. I didn't ask in the first place, but many thanks to you! | +| [**Boss Warning Overlay Reference**](https://www.facebook.com/groups/1103225033747263/permalink/1632637744139320/?mibextid=Nif5oz) | I won't be putting your name, just in case -- but I will be linking the Facebook post! Access to the NIKKE Global community group is required to view the page. | +| **Folks on the Official Discord, Official Reddit, and other places** | Thank you for using the tool! Your continued usage is what keeps me doing what I do. When you have something to say about the tool, let me know! | + +--- + +|

Fonts

| | | --- | --- | | [**Pretendard**](https://cactus.tistory.com/306) | Made by [Kil Hyung-jin (orioncactus)](https://github.com/orioncactus). Used throughout the site and Dialogue Generator. Found through research. | | [**Docteur Atomic**](https://www.dafont.com/docteur-atomic.font) | Made by Jonathan Paquette. Used on Logo Generator. Found through a lousy "font-surfing" session one night. | | [**Butch and Sundance**](https://www.dafont.com/butch-sundance.font) | Made by [Dan Zadorozny (Iconian Fonts)](https://www.iconian.com). Used on Logo Generator. Found through research. | | [**SUIT**](https://sun.fo/suit/) | Made by the folks at [sun.fo](https://sun.fo/). Used on the Blabla Generator. | +| [**Abolition**](https://fortfoundry.com/fonts/abolition) | Made by [Mattox Shuler (Fort Foundry)](https://fortfoundry.com). Used on Boss Warning Generator. Found through research. | +| [**Voltec (demo)**](https://typefactory.co/product/voltec-futuristic-typeface/) | Made by the folks at [TypeFactory](https://typefactory.co). Used on Boss Warning Generator. Found through research. |
@@ -48,11 +56,13 @@ Note that this is not **legal advise**, this is only my interpretation of what o
Here's how much time it took for me to make this site: -| | | + +| Tool | Duration | | --- | --- | | **Logo Generator** | About 6 hours for the base generator. About 2 more hours to get the UI up and running | | **Dialogue Generator** | About a day to get the base generator done (includes research as well). About another day or two to get the UI up and running. The UI for it is more convoluted, so... | | **Blabla Generator** | One whole day to get the beta out on time. | +| **Boss Warning Generator** | A whole day to get the base down. It was quite some time looking for the fonts... | For the sake of experience! diff --git a/src/pages/update-log.md b/src/pages/update-log.md index 410a0ec..c9ef13f 100644 --- a/src/pages/update-log.md +++ b/src/pages/update-log.md @@ -10,6 +10,35 @@ embeddesc: the update log
+## boss warning `Jan 22, 2024` + +**introducing the next tool to the roster: the boss warning generator!** + +this creates an image with the boss introduction ui overlayed onto it. barely accurate, of course. + +proper credits have been added to their specific pages! + +\- suggested by mimir from the Nikke Discord + +**general** +- transparent watermarks now have their opacity lowered even further (from 10% -> 5%) +- tool links are now icons + - prevents clutter on the bottom, plus it's easy to identify... i think. + +**blabla gen** +- added npcs + - rose + - mass produced melee old + - mass produced melee +- added the npc list! + - [go check it out](/nikke-font-generator/blabla-npcs/)! + +
+ +--- + +
+ ## profile pages `Jan 7, 2024` **blabla gen** diff --git a/src/pages/usage.md b/src/pages/usage.md index b2f7fb0..a7d1b25 100644 --- a/src/pages/usage.md +++ b/src/pages/usage.md @@ -38,6 +38,8 @@ Fonts used in this site are **not** made by me. Rightful credits are in the [cre | [**Docteur Atomic**](https://www.dafont.com/docteur-atomic.font) | Available under **personal use**. [See DAFONT page](https://www.dafont.com/docteur-atomic.font). | | [**Butch and Sundance**](https://www.dafont.com/butch-sundance.font) | Available under **donationware**. [See DAFONT page](https://www.dafont.com/butch-sundance.font). | | [**SUIT**](https://sun.fo/suit/) | Available under **SIL Open Font License 1.1**. See [LICENSE](https://scripts.sil.org/OFL). | +| [**Abolition**](https://fortfoundry.com/fonts/abolition) | Available under **personal use**. [See FortFoundry page](https://fortfoundry.com/fonts/abolition). | +| [**Voltec (demo)**](https://typefactory.co/product/voltec-futuristic-typeface/) | Available under **personal use**. [See TypeFactory page](https://typefactory.co/product/voltec-futuristic-typeface/). |
@@ -47,6 +49,8 @@ Fonts used in this site are **not** made by me. Rightful credits are in the [cre **This site is not endorsed by, created by, or affiliated with SHIFT UP CORP. and Proxima Beta Ltd.**
**All characters and assets belong to SHIFT UP CORP. and Proxima Beta Ltd.** +**No revenue is being generated from this site. Moreover, there is no way to + If you have other concerns about the site, you can contact me through: - Reddit ([`u/ANISNO1`](https://reddit.com/u/ANISNO1)) - Discord (send a message request to `@skuqre`) diff --git a/src/pages/warning.astro b/src/pages/warning.astro new file mode 100644 index 0000000..bb46c6d --- /dev/null +++ b/src/pages/warning.astro @@ -0,0 +1,36 @@ +--- +import '../components/GlobalStyle.astro'; +import WarningDisplay from '../components/WarningDisplay.astro'; +import WarningFields from '../components/WarningFields.astro'; +import Credits from '../components/Credits.astro'; +--- + + + + + + + + Barely Accurate NIKKE Boss Warning Generator + + + + + + + + + + + +

Barely Accurate NIKKE Boss Warning Generator

+ +

Generated output you see may be barely accurate to inaccurate to official media.
Click the image for a fast download!

+ + + + + + + + diff --git a/src/scripts/blabla.js b/src/scripts/blabla.js index 1bbff87..1f1bea6 100644 --- a/src/scripts/blabla.js +++ b/src/scripts/blabla.js @@ -73,89 +73,13 @@ response.json().then((e) => { for (let i = 0; i < e.length; i++) { nikkepfps[e[i].name.toLowerCase()] = e[i].img; } +}); - nikkepfps['marian'] = 'si_c013_00_s'; - - nikkepfps['male generic'] = 'si_c911_00_s'; - nikkepfps['female generic'] = 'si_c912_00_s'; - - nikkepfps['male commander'] = 'si_c916_00_s'; - nikkepfps['female commander'] = 'si_c917_00_s'; - - nikkepfps['andersen'] = 'si_c903_00_s'; - nikkepfps['andersen: soaky shower'] = 'si_c903_01_00_s'; - nikkepfps['shifty'] = 'si_c907_00_s'; - nikkepfps['shifty: old'] = 'si_c907_01_00_s'; - nikkepfps['ingrid'] = 'si_c900_00_s'; - nikkepfps['syuen'] = 'si_c901_00_s'; - nikkepfps['mustang'] = 'si_c902_00_s'; - - nikkepfps['einkk'] = 'si_c928_00_s'; - nikkepfps['enikk'] = 'si_c904_00_s'; - - nikkepfps['burningum'] = 'si_c914_00_s'; - nikkepfps['cecil'] = 'si_c929_00_s'; - nikkepfps['doban'] = 'si_c939_00_s'; - nikkepfps['e.h.'] = 'si_c940_00_s'; - nikkepfps['johan'] = 'si_c925_00_s'; - nikkepfps['legendary commander'] = 'si_c942_00_s'; - - nikkepfps['ade'] = 'si_c310_00_s'; - nikkepfps['anachiro'] = 'si_c944_00_s'; - nikkepfps['cinderella'] = 'si_c944_00_s'; - nikkepfps['ein'] = 'si_c391_00_s'; - nikkepfps['indivilia'] = 'si_c263_00_s'; - nikkepfps['k'] = 'si_c041_00_s'; - nikkepfps['leona'] = 'si_c382_00_s'; - nikkepfps['liberalio'] = 'si_c262_00_s'; - nikkepfps['liliweiss'] = 'si_c943_00_s'; - nikkepfps['mana'] = 'si_c290_00_s'; - nikkepfps['moran'] = 'si_c281_00_s'; - nikkepfps['papillion'] = 'si_c908_00_s'; - nikkepfps['pinne'] = 'si_c941_00_s'; - nikkepfps['rian'] = 'si_c905_00_s'; - nikkepfps['rouge'] = 'si_c272_00_s'; - nikkepfps['rumani'] = 'si_c240_00_s'; - nikkepfps['zwei'] = 'si_c390_00_s'; - - nikkepfps['boss: blacksmith'] = 'si_bbg003_00_s'; - nikkepfps['boss: gravedigger'] = 'si_mbg002_00_s'; - nikkepfps['boss: alteisen'] = 'si_mbg001_00_s'; - nikkepfps['boss: chatterbox'] = 'si_bbg002_00_s'; - nikkepfps['boss: land eater'] = 'si_ebg001_00_s'; - nikkepfps['boss: modernia'] = 'si_mbg004_00_s'; - nikkepfps['boss: mother whale'] = 'si_bba001_00_s'; - nikkepfps['boss: harvester'] = 'si_bbg001_00_s'; - nikkepfps['boss: material h'] = 'si_ebg002_00_s'; - nikkepfps['boss: storm bringer'] = 'si_eba001_00_s'; - nikkepfps['boss: nihilister'] = 'si_mba002_00_s'; - nikkepfps['boss: gatekeeper red'] = 'si_eba003_hsta_00_s'; - nikkepfps['boss: gatekeeper green'] = 'si_eba003_green_00_s'; - nikkepfps['boss: gatekeeper blue'] = 'si_eba003_00_s'; - - nikkepfps['angelina'] = 'si_c934_00_s'; - nikkepfps['joseph'] = 'si_c935_00_s'; - nikkepfps['beatrice'] = 'si_c930_00_s'; - nikkepfps['booboo'] = 'si_c937_00_s'; - nikkepfps['max'] = 'si_c936_00_s'; - - nikkepfps['9s'] = 'si_c813_00_s'; - - nikkepfps['aki hayakawa'] = 'si_c804_00_s'; - nikkepfps['denji'] = 'si_c803_00_s'; - nikkepfps['denji chainsaw man'] = 'si_c803_01_00_s'; - - nikkepfps['oswald'] = 'si_c961_00_s'; - nikkepfps['ruru'] = 'si_c946_00_s'; - nikkepfps['bolt'] = 'si_c933_00_s'; - nikkepfps['bolt junior'] = 'si_c932_00_s' - - nikkepfps['mass produced red'] = 'si_c250_00_s'; - nikkepfps['mass produced blue'] = 'si_c251_00_s'; - nikkepfps['mass produced orange'] = 'si_c252_00_s'; - nikkepfps['mass produced green'] = 'si_c253_00_s'; - nikkepfps['mass produced purple'] = 'si_c254_00_s'; - nikkepfps['mass produced white'] = 'si_c255_00_s'; +const response2 = await fetch('/nikke-font-generator/blabla-npcs.json'); +response2.json().then((e) => { + for (let i = 0; i < e.length; i++) { + nikkepfps[e[i][0]] = e[i][1]; + } }); let top = new Image(); diff --git a/src/scripts/dialogue.js b/src/scripts/dialogue.js index 2907daa..1e29344 100644 --- a/src/scripts/dialogue.js +++ b/src/scripts/dialogue.js @@ -1216,7 +1216,7 @@ function generateText(text, subtext, exporting=false) { ctx.drawImage(controls, copos[0], copos[1], controls.width * scaledc / 100, controls.height * scaledc / 100); } - ctx.globalAlpha = 0.1; + ctx.globalAlpha = 0.05; ctx.drawImage(wmrk, 16, -16, 128, 128); } else { drawGradients(true); diff --git a/src/scripts/util.js b/src/scripts/util.js index cb81396..41067c7 100644 --- a/src/scripts/util.js +++ b/src/scripts/util.js @@ -10,7 +10,7 @@ export function draw9slice(ctx, img2, squareslice, x, y, w, h, color = "#ffffff" ctxTemp.fillRect(0, 0, canvasTemp.width, canvasTemp.height); ctxTemp.globalCompositeOperation = "destination-in"; } - + ctxTemp.drawImage(img2, 0, 0); ctxTemp.globalCompositeOperation = "source-over"; @@ -51,11 +51,15 @@ export const wifiOffI = ``; export function dataURLtoFile(dataurl, filename) { var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1], - bstr = atob(arr[arr.length - 1]), - n = bstr.length, + bstr = atob(arr[arr.length - 1]), + n = bstr.length, u8arr = new Uint8Array(n); - while(n--){ + while (n--) { u8arr[n] = bstr.charCodeAt(n); } - return new File([u8arr], filename, {type:mime}); + return new File([u8arr], filename, { type: mime }); +} + +export function getRandomArbitrary(min, max) { + return Math.random() * (max - min) + min; } \ No newline at end of file diff --git a/src/scripts/warning.js b/src/scripts/warning.js new file mode 100644 index 0000000..568730f --- /dev/null +++ b/src/scripts/warning.js @@ -0,0 +1,253 @@ +import { getRandomArbitrary, draw9slice } from "./util.js"; + +const canvas = document.getElementById("warning-canvas"); +const ctx = canvas.getContext("2d"); + +const myFont = new FontFace('VOLT', "url('/nikke-font-generator/fonts/Voltec.ttf')"); +await myFont.load(); +document.fonts.add(myFont); + +const myFont2 = new FontFace('ABOL', "url('/nikke-font-generator/fonts/AbolitionTest-Regular.ttf')"); +await myFont2.load(); +document.fonts.add(myFont2); + +let hexbg = new Image(); +hexbg.crossOrigin = "anonymous"; +hexbg.src = `/nikke-font-generator/images/warning/hexbackdrop.png`; + +let row = new Image(); +row.crossOrigin = "anonymous"; +row.src = `/nikke-font-generator/images/warning/row.png`; + +let row2 = new Image(); +row2.crossOrigin = "anonymous"; +row2.src = `/nikke-font-generator/images/warning/row2.png`; + +let square = new Image(); +square.crossOrigin = "anonymous"; +square.src = `/nikke-font-generator/images/warning/square.png`; + +let bossicon = new Image(); +bossicon.crossOrigin = "anonymous"; +bossicon.src = `/nikke-font-generator/images/warning/bossicon.png`; + +let border = new Image(); +border.crossOrigin = "anonymous"; +border.src = `/nikke-font-generator/images/warning/border.png`; + +let wmrk = new Image(); +wmrk.crossOrigin = "anonymous"; +wmrk.src = `/nikke-font-generator/favicon.png`; + +let bossnames = [ + "Modernia", + "Chatterbox", + "Alteisen Mk. VI", + "Alexander", + "Doro", + "Land Eater", + "Gatekeeper", + "Alexander Alteisen Vanburen the Fiftysixth", + "Storm Bringer", + "Grave Digger", + "Blacksmith", + "Kraken", + "Mother Whale", + "Dororong", + "Ordinary Recruitment", + "Advanced Recruitment", + "At least 9 Rs", + "10 Rs", + "400 pulls and not a single SSR", + "Maxwell", + "Matis", + "Drake", + "Material H", + "Your Wallet", + "Your Credit Card", + "Syuen", + "Harvester", + "\"Yet Another Heretic\"" +] + +var text = bossnames[Math.round(Math.random() * (bossnames.length - 1))]; +var subtext = "WARNING" + +var defRowVal = getRandomArbitrary(-50, 0); +var defRow2Val = getRandomArbitrary(-25, 0); +var defHexWidth = getRandomArbitrary(-100, 0); +var defWarnWidth = getRandomArbitrary(-100, 100); + +var bnshit = [-8, 357, 117] +var bgpos = [0, 0]; + +var bg = new Image(); +var scalebg = 100; + +setTimeout(() => { + drawBossText(); +}, 1000) + +function drawBossText() { + ctx.clearRect(0, 0, canvas.width, canvas.height); + let ch = canvas.height / 1080; + + ctx.drawImage(bg, bgpos[0], bgpos[1], bg.width * scalebg / 100, bg.height * scalebg / 100) + + var curHexWidth = defHexWidth; + ctx.globalAlpha = 0.5; + while (curHexWidth < canvas.width) { + ctx.drawImage(hexbg, curHexWidth, 822 * ch - hexbg.height / 2); + curHexWidth += hexbg.width; + } + ctx.globalAlpha = 1.0; + + var curRowWidth = defRowVal; + var curRow2Width = defRow2Val; + while (curRowWidth < canvas.width) { + ctx.drawImage(row, curRowWidth, 822 * ch + 29); + curRowWidth += row.width; + } + while (curRow2Width < canvas.width) { + ctx.drawImage(row2, curRow2Width, 822 * ch - 29 - row2.height); + curRow2Width += row2.width; + } + + var curWarnWidth = defWarnWidth; + while (curWarnWidth < canvas.width) { + + ctx.font = "45px ABOL"; + ctx.textAlign = "left"; + ctx.textBaseline = "middle"; + + ctx.globalAlpha = 0.5; + ctx.fillStyle = "#000000"; + ctx.fillText(subtext, curWarnWidth + 2, 821 * ch); + ctx.globalAlpha = 1; + ctx.fillStyle = "#ff0000"; + ctx.fillText(subtext, curWarnWidth, 819 * ch); + + curWarnWidth += ctx.measureText(subtext).width + 115; + } + + + ctx.drawImage(square, (canvas.width - square.width) / 2, (822 * ch - square.height / 2)); + ctx.drawImage(bossicon, (canvas.width - 150) / 2, (822 * ch - 160 / 2), 150, 160); + + ctx.save(); + ctx.translate(canvas.width / 2 + bnshit[0], canvas.height / 2 + bnshit[1] * ch); + ctx.rotate(-0.139626); + ctx.font = bnshit[2] + "px VOLT"; + ctx.textAlign = "center"; + ctx.textBaseline = "top"; + + ctx.fillStyle = "#000000"; + ctx.globalAlpha = 0.4; + ctx.fillText(text, 4, 4); + ctx.globalAlpha = 1.0; + + ctx.fillStyle = "#ee0200"; + ctx.fillText(text, 0, 0); + + ctx.restore(); + + draw9slice(ctx, border, [38, 38, 2, 2], 0, 0, canvas.width, canvas.height); + + ctx.globalAlpha = 0.05; + ctx.drawImage(wmrk, 16, -16, 128, 128); + ctx.globalAlpha = 1; + + document.getElementById("xposbn").value = bnshit[0]; + document.getElementById("yposbn").value = bnshit[1]; + document.getElementById("scalebn").value = bnshit[2]; + + document.getElementById("xposbg").value = bgpos[0]; + document.getElementById("yposbg").value = bgpos[1]; + document.getElementById("scalebg").value = scalebg; +} + +document.getElementById("text").oninput = (_) => { + text = document.getElementById("text").value; + drawBossText(); +} + +document.getElementById("subtext").oninput = (_) => { + subtext = document.getElementById("subtext").value; + drawBossText(); +} + +document.getElementById("wcanvas").oninput = (_) => { + canvas.width = parseInt(document.getElementById("wcanvas").value); + drawBossText(); +} + +document.getElementById("hcanvas").oninput = (_) => { + canvas.height = parseInt(document.getElementById("hcanvas").value); + drawBossText(); +} +document.getElementById("xposbn").oninput = (_) => { + bnshit[0] = parseInt(document.getElementById("xposbn").value) + drawBossText(); +} +document.getElementById("yposbn").oninput = (_) => { + bnshit[1] = parseInt(document.getElementById("yposbn").value) + drawBossText(); +} +document.getElementById("scalebn").oninput = (_) => { + bnshit[2] = parseInt(document.getElementById("scalebn").value) + drawBossText(); +} + +document.querySelectorAll('#bg-img-up')[0].addEventListener('change', () => { + const fileList = document.querySelectorAll('#bg-img-up')[0].files; + const filer = new FileReader(); + filer.onload = (e) => { + bg.src = e.target.result; + bg.onload = (e) => { + if (bg.width > bg.height) { + scalebg = (canvas.height / bg.height) * 100; + document.getElementById('scalebg').value = parseInt(scalebg); + bgpos = [(canvas.width - 1080 * (bg.width / bg.height)) / 2, 0]; + } else { + scalebg = (canvas.width / bg.width) * 100; + document.getElementById('scalebg').value = parseInt(scalebg); + bgpos = [0, 0]; + } + + drawBossText(); + } + }; + if (fileList.length > 0) { + filer.readAsDataURL(fileList[0]); + } +}); + +document.getElementById("xposbg").oninput = (_) => { + bgpos[0] = parseInt(document.getElementById("xposbg").value); + drawBossText(); +}; +document.getElementById("yposbg").oninput = (_) => { + bgpos[1] = parseInt(document.getElementById("yposbg").value); + drawBossText(); +}; +document.getElementById("scalebg").oninput = (_) => { + scalebg = parseInt(document.getElementById("scalebg").value); + drawBossText(); +}; + + + +// window.addEventListener('keydown', (e) => { +// switch (e.key.toLowerCase()) { +// case 'd': +// canvas.width += 10; break; +// case 'a': +// canvas.width -= 10; break; +// case 'w': +// canvas.height -= 10; break; +// case 's': +// canvas.height += 10; break; +// } + +// drawBossText(); +// }) \ No newline at end of file