<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>2000-Row Stepped Black Gradient</title>
<style>
body { margin: 0; padding: 20px; font-family: sans-serif; background: #ffffff; }
.hr-2000-container { display: flex; flex-direction: column; width: 100%; margin: 20px 0; }
.hr-row { width: 100%; height: 1px; background-color: #000000; }
</style>
</head>
<body>
<h2>2,000-Row Stepped Black-to-Transparent HR</h2>
<!-- 2,000-Row Gradient Container -->
<div class="hr-2000-container" id="gradientHr"></div>
<p>Content following the 2,000-row gradient divider.</p>
<script>
(function generate2000Rows() {
const container = document.getElementById('gradientHr');
const fragment = document.createDocumentFragment();
const totalRows = 2000;
for (let i = 0; i < totalRows; i++) {
const row = document.createElement('div');
row.className = 'hr-row';
// Calculate exact step: Row 1 = 1.0 opacity, Row 2000 = 0.0 opacity
const opacity = (1 - (i / (totalRows - 1))).toFixed(5);
row.style.opacity = opacity;
fragment.appendChild(row);
}
container.appendChild(fragment);
})();
</script>
</body>
</html>
Comments
Post a Comment