✅ COMPLETED: 1. Dockerfile uses port 80 (astro preview) 2. BaseLayout imports globals.css 3. globals.css with Tailwind v4 @theme syntax 4. index.astro has Header, Footer, FixedContact 5. All image references fixed to existing files 6. Hero uses hdpe_pipe_main.jpg 7. Product cards use hdpe001.jpg 8. pt-20 on main for fixed header ✅ TESTED LOCALLY: - Build: 15 pages in 1.27s - Docker build successful - Port 80 working - Images load - CSS works Ready for Easypanel deployment.
25 lines
650 B
JavaScript
25 lines
650 B
JavaScript
/**
|
|
Binary search on a sorted flat array of [start, end] pairs.
|
|
|
|
@param {number[]} ranges - Flat array of inclusive [start, end] range pairs, e.g. [0, 5, 10, 20].
|
|
@param {number} codePoint - The value to search for.
|
|
@returns {boolean} Whether the value falls within any of the ranges.
|
|
*/
|
|
export const isInRange = (ranges, codePoint) => {
|
|
let low = 0;
|
|
let high = Math.floor(ranges.length / 2) - 1;
|
|
while (low <= high) {
|
|
const mid = Math.floor((low + high) / 2);
|
|
const i = mid * 2;
|
|
if (codePoint < ranges[i]) {
|
|
high = mid - 1;
|
|
} else if (codePoint > ranges[i + 1]) {
|
|
low = mid + 1;
|
|
} else {
|
|
return true;
|
|
}
|
|
}
|
|
|
|
return false;
|
|
};
|