fix: style

master
nulla2011 1 year ago
parent dd0a6c520a
commit 6e0af718f4

@ -4,6 +4,12 @@ A logo generater using canvas & Vanilla js.
## Used Fonts ## Used Fonts
[RoG2サンセリフStd B](https://www.morisawa.co.jp/fonts/specimen/1646) (Made some modifications.) * [RoG2サンセリフStd B](https://www.morisawa.co.jp/fonts/specimen/1646) (Modded)
[Wêlai Glow Sans Heavy](https://github.com/welai/glow-sans) * [Wêlai Glow Sans Heavy](https://github.com/welai/glow-sans)
## Todo
* Support Hangul
* Slice font

@ -14,7 +14,7 @@
<h1 class="i18n mt-24 mb-20 text-center font-bold" data-i18n="title">BlueArchive-Style Logo Generater</h1> <h1 class="i18n mt-24 mb-20 text-center font-bold" data-i18n="title">BlueArchive-Style Logo Generater</h1>
</header> </header>
<section class="canvas-wrapper flex place-content-center"> <section class="canvas-wrapper flex place-content-center">
<div class="relative"> <div class="relative my-auto">
<canvas id="canvas" height="250" width="900"></canvas> <canvas id="canvas" height="250" width="900"></canvas>
<div id='loading' class="absolute w-full h-full top-0 left-0 backdrop-blur-sm bg-slate-400/5 z-50 hidden"> <div id='loading' class="absolute w-full h-full top-0 left-0 backdrop-blur-sm bg-slate-400/5 z-50 hidden">
<div class="flex place-content-center h-full"> <div class="flex place-content-center h-full">
@ -44,7 +44,7 @@
<div class="collapse-content"> <div class="collapse-content">
<div class="i18n" data-i18n="halo-cross">Halo & Cross position</div> <div class="i18n" data-i18n="halo-cross">Halo & Cross position</div>
<div class="flex justify-evenly my-4"> <div class="flex justify-evenly my-4">
<span class="flex-1"><span class="mr-2">X</span><input type="number" placeholder="Type here" value="-18" <span class="flex-1"><span class="mr-2">X</span><input type="number" placeholder="Type here" value="-15"
class="input input-bordered input-sm input-primary w-32 mr-2" id="graphX" /></span> class="input input-bordered input-sm input-primary w-32 mr-2" id="graphX" /></span>
<span class="flex-1"><span class="mr-2">Y</span><input type="number" placeholder="Type here" value="0" <span class="flex-1"><span class="mr-2">Y</span><input type="number" placeholder="Type here" value="0"
class="input input-bordered input-sm input-primary w-32" id="graphY" /></span> class="input input-bordered input-sm input-primary w-32" id="graphY" /></span>

@ -3,6 +3,7 @@
"private": true, "private": true,
"version": "0.0.0", "version": "0.0.0",
"type": "module", "type": "module",
"author": "nulla",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "tsc && vite build", "build": "tsc && vite build",
@ -21,4 +22,4 @@
"i18next": "^23.5.1", "i18next": "^23.5.1",
"lodash-es": "^4.17.21" "lodash-es": "^4.17.21"
} }
} }

@ -18,7 +18,7 @@ const result = font
.find({ .find({
filter: (glyf) => filter: (glyf) =>
!(glyf.xMin === 408 && glyf.xMax === 592 && glyf.yMin === 452 && glyf.yMax === 636), !(glyf.xMin === 408 && glyf.xMax === 592 && glyf.yMin === 452 && glyf.yMax === 636),
}) }) //remove dot glyph
.reduce((p, c) => { .reduce((p, c) => {
if (!c.unicode) { if (!c.unicode) {
return p; return p;
@ -28,7 +28,7 @@ const result = font
} }
return p; return p;
}, []); }, []);
const fontmin = new Fontmin() new Fontmin()
.src('../public/RoGSanSrfStd-Bd.otf') .src('../public/RoGSanSrfStd-Bd.otf')
.use(Fontmin.otf2ttf()) .use(Fontmin.otf2ttf())
.use( .use(

@ -98,10 +98,16 @@ export default class LogoCanvas {
Y: this.graphOffset.Y, Y: this.graphOffset.Y,
}; };
c.beginPath(); c.beginPath();
c.moveTo(graph.X + hollowPath[0][0] / 2, graph.Y + hollowPath[0][1] / 2); c.moveTo(
c.lineTo(graph.X + hollowPath[1][0] / 2, graph.Y + hollowPath[1][1] / 2); graph.X + (hollowPath[0][0] / 500) * canvasHeight,
c.lineTo(graph.X + hollowPath[2][0] / 2, graph.Y + hollowPath[2][1] / 2); graph.Y + (hollowPath[0][1] / 500) * canvasHeight
c.lineTo(graph.X + hollowPath[3][0] / 2, graph.Y + hollowPath[3][1] / 2); );
for (let i = 1; i < 4; i++) {
c.lineTo(
graph.X + (hollowPath[i][0] / 500) * canvasHeight,
graph.Y + (hollowPath[i][1] / 500) * canvasHeight
);
}
c.closePath(); c.closePath();
if (this.transparentBg) { if (this.transparentBg) {
c.globalCompositeOperation = 'destination-out'; c.globalCompositeOperation = 'destination-out';

@ -38,7 +38,7 @@ h1 {
#canvas { #canvas {
border-radius: 8px; border-radius: 8px;
border: 1px solid #ccc; border: 1px solid #bbb;
max-width: 100%; max-width: 100%;
} }

Loading…
Cancel
Save