feat: Redesign homepage to a split layout with a brand sidebar, removing the interactive ASCII art controls.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -270,9 +270,12 @@ export class AsciiController {
|
|||||||
async calculateGrid(): Promise<GridCache | undefined> {
|
async calculateGrid(): Promise<GridCache | undefined> {
|
||||||
if (!this.currentImgUrl) return;
|
if (!this.currentImgUrl) return;
|
||||||
|
|
||||||
|
const parent = this.canvas.parentElement;
|
||||||
|
if (!parent) return;
|
||||||
|
|
||||||
const fontAspectRatio = 0.55;
|
const fontAspectRatio = 0.55;
|
||||||
const marginRatio = 0.2;
|
const marginRatio = 0.05; // Reduced margin for container fit
|
||||||
const screenW = window.innerWidth;
|
const screenW = parent.clientWidth;
|
||||||
const availW = screenW * (1 - marginRatio);
|
const availW = screenW * (1 - marginRatio);
|
||||||
|
|
||||||
let widthCols = Math.floor(availW / 6);
|
let widthCols = Math.floor(availW / 6);
|
||||||
@@ -337,12 +340,16 @@ export class AsciiController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private updateCanvasSize(): void {
|
private updateCanvasSize(): void {
|
||||||
|
const parent = this.canvas.parentElement;
|
||||||
|
if (!parent) return;
|
||||||
|
|
||||||
const fontAspectRatio = 0.55;
|
const fontAspectRatio = 0.55;
|
||||||
const gridAspect = (this.cachedGrid.widthCols * fontAspectRatio) / this.cachedGrid.heightRows;
|
const gridAspect = (this.cachedGrid.widthCols * fontAspectRatio) / this.cachedGrid.heightRows;
|
||||||
const screenW = window.innerWidth;
|
|
||||||
const screenH = window.innerHeight;
|
const screenW = parent.clientWidth;
|
||||||
const maxW = screenW * 0.95;
|
const screenH = parent.clientHeight;
|
||||||
const maxH = screenH * 0.95;
|
const maxW = screenW * 0.98;
|
||||||
|
const maxH = screenH * 0.98;
|
||||||
|
|
||||||
let finalW: number, finalH: number;
|
let finalW: number, finalH: number;
|
||||||
if (gridAspect > maxW / maxH) {
|
if (gridAspect > maxW / maxH) {
|
||||||
|
|||||||
Reference in New Issue
Block a user