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
1 change: 1 addition & 0 deletions public/llms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Funput runs on:
- [Set up Funput on Android](https://funput.app/blog/cai-ban-phim-tieng-viet-android/): Enable and select the keyboard, choose Telex/VNI, adjust layout and troubleshoot setup.
- [Unicode, TCVN3 and VNI-Windows](https://funput.app/blog/unicode-tcvn3-vni-windows/): Distinguish typing methods, encodings and fonts; convert Vietnamese text with Funput desktop.
- [Troubleshoot Vietnamese typing](https://funput.app/blog/khong-go-duoc-tieng-viet/): Diagnose keyboard selection, Telex/VNI mismatches and app-specific input problems across Windows, macOS, Linux, iOS and Android.
- [Fix Vietnamese typing in Chrome and VS Code on Ubuntu](https://funput.app/blog/khong-go-duoc-tieng-viet-ubuntu/): Per-app fixes for Chrome, Chromium and VS Code on Wayland or X11: Wayland IME, XWayland, Edit Context, Snap vs `.deb`, and per-launch IM modules. Retest with Telex or VNI.
- [Sitemap](https://funput.app/sitemap-index.xml): Index of public website pages.

## Links
Expand Down
267 changes: 267 additions & 0 deletions src/components/blog/UbuntuTypingCheck.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,267 @@
---
const methods = [
{ id: 'telex', label: 'Telex', key: 'f' },
{ id: 'vni', label: 'VNI', key: '2' },
];
---

<ubuntu-typing-check class="typing-check">
<div class="check-header">
<div>
<p class="check-title">Thử gõ ngay</p>
<p class="check-note" id="ubuntu-typing-note">
Gõ trực tiếp bằng bộ gõ đang dùng, rồi nhấn dấu cách.
</p>
</div>
<fieldset class="method-picker">
<legend class="sr-only">Kiểu gõ của câu mẫu</legend>
{methods.map(({ id, label }) => (
<label>
<input
class="sr-only"
type="radio"
name="ubuntu-typing-method"
value={id}
checked={id === 'telex'}
/>
<span>{label}</span>
</label>
))}
</fieldset>
</div>

<div class="check-sample">
<div>
<span class="check-label">Phím cần gõ</span>
{methods.map(({ id, key }) => (
<span class="sample-keys" data-method={id}>
<kbd>xin</kbd>
<kbd>chao{key}</kbd>
</span>
))}
</div>
<span class="sample-arrow" aria-hidden="true">
→
</span>
<div>
<span class="check-label">Chữ cần thấy</span>
<span class="sample-result">
xin ch<span class="accent-letter">à</span>o
</span>
</div>
</div>

<div class="check-input">
<label for="ubuntu-typing-input">Ô thử gõ của bạn</label>
<input
id="ubuntu-typing-input"
type="text"
autocomplete="off"
autocapitalize="off"
spellcheck="false"
aria-describedby="ubuntu-typing-note"
/>
<span class="check-status" role="status"></span>
</div>
</ubuntu-typing-check>

<script>
class UbuntuTypingCheck extends HTMLElement {
connectedCallback() {
const input = this.querySelector<HTMLInputElement>('.check-input input');
const status = this.querySelector<HTMLElement>('.check-status');
if (!input || !status) return;

const checkSample = () => {
const matches = input.value.trim().normalize('NFC').toLocaleLowerCase('vi') === 'xin chào';
this.toggleAttribute('data-match', matches);
const message = matches ? 'Có dấu rồi!' : '';
if (status.textContent !== message) status.textContent = message;
};

input.addEventListener('input', (event) => {
if (!event.isComposing) checkSample();
});
input.addEventListener('compositionend', checkSample);
checkSample();
}
}

customElements.define('ubuntu-typing-check', UbuntuTypingCheck);
</script>

<style>
.typing-check {
display: block;
margin-block: 32px;
padding: clamp(16px, 4vw, 28px);
border: 1px solid #cbd4bd;
border-radius: 18px;
background: var(--sage);
color: var(--ink);
}

.check-header {
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
gap: 14px;
}

.typing-check .check-title {
margin: 0;
font-size: 22px;
font-weight: 700;
letter-spacing: -0.55px;
line-height: 1.3;
}

.typing-check .check-note {
margin: 5px 0 0;
color: #4e5943;
font-size: 13px;
line-height: 1.5;
}

.method-picker {
display: inline-flex;
gap: 3px;
padding: 3px;
border: 1px solid #bac4ad;
border-radius: 10px;
}

.method-picker label span {
display: grid;
min-width: 56px;
min-height: 38px;
place-items: center;
padding-inline: 10px;
border-radius: 7px;
color: #435037;
font-size: 13px;
font-weight: 700;
cursor: pointer;
}

.method-picker input:checked + span {
background: #33422c;
color: #fffdf6;
}

.method-picker input:focus-visible + span {
outline: 2px solid #a93a1c;
outline-offset: 2px;
}

.check-sample {
display: grid;
grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
align-items: center;
gap: clamp(8px, 3vw, 26px);
margin-block: 18px;
padding: clamp(12px, 3vw, 22px);
border: 1px solid #c3cdb5;
border-radius: 12px;
background: #fffcf4;
}

.check-label {
display: block;
margin-bottom: 7px;
color: #4e5943;
font-size: 12px;
font-weight: 600;
line-height: 1.35;
}

.sample-keys {
display: flex;
flex-wrap: wrap;
gap: 4px;
}

.sample-keys kbd {
padding: 3px 6px;
border: 1px solid #c3cdb5;
border-bottom-width: 2px;
border-radius: 5px;
background: var(--paper);
font-size: clamp(12px, 2.5vw, 16px);
line-height: 1.35;
}

.sample-keys[data-method='vni'],
.typing-check:has(input[value='vni']:checked) .sample-keys[data-method='telex'] {
display: none;
}

.typing-check:has(input[value='vni']:checked) .sample-keys[data-method='vni'] {
display: flex;
}

.sample-arrow,
.accent-letter {
color: #a93a1c;
}

.sample-arrow {
font-size: 21px;
line-height: 1;
}

.sample-result {
font-family: var(--font-display);
font-size: clamp(19px, 4.5vw, 34px);
line-height: 1.15;
}

.accent-letter {
display: inline-block;
}

.check-input {
display: grid;
gap: 7px;
}

.check-input label,
.check-status {
font-size: 13px;
font-weight: 700;
line-height: 1.4;
}

.check-input input {
width: 100%;
min-width: 0;
padding: 10px 12px;
border: 1px solid #778267;
border-radius: 8px;
background: #fffcf4;
font-size: 16px;
line-height: 1.45;
}

.check-status {
min-height: 1.4em;
color: #334f2d;
}

.typing-check[data-match] .check-input input {
border-color: #4b6a43;
}

@media (prefers-reduced-motion: no-preference) {
.typing-check[data-match] .accent-letter {
animation: accent-hop 360ms ease-out;
}
}

@keyframes accent-hop {
35% {
transform: translateY(-5px) rotate(-7deg);
}
}
</style>
2 changes: 2 additions & 0 deletions src/content/blog/bo-go-tieng-viet-linux-hien-dai.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ Khi xem Issues, hãy đọc cách dự án phân tích lỗi và thông tin cầ

**Bước 4: quyết định từ kết quả.** Nếu ứng dụng quan trọng còn gặp lỗi, ghi lại chuỗi phím, kết quả thực tế và phiên bản phần mềm. Khi báo lỗi, dùng văn bản mẫu thay cho nội dung riêng tư; đọc lại đầu ra chẩn đoán trước khi chia sẻ.

Nếu Text Editor gõ được nhưng Chrome hoặc VS Code mất dấu, hãy dùng [bài kiểm tra lỗi gõ tiếng Việt trên Ubuntu](/blog/khong-go-duoc-tieng-viet-ubuntu/) để khoanh vùng theo ứng dụng.

## Những giới hạn nên biết trước

Khả năng nhập liệu trên Linux phụ thuộc cả framework, desktop và ứng dụng. Không nên hiểu hỗ trợ Wayland là bảo đảm mọi ô nhập trong mọi ứng dụng đều có hành vi giống nhau.
Expand Down
Loading
Loading