Skip to content

Commit

Permalink
Added liquid tempalte
Browse files Browse the repository at this point in the history
  • Loading branch information
pathumego committed Dec 20, 2024
1 parent 8823812 commit d8b7da1
Show file tree
Hide file tree
Showing 55 changed files with 56 additions and 215 deletions.
12 changes: 12 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# _config.yml
title: HTML Index for Tests
baseurl: "" # Root directory (adjust if hosted on a subpath)
url: "" # Your website's URL (optional)

# Include /tests folder in the build
include:
- tests/*.html

# Build settings
markdown: kramdown
theme: minima # Or another Jekyll theme of your choice
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
213 changes: 11 additions & 202 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,207 +1,16 @@
<!DOCTYPE html>
<html lang="en">
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Font Comparison Tool</title>
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+Sinhala&display=swap" rel="stylesheet">
<style>
body {
display: flex;
font-family: Arial, sans-serif;
margin: 0;
height: 100vh;
}

#side-panel {
width: 300px;
background-color: #f4f4f4;
padding: 20px;
box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

#content {
flex: 1;
display: flex;
justify-content: center;
align-items: center;
background-color: #fff;
overflow: hidden;
position: relative;
}

.text-overlay {
position: absolute;
font-size: 24px;
line-height: 1.5;
text-align: center;
width: 90%;
}

.top-text {
pointer-events: none;
}

#side-panel label {
display: block;
margin: 10px 0 5px;
font-weight: bold;
}

#side-panel input[type="color"],
#side-panel input[type="range"],
#side-panel input[type="text"],
#side-panel input[type="checkbox"],
#side-panel select {
margin-bottom: 10px;
width: 100%;
}

#side-panel button {
margin: 5px 0;
padding: 8px;
width: 100%;
background-color: #ddd;
border: none;
cursor: pointer;
}

#side-panel button:hover {
background-color: #bbb;
}
@font-face {
font-family: 'Noto Sans Sinhala Nightly';
src: url('./fonts/NotoSansSinhalaNightly-Thin.woff2') format('woff2');
font-weight: 100;
}

@font-face {
font-family: 'Noto Sans Sinhala Nightly';
src: url('./fonts/NotoSansSinhalaNightly-Regular.woff2') format('woff2');
font-weight: 400;
}

@font-face {
font-family: 'Noto Sans Sinhala Nightly';
src: url('./fonts/NotoSansSinhalaNightly-black.woff2') format('woff2');
font-weight: 900;
}
</style>
<title>Index of Test HTML Files</title>
</head>
<body>

<div id="side-panel">
<label for="text-input">Text to Display:</label>
<textarea id="text-input" rows="4">ශ්‍රී ලංකා / இலங்கை</textarea>

<label for="font-size">Font Size:</label>
<input type="range" id="font-size" min="12" max="48" step="1" value="24">

<label for="color-base">Base Font Color:</label>
<input type="color" id="color-base" value="#000000">

<label for="color-top">Top Font Color:</label>
<input type="color" id="color-top" value="#FF0000">

<label for="opacity-base">Base Font Opacity:</label>
<input type="range" id="opacity-base" min="0" max="1" step="0.01" value="1">

<label for="opacity-top">Top Font Opacity:</label>
<input type="range" id="opacity-top" min="0" max="1" step="0.01" value="1">

<label for="toggle-base">Show Base Font:</label>
<input type="checkbox" id="toggle-base" checked>

<label for="toggle-top">Show Top Font:</label>
<input type="checkbox" id="toggle-top" checked>

<label for="text-alignment">Text Alignment:</label>
<button id="align-left">Left</button>
<button id="align-center">Center</button>
<button id="align-right">Right</button>
</div>

<div id="content">
<div id="base-text" class="text-overlay" style="font-family: 'Noto Sans Sinhala', sans-serif; color: #000; opacity: 1; text-align: center;">ශ්‍රී ලංකා / இலங்கை</div>
<div id="top-text" class="text-overlay top-text" style="font-family: 'Noto Sans Sinhala Nightly', sans-serif; color: #FF0000; opacity: 1; text-align: center;">ශ්‍රී ලංකා / இலங்கை</div>
</div>

<script>
const textInput = document.getElementById('text-input');
const baseText = document.getElementById('base-text');
const topText = document.getElementById('top-text');

const fontSize = document.getElementById('font-size');
const colorBase = document.getElementById('color-base');
const colorTop = document.getElementById('color-top');
const opacityBase = document.getElementById('opacity-base');
const opacityTop = document.getElementById('opacity-top');

const toggleBase = document.getElementById('toggle-base');
const toggleTop = document.getElementById('toggle-top');

const alignLeft = document.getElementById('align-left');
const alignCenter = document.getElementById('align-center');
const alignRight = document.getElementById('align-right');

// Update text content
textInput.addEventListener('input', () => {
baseText.textContent = textInput.value;
topText.textContent = textInput.value;
});

// Update font size
fontSize.addEventListener('input', () => {
baseText.style.fontSize = `${fontSize.value}px`;
topText.style.fontSize = `${fontSize.value}px`;
});

// Update base font color
colorBase.addEventListener('input', () => {
baseText.style.color = colorBase.value;
});

// Update top font color
colorTop.addEventListener('input', () => {
topText.style.color = colorTop.value;
});

// Update base font opacity
opacityBase.addEventListener('input', () => {
baseText.style.opacity = opacityBase.value;
});

// Update top font opacity
opacityTop.addEventListener('input', () => {
topText.style.opacity = opacityTop.value;
});

// Toggle base font visibility
toggleBase.addEventListener('change', () => {
baseText.style.display = toggleBase.checked ? 'block' : 'none';
});

// Toggle top font visibility
toggleTop.addEventListener('change', () => {
topText.style.display = toggleTop.checked ? 'block' : 'none';
});

// Text alignment controls
alignLeft.addEventListener('click', () => {
baseText.style.textAlign = 'left';
topText.style.textAlign = 'left';
});

alignCenter.addEventListener('click', () => {
baseText.style.textAlign = 'center';
topText.style.textAlign = 'center';
});

alignRight.addEventListener('click', () => {
baseText.style.textAlign = 'right';
topText.style.textAlign = 'right';
});
</script>

<h1>Index of Test HTML Files</h1>
<ul>
{% for file in site.static_files %}
{% if file.path contains "/tests/" and file.extname == ".html" %}
<li><a href="{{ file.path }}">{{ file.name }}</a></li>
{% endif %}
{% endfor %}
</ul>
</body>
</html>
</html>
46 changes: 33 additions & 13 deletions tests/overlay.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,27 +92,47 @@

<div id="side-panel">
<label for="text-input">Text to Display:</label>
<textarea id="text-input" rows="4">ශ්‍රී ලංකා / இலங்கை</textarea>
<textarea id="text-input" rows="4">දෙසැම්බර් වෙනි එක්සත් ජාතීන්ගේ මහා මණ්ඩලයෙන් කරනු පෞද්ගලික ප්‍රකාශයට කළ අයිතිවාසිකම් පිළිබඳ ඓතිහාසික සිද්ධියෙන් අඩංගු ප්‍රචාරයට “ඒ නොකර ආයතනයන් මඟින් පාඨනය මෙන්ද” ඉල්ලා ලෝකයේ වූ අවඥාවට ප්‍රතිඵලයක් හෘදය සාක්ෂිය භාජනය ම්ලේච්ඡ කෲරකම් ඇති ඇරඹීම ස්ථිර
ඟිහිපිෂිසිඝිෆිලිගිශිභිහිර්‍ක්‍ෂ
ලි
ළිදිඳිඤිඥි ර්‍ක
කරතනර්‍
ර්‍ත්‍ථ්‍ ්‍යුඤ‍්ජ
ණ‍්ඩ්‍යු ්‍ය්
්‍ය් ්‍යි
ක්‍ය් ක්‍යි

ක්‍යූක්‍යු
බ‍්බ
ම‍්බ

ද්‍රි දි දී
චිටිඩිඬිඛිබිමිධිවිඹිඣිඞි
කිතිනි

යි

යි</textarea>

<label for="font-size">Font Size:</label>
<input type="range" id="font-size" min="12" max="48" step="1" value="24">

<label for="color-base">Noto Sans Sinhala Color:</label>
<label for="color-base">Base Font Color:</label>
<input type="color" id="color-base" value="#000000">

<label for="color-top">Noto Sans Sinhala DEV Color:</label>
<label for="color-top">Top Font Color:</label>
<input type="color" id="color-top" value="#FF0000">

<label for="opacity-base">Noto Sans Sinhala Opacity:</label>
<label for="opacity-base">Base Font Opacity:</label>
<input type="range" id="opacity-base" min="0" max="1" step="0.01" value="1">

<label for="opacity-top">Noto Sans Sinhala DEV Opacity:</label>
<label for="opacity-top">Top Font Opacity:</label>
<input type="range" id="opacity-top" min="0" max="1" step="0.01" value="1">

<label for="toggle-base">Show Noto Sans Sinhala:</label>
<label for="toggle-base">Show Base Font:</label>
<input type="checkbox" id="toggle-base" checked>

<label for="toggle-top">Show Noto Sans Sinhala DEV:</label>
<label for="toggle-top">Show Top Font:</label>
<input type="checkbox" id="toggle-top" checked>

<label for="text-alignment">Text Alignment:</label>
Expand Down Expand Up @@ -156,32 +176,32 @@
topText.style.fontSize = `${fontSize.value}px`;
});

// Update Noto Sans Sinhala color
// Update base font color
colorBase.addEventListener('input', () => {
baseText.style.color = colorBase.value;
});

// Update Noto Sans Sinhala DEV color
// Update top font color
colorTop.addEventListener('input', () => {
topText.style.color = colorTop.value;
});

// Update Noto Sans Sinhala opacity
// Update base font opacity
opacityBase.addEventListener('input', () => {
baseText.style.opacity = opacityBase.value;
});

// Update Noto Sans Sinhala DEV opacity
// Update top font opacity
opacityTop.addEventListener('input', () => {
topText.style.opacity = opacityTop.value;
});

// Toggle Noto Sans Sinhala visibility
// Toggle base font visibility
toggleBase.addEventListener('change', () => {
baseText.style.display = toggleBase.checked ? 'block' : 'none';
});

// Toggle Noto Sans Sinhala DEV visibility
// Toggle top font visibility
toggleTop.addEventListener('change', () => {
topText.style.display = toggleTop.checked ? 'block' : 'none';
});
Expand Down

0 comments on commit d8b7da1

Please sign in to comment.