Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "https://json.schemastore.org/stylelintrc.json",
"extends": ["stylelint-config-standard"],
"rules": {
"selector-class-pattern": null,
"color-hex-length": "short",
"declaration-empty-line-before": null,
"rule-empty-line-before": [
"always-multi-line",
{
"except": ["first-nested"],
"ignore": ["after-comment"]
}
]
}
}
214 changes: 3 additions & 211 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,215 +33,7 @@
}
}
</script>
<style type="text/css">
:root {
font-family: 'Courier New', Courier, monospace;
line-height: 1.5;
font-weight: 400;
font-size: 16px;
text-align: center;

color-scheme: light dark;
color: rgb(255 255 255 / 87%);
background-color: #242424;

font-synthesis: none;
text-rendering: optimizelegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

* {
box-sizing: border-box;
margin: 0;
padding: 0;
}

body {
display: flex;
flex-direction: column;
place-items: center;
min-height: 100vh;
}

#app {
max-width: 600px;
width: 100%;
padding: 2rem;
flex: 1;

display: flex;
flex-direction: column;
gap: 2rem;
align-items: center;
justify-content: center;
text-align: center;
}

#qr-code {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
}

.qr-code-link,
.qr-code-link svg {
width: 100%;
display: block;
border-radius: 8px;
}

.qr-code-link {
transition: box-shadow 0.3s ease;
}

.qr-code-link:hover {
box-shadow: 0 4px 8px rgb(0 0 0 / 20%);
}

.qr-code-link:active {
box-shadow: 0 2px 4px rgb(0 0 0 / 30%);
}

.qr-code-link:focus-visible {
box-shadow: 0 4px 8px rgb(0 0 0 / 30%);
}

.qr-code-link:focus {
outline: 2px solid rgb(0 0 0 / 60%);
outline-offset: -2px;
}

rect {
fill: #fff;
shape-rendering: crispEdges;
}

path {
fill: #242424;
shape-rendering: crispEdges;
}

form {
width: 100%;
}

label {
display: block;
margin-bottom: 0.5em;
font-size: 1.125em;
}

#input-text {
width: 100%;
padding: 0.5em;
font-size: 1em;
font-family: inherit;
border-radius: 8px;
border: 1px solid rgb(255 255 255 / 20%);
background-color: #222;
color: inherit;
box-shadow: inset 0 1px 2px rgb(0 0 0 / 10%);
transition:
border-color 0.3s ease,
box-shadow 0.3s ease;
}

#input-text:focus {
border-color: rgb(255 255 255 / 60%);
box-shadow: inset 0 1px 2px rgb(0 0 0 / 20%);
outline: 2px solid rgb(255 255 255 / 40%);
outline-offset: -2px;
}

#input-text::placeholder {
color: rgb(255 255 255 / 60%);
}

#input-text:focus::placeholder {
color: rgb(255 255 255 / 40%);
}

footer a {
color: rgb(255 255 255 / 60%);
text-decoration: none;
transition: color 0.3s ease;
}

footer a:hover,
footer a:focus {
color: rgb(255 255 255 / 87%);
outline: 2px solid rgb(255 255 255 / 40%);
outline-offset: 2px;
}

footer {
padding: 1em;
color: rgb(255 255 255 / 60%);
}

.card {
border-radius: 8px;
background-color: #fff;
}

.error-message {
color: #ff4d4d;
display: flex;
align-items: center;
justify-content: center;
padding: 2em;
aspect-ratio: 1 / 1;
}

.preload-spacer {
width: 100%;
height: 0;
padding-bottom: 100%; /* Maintain aspect ratio */
}

@media (prefers-color-scheme: light) {
:root {
color: #213547;
background-color: #fff;
}

body {
color: #242424;
background-color: #fff;
}

footer a {
color: #242424;
}

footer a:hover,
footer a:focus {
color: #213547;
outline: 2px solid rgb(0 0 0 / 60%);
outline-offset: 2px;
}

footer {
color: #242424;
}

#input-text {
border: 1px solid #ccc;
box-shadow: inset 0 1px 2px rgb(0 0 0 / 10%);
background-color: #f9f9f9;
color: #242424;
}

#input-text:focus {
border-color: rgb(0 0 0 / 60%);
box-shadow: inset 0 1px 2px rgb(0 0 0 / 20%);
outline: 2px solid rgb(0 0 0 / 40%);
outline-offset: -2px;
}
}
</style>
<link rel="stylesheet" href="./src/style.css" />
</head>
<body>
<div id="app">
Expand All @@ -250,7 +42,7 @@
</div>
<form>
<label for="input-text">QR code text</label>
<input type="text" name="input-text" id="input-text" placeholder="Enter text for QR code" />
<textarea name="input-text" id="input-text" placeholder="Enter text for QR code"></textarea>
</form>
</div>
<footer>
Expand All @@ -263,6 +55,6 @@
>
</p>
</footer>
<script async type="module" src="./src/main.ts"></script>
<script type="module" src="./src/main.ts"></script>
</body>
</html>
12 changes: 8 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,23 @@
"test:ui": "vitest --ui",
"test:run": "vitest run",
"test:coverage": "vitest run --coverage",
"lint": "pnpm run lint:ts && pnpm run lint:html && pnpm run lint:md",
"lint": "pnpm run lint:ts && pnpm run lint:css && pnpm run lint:html && pnpm run lint:md",
"lint:ts": "eslint . --ext .ts,.tsx",
"lint:html": "htmlhint --config=.htmlhintrc --ignore coverage/**,dist/**,node_modules/** \"**/*.html\"",
"lint:css": "stylelint \"src/**/*.css\"",
"lint:md": "markdownlint --ignore coverage/**,dist/**,node_modules/** \"**/*.md\"",
"lint:fix": "pnpm run lint:ts --fix",
"lint:fix": "pnpm run lint:ts --fix && pnpm run lint:css --fix",
"format": "prettier --write \"**/*.{ts,tsx,js,jsx,json,css,md,html}\"",
"format:check": "prettier --check \"**/*.{ts,tsx,js,jsx,json,css,md,html}\""
},
"devDependencies": {
"@eslint/js": "^9.27.0",
"@types/dompurify": "^3.2.0",
"@types/eslint": "^9.6.1",
"@types/qrcode-svg": "^1.1.5",
"@typescript-eslint/eslint-plugin": "^8.33.0",
"@typescript-eslint/parser": "^8.33.0",
"@vitest/coverage-v8": "3.1.4",
"@vitest/ui": "^3.1.4",
"dompurify": "^3.2.6",
"eslint": "^9.27.0",
"eslint-config-prettier": "^10.1.5",
"eslint-plugin-prettier": "^5.4.0",
Expand All @@ -38,9 +37,14 @@
"markdownlint-cli": "^0.45.0",
"prettier": "^3.5.3",
"qrcode-svg": "^1.1.0",
"stylelint": "^16.20.0",
"stylelint-config-prettier": "^9.0.5",
"stylelint-config-standard": "^38.0.0",
"typescript": "~5.8.3",
"vite": "^6.3.5",
"vite-plugin-minify": "^2.1.0",
"vite-plugin-node-csp": "^0.1.3",
"vite-plugin-singlefile": "^2.2.0",
"vitest": "^3.1.4"
}
}
Loading