-
Notifications
You must be signed in to change notification settings - Fork 0
/
patterns.php
63 lines (60 loc) · 1.63 KB
/
patterns.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Pattern Primer</title>
<link rel="stylesheet" href="global.css">
<link rel="stylesheet" href="https://beta.novascotia.ca/themes/ignition/saltire.css">
<link rel="stylesheet" href="https://novascotia.ca/clf/fonts/font-awesome/css/font-awesome.min.css">
<style>
.pattern {
clear: both;
overflow: hidden;
}
.pattern .display {
width: 65%;
float: left;
}
.pattern .source {
width: 30%;
float: right;
}
.pattern .source textarea {
width: 90%;
}
</style>
</head>
<body>
<div class="container">
<h1>NSDS Design System - patterns</h1>
<ul>
<li><a href="styles.php">Styles</a></li>
<li><a href="components.php">Components</a></li>
<li><a href="patterns.php">Patterns</a></li>
</ul>
<?php
$files = array();
$handle=opendir('patterns');
while (false !== ($file = readdir($handle))):
if(substr($file, -5) == '.html'):
$files[] = $file;
endif;
endwhile;
sort($files);
foreach ($files as $file):
echo '<div class="pattern">';
echo '<div class="display">';
include('patterns/'.$file);
echo '</div>';
echo '<div class="source">';
echo '<textarea rows="6" cols="30">';
echo htmlspecialchars(file_get_contents('patterns/'.$file));
echo '</textarea>';
echo '<p><a href="patterns/'.$file.'">'.$file.'</a></p>';
echo '</div>';
echo '</div>';
endforeach;
?>
</div>
</body>
</html>