Moiré Patterns are patterns that results from overlapping two periodical patterns (series of straight lines, for instance). This demo allows to create Moiré patterns by changing the relative angle between the patterns, the number of bars, the bar width and the color of the bars.
This demo uses D3 to create the patterns with SVG rectangles.
xxxxxxxxxx
<html>
<head>
<title>The Moiré Patterns</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/d3/3.4.4/d3.min.js" charset="utf-8"></script>
<style>
.footer {
height: 100px;
}
.bar {
stroke: none;
stroke-width: 0;
}
</style>
</head>
<body>
<div class="container">
<h1>Moiré Pattern</h1>
Moiré Patterns are patterns that results from overlapping two periodical patterns (series of straight lines, for instance). This demo allows to create Moiré patterns by changing the relative angle between the patterns, the number of bars, the bar width and the color of the bars.
<form role="form">
<div class="form-group">
<label for="input-na">Bars</label>
<input id="input-na" type="number" min="80" max="112" step="1" value="105">
<label for="input-ta">Angle</label>
<input id="input-ta" type="number" min="-90" max="90" step="0.1" value="0">
<label for="input-pa">Padding</label>
<input id="input-pa" type="number" min="0.05" max="0.95" step="0.05" value="0.5">
<label for="input-ca">Color</label>
<input id="input-ca" type="color" value="#FF6B6B">
</div>
<div class="form-group">
<label for="input-nb">Bars</label>
<input id="input-nb" type="number" min="80" max="112" step="1" value="100">
<label for="input-tb">Angle</label>
<input id="input-tb" type="number" min="-90" max="90" step="0.1" value="0">
<label for="input-pb">Padding</label>
<input id="input-pb" type="number" min="0.05" max="0.95" step="0.05" value="0.5">
<label for="input-cb">Color</label>
<input id="input-cb" type="color" value="#4ECDC4">
</div>
</form>
<div id="patterns"></div>
<div class="footer"></div>
</div>
<script src="bar-pattern.js"></script>
<script src="main.js"></script>
</body>
</html>
https://cdnjs.cloudflare.com/ajax/libs/d3/3.4.4/d3.min.js