diff --git a/.gitignore b/.gitignore index f13864f..1dbae0d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ webclient/ node_modules/ .tmp +screenshots/ diff --git a/compare-heights.js b/compare-heights.js new file mode 100644 index 0000000..19d795d --- /dev/null +++ b/compare-heights.js @@ -0,0 +1,51 @@ +const { chromium } = require("playwright"); + +(async () => { + // CHROME_PATH lets environments without pinned Playwright browsers + // (see `npx playwright install`) point at a system/other Chromium. + const launchOptions = process.env.CHROME_PATH ? { executablePath: process.env.CHROME_PATH } : {}; + const browser = await chromium.launch(launchOptions); + const page = await browser.newPage(); + + await page.goto("http://localhost:3000/index.html"); + await page.waitForSelector(".docs-section"); + const vanilla = await page.evaluate(() => + Array.from(document.querySelectorAll(".docs-section")).map(s => ({ + id: s.id, + height: s.getBoundingClientRect().height + })) + ); + + await page.goto("http://localhost:3000/vue.html"); + await page.waitForSelector(".docs-section"); + const vue = await page.evaluate(() => + Array.from(document.querySelectorAll(".docs-section")).map(s => ({ + id: s.id, + height: s.getBoundingClientRect().height + })) + ); + + await browser.close(); + + let diffs = 0; + const max = Math.max(vanilla.length, vue.length); + for (let i = 0; i < max; i++) { + const v = vanilla[i]; + const u = vue[i]; + if (!v || !u || v.id !== u.id || Math.abs(v.height - u.height) > 0.5) { + diffs++; + console.log({ + index: i, + vanillaId: v?.id, + vueId: u?.id, + vanillaHeight: v?.height, + vueHeight: u?.height, + heightDiff: v && u ? Math.abs(v.height - u.height) : null + }); + } + } + + console.log(`Sections compared: ${vanilla.length} vanilla, ${vue.length} vue`); + console.log(`Differences: ${diffs}`); + process.exit(diffs > 0 ? 1 : 0); +})(); diff --git a/demo/index.html b/demo/index.html index 71084e2..3f8c333 100644 --- a/demo/index.html +++ b/demo/index.html @@ -4,10 +4,10 @@ GNexus UI Kit - - - - + + + + @@ -17,7 +17,7 @@ Menu @@ -223,7 +223,7 @@ - - + + diff --git a/demo/partials/avatar.html b/demo/partials/avatar.html index 5b6fc51..688702c 100644 --- a/demo/partials/avatar.html +++ b/demo/partials/avatar.html @@ -19,7 +19,7 @@ - GNexus mark + GNexus mark diff --git a/demo/partials/cards.html b/demo/partials/cards.html index ae6bb63..0ab6e34 100644 --- a/demo/partials/cards.html +++ b/demo/partials/cards.html @@ -10,7 +10,7 @@

Card title

- +

Карточка для контента, виджетов, статусов.

@@ -146,7 +146,7 @@

Horizontal Card

- +

Project Alpha

diff --git a/demo/partials/navigation-shell.html b/demo/partials/navigation-shell.html index 65aff96..57bd384 100644 --- a/demo/partials/navigation-shell.html +++ b/demo/partials/navigation-shell.html @@ -13,7 +13,7 @@ Menu @@ -130,7 +130,7 @@ Menu diff --git a/demo/partials/vue/avatar.html b/demo/partials/vue/avatar.html index 30690ff..a8122fd 100644 --- a/demo/partials/vue/avatar.html +++ b/demo/partials/vue/avatar.html @@ -9,7 +9,7 @@ - +
diff --git a/demo/partials/vue/cards.html b/demo/partials/vue/cards.html index ce69c78..c78522c 100644 --- a/demo/partials/vue/cards.html +++ b/demo/partials/vue/cards.html @@ -5,7 +5,7 @@

Card title

- +

Карточка для контента, виджетов, статусов.

Horizontal Card

- +

Compact horizontal layout for content listings, search results, and entity rows.