pattern: fixes for mobile
This commit is contained in:
@@ -11,8 +11,8 @@
|
|||||||
const NORMAL_SMALL = 29
|
const NORMAL_SMALL = 29
|
||||||
const NORMAL_BIG = 49
|
const NORMAL_BIG = 49
|
||||||
|
|
||||||
const MOBILE_SMALL = 15
|
const MOBILE_SMALL = 10
|
||||||
const MOBILE_BIG = 25
|
const MOBILE_BIG = 19.5
|
||||||
|
|
||||||
let small = NORMAL_SMALL
|
let small = NORMAL_SMALL
|
||||||
let big = NORMAL_BIG
|
let big = NORMAL_BIG
|
||||||
@@ -104,8 +104,14 @@ function bg(colorIndex, canvas, ctx, randomColors) {
|
|||||||
function font(colorIndex, canvas, ctx) {
|
function font(colorIndex, canvas, ctx) {
|
||||||
if (canvas.width > 750) {
|
if (canvas.width > 750) {
|
||||||
ctx.font = '195px Kobata'
|
ctx.font = '195px Kobata'
|
||||||
|
|
||||||
|
kerningNormal = { R: -12, E: -27, C: -13, A: -13, P: -13, I: -13, T: -13, U: -13, L: -13, N: -13, G: -13 }
|
||||||
|
kerningWide = { Q: 178.7, U: 178.7, E: 178.7 }
|
||||||
} else {
|
} else {
|
||||||
ctx.font = '100px Kobata'
|
ctx.font = '74px Kobata'
|
||||||
|
|
||||||
|
kerningNormal = { R: -6, E: -13, C: -6, A: -6, P: -6, I: -6, T: -6, U: -6, L: -6, N: -6, G: -6 }
|
||||||
|
kerningWide = { Q: 38, U: 38, E: 38 }
|
||||||
}
|
}
|
||||||
|
|
||||||
const patterns = [
|
const patterns = [
|
||||||
@@ -113,9 +119,6 @@ function font(colorIndex, canvas, ctx) {
|
|||||||
[0, 1]
|
[0, 1]
|
||||||
]
|
]
|
||||||
|
|
||||||
const kerningNormal = { R: -12, E: -27, C: -13, A: -13, P: -13, I: -13, T: -13, U: -13, L: -13, N: -13, G: -13 }
|
|
||||||
const kerningWide = { Q: 178.7, U: 178.7, E: 178.7 }
|
|
||||||
|
|
||||||
function word(str, y, colorIndex, pattern, kerning) {
|
function word(str, y, colorIndex, pattern, kerning) {
|
||||||
let x = -10
|
let x = -10
|
||||||
for (var i = 0; i < str.length; i++) {
|
for (var i = 0; i < str.length; i++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user