-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(demo): new demo application
- Loading branch information
1 parent
a73f96d
commit d277578
Showing
18 changed files
with
595 additions
and
1,175 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,16 @@ | ||
<html lang="en"> | ||
<html lang="en" class="color-scheme-auto bg-background"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Gecut</title> | ||
<style> | ||
html { | ||
color-scheme: light dark; | ||
} | ||
</style> | ||
<script type="module" src="main/scripts.ts"></script> | ||
<script type="module" src="main/global.ts"></script> | ||
</head> | ||
|
||
<body> | ||
<ol> | ||
<li><a href="./es-bench/">ES Bench</a></li> | ||
<li><a href="./fetch/">Fetch</a></li> | ||
<li><a href="./math/">Math</a></li> | ||
<li><a href="./validator/">Validator</a></li> | ||
</ol> | ||
<body class="bg-surface container mx-auto p-4"> | ||
<h2 class="text-headlineMedium text-onSurface">Hybrid UI Demos</h2> | ||
|
||
<div id="container" class="w-full gap-4 py-4 grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4"></div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
@import '@gecut/styles/css'; | ||
@import '@gecut/styles/palettes/h260.css'; | ||
|
||
html, | ||
body { | ||
@apply h-full; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import './global.css'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* eslint-disable max-len */ | ||
import {classMap} from 'lit/directives/class-map.js'; | ||
import {map} from 'lit/directives/map.js'; | ||
import {html, render} from 'lit/html.js'; | ||
|
||
interface Demo { | ||
title: string; | ||
href: string; | ||
|
||
align?: 'center' | 'bottom' | 'top'; | ||
} | ||
|
||
const container = document.getElementById('container'); | ||
const demos: Demo[] = [ | ||
{ | ||
title: 'Dialog', | ||
href: '/dialog/', | ||
align: 'center', | ||
}, | ||
{ | ||
title: 'Top App Bar', | ||
href: '/top-bar/', | ||
align: 'top', | ||
}, | ||
]; | ||
|
||
if (container) | ||
render( | ||
map( | ||
demos, | ||
(demo) => html` | ||
<a | ||
href=${demo.href} | ||
class="flex flex-col p-4 !m-0 group card-elevated dark:card-filled-selectable w-full hover:elevation-5 transition-shadow duration-500 dark:!shadow-none" | ||
> | ||
<div class="aspect-w-4 aspect-h-3 w-full overflow-hidden rounded-md relative"> | ||
<img | ||
src="${demo.href}preview.png" | ||
class="h-full w-full object-cover invert dark:invert-0 ${classMap({ | ||
'object-center': demo.align === 'center' || !demo.align, | ||
'object-top': demo.align === 'top', | ||
'object-bottom': demo.align === 'bottom', | ||
})}" | ||
/> | ||
<div | ||
class="absolute z-above inset-0 shadow-[inset_0px_4px_48px_0px_#0002] group-hover:shadow-[inset_0px_8px_16px_4px_#0004] transition-shadow duration-500 dark:!shadow-none" | ||
></div> | ||
</div> | ||
<h2 class="text-onSurfaceVariant text-titleMedium mt-4">${demo.title}</h2> | ||
</a> | ||
`, | ||
), | ||
container, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,13 +5,22 @@ | |
"author": "S. MohammadMahdi Zamanian <[email protected]> (https://mm25zamanian.ir)", | ||
"type": "module", | ||
"private": true, | ||
"devDependencies": { | ||
"@types/node": "^20.11.30" | ||
"scripts": { | ||
"serve": "vite --host 0.0.0.0 --port 3031 --open --clearScreen -d", | ||
"build": "vite build --clearScreen" | ||
}, | ||
"dependencies": { | ||
"devDependencies": { | ||
"@gecut/components": "workspace:^", | ||
"@gecut/lit-helper": "workspace:^", | ||
"@gecut/signal": "^2.0.1-alpha.0", | ||
"lit": "^3.1.2" | ||
"@gecut/styles": "workspace:^", | ||
"@gecut/types": "^2.1.1-alpha.0", | ||
"@tailwindcss/aspect-ratio": "^0.4.2", | ||
"@types/node": "^20.11.30", | ||
"autoprefixer": "^10.4.19", | ||
"lit": "^3.1.2", | ||
"postcss": "^8.4.38", | ||
"tailwindcss": "^3.4.1", | ||
"vite": "^5.2.4" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export default { | ||
plugins: { | ||
tailwindcss: {}, | ||
autoprefixer: {}, | ||
}, | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import {defineConfig} from 'vite'; | ||
|
||
const entrys = ['dialog', 'top-bar']; | ||
const DIST_PATH = './dist/'; | ||
const pages = entrys.reduce((result, name) => { | ||
result[name] = `src/${name}/index.html`; | ||
|
||
return result; | ||
}, {}); | ||
|
||
export default defineConfig(() => { | ||
return { | ||
css: { | ||
postcss: 'postcss.config.mjs', | ||
}, | ||
|
||
build: { | ||
target: ['esnext', 'edge100', 'firefox100', 'chrome100', 'safari18'], | ||
outDir: DIST_PATH, | ||
reportCompressedSize: true, | ||
commonjsOptions: { | ||
transformMixedEsModules: true, | ||
}, | ||
rollupOptions: { | ||
input: {main: 'index.html', ...pages}, | ||
}, | ||
}, | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.