-
Notifications
You must be signed in to change notification settings - Fork 0
/
eiercodes.html
179 lines (165 loc) · 8.04 KB
/
eiercodes.html
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
<!DOCTYPE html>
<html>
<head>
<title>Eiercode-matcher</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style type="text/css">
@import 'fonts/font.css';
body,
html {
background: lightgray;
}
* {
text-align: center;
font-size: 24px;
font-family: 'Comic Neue', 'Comic Sans MS', sans-serif;
font-weight: 400;
line-height: 1.5;
/* Enable a font's kerning: http://stackoverflow.com/questions/15160897/font-feature-settings-what-is-the-correct-syntax */
font-feature-settings: "kern";
-moz-font-feature-settings: "kern";
-webkit-font-feature-settings: "kern";
}
.invoer,
p {
font-size: 18px;
font-style: italic;
}
.resultaat {
margin-top: 10px;
}
.input {
display: none;
}
#code {
margin-top: 20px;
}
#kwaliteit,
#land {
width: 1.7em;
}
#id {
width: 4.6em;
}
.resultaat :not(.invoer) {
display: none;
}
.lijst1 {
color: red;
}
.lijst2,
.lijst3 {
color: darkorange;
}
.veilig {
color: green;
}
</style>
</head>
<body>
<div id="code">
<label for="kwaliteit">Code zoals op EI</label>
<div style="display:inline-block">
<input type="number" id="kwaliteit" maxlength="1" min="0" max="2" pattern="\d*" />
<input type="text" disabled id="land" value="NL" />
<input type="number" id="id" maxlength="7" min="1000000" max="9999999" pattern="\d*" /></div>
</div>
<div class="resultaat">
<div class="invoer">Voer de code in zoals op het EI te vinden is. B.v. 1 NL 2345678. Geen NL? Dan weet ik het niet!</div>
<div class="veilig">Veilig :)</div>
<div class="lijst3">Fipronil aangetroffen in bedrijf! (Is het dan wel veilig? Geen idee!)</div>
<div class="lijst2">Niet door kinderen laten eten</div>
<div class="lijst1">ECHT niet eten!</div>
</div>
<div class="input">
<div data-id="lijst1">
2-NL-4015502
</div>
<div data-id="lijst2">
eicodes X-NL 40004XX tot en met X-NL 42068XX X-NL 40004XX X-NL 40709XX X-NL 40050XX X-NL 41176XX X-NL 40173XX X-NL 41205XX
X-NL 40309XX X-NL 41261XX X-NL 40385XX X-NL 41435XX X-NL 40446XX X-NL 41437XX X-NL 40494XX X-NL 41649XX X-NL
40534XX X-NL 41679XX X-NL 40554XX X-NL 42037XX X-NL 40567XX X-NL 42068XX eicodes X-NL 42071XX tot en met X-NL
43345XX X-NL 42071XX X-NL 42864XX X-NL 42206XX X-NL 42894XX X-NL 42395XX X-NL 42987XX X-NL 42568XX X-NL 42995XX
X-NL 42635XX X-NL 43100XX X-NL 42659XX X-NL 43113XX X-NL 42736XX X-NL 43154XX X-NL 42766XX X-NL 43224XX X-NL
42775XX X-NL 43326XX X-NL 42858XX X-NL 43345XX eicodes X-NL 43425XX tot en met X-NL 46351XX X-NL 43425XX X-NL
43835XX X-NL 43434XX X-NL 43872XX X-NL 43476XX X-NL 43879XX X-NL 43501XX X-NL 43925XX X-NL 43514XX X-NL 43943XX
X-NL 43526XX X-NL 43998XX X-NL 43640XX X-NL 44023XX X-NL 43657XX X-NL 46351XX X-NL 43665XX X-NL 43780XX </div>
<div data-id="lijst3">
eicodes 2-NL-4015502 tot en met X-NL 40419XX 2-NL-4015502 X-NL 40004XX X-NL 40255XX X-NL 40040XX X-NL 40275XX X-NL 40050XX
X-NL 40303XX X-NL 40105XX X-NL 40309XX X-NL 40122XX X-NL 40385XX X-NL 40135XX X-NL 40386XX X-NL 40165XX X-NL
40411XX X-NL 40173XX X-NL 40412XX X-NL 40227XX X-NL 40415XX X-NL 40240XX X-NL 40419XX eicodes X-NL 40444XX tot
en met X-NL 41227XX X-NL 40444XX X-NL 40709XX X-NL 40446XX X-NL 40746XX X-NL 40494XX X-NL 40832XX X-NL 40496XX
X-NL 41086XX X-NL 40505XX X-NL 41110XX X-NL 40534XX X-NL 41129XX X-NL 40544XX X-NL 41169XX X-NL 40554XX X-NL
41176XX X-NL 40567XX X-NL 41205XX X-NL 40658XX X-NL 41227XX eicodes X-NL 41261XX tot en met X-NL 42121XX X-NL
41261XX X-NL 41856XX X-NL 41284XX X-NL 41973XX X-NL 41435XX X-NL 42037XX X-NL 41437XX X-NL 42051XX X-NL 41488XX
X-NL 42068XX X-NL 41506XX X-NL 42071XX X-NL 41649XX X-NL 42083XX X-NL 41679XX X-NL 42102XX X-NL 41701XX X-NL
42114XX X-NL 41746XX X-NL 42121XX eicodes X-NL 42151XX tot en met X-NL 42826XX X-NL 42151XX X-NL 42693XX X-NL
42183XX X-NL 42708XX X-NL 42206XX X-NL 42722XX X-NL 42364XX X-NL 42723XX X-NL 42395XX X-NL 42736XX X-NL 42532XX
X-NL 42756XX X-NL 42568XX X-NL 42766XX X-NL 42635XX X-NL 42775XX X-NL 42650XX X-NL 42810XX X-NL 42659XX X-NL
42826XX eicodes X-NL 42858XX tot en met X-NL 43425XX X-NL 42858XX X-NL 43100XX X-NL 42860XX X-NL 43113XX X-NL
42864XX X-NL 43154XX X-NL 42894XX X-NL 43195XX X-NL 42901XX X-NL 43224XX X-NL 42978XX X-NL 43319XX X-NL 42984XX
X-NL 43326XX X-NL 42987XX X-NL 43345XX X-NL 42995XX X-NL 43399XX X-NL 43020XX X-NL 43425XX eicodes X-NL 43434XX
to en met X-NL 43780XX X-NL 43434XX X-NL 43657XX X-NL 43476XX X-NL 43665XX X-NL 43501XX X-NL 43667XX X-NL 43514XX
X-NL 43672XX X-NL 43526XX X-NL 43680XX X-NL 43560XX X-NL 43685XX X-NL 43598XX X-NL 43702XX X-NL 43601XX X-NL
43703XX X-NL 43615XX X-NL 43708XX X-NL 43640XX X-NL 43780XX eicodes X-NL 43781XX tot en met X-NL 46351XX X-NL
43781XX X-NL 43926XX X-NL 43835XX X-NL 43943XX X-NL 43838XX X-NL 43992XX X-NL 43855XX X-NL 43998XX X-NL 43872XX
X-NL 44013XX X-NL 43879XX X-NL 44023XX X-NL 43894XX X-NL 46351XX X-NL 43903XX X-NL 43916XX X-NL 43925XX
</div>
<div data-id="veilig">
X-NL XXXXXXX
</div>
</div>
<p>Mocht het lettertype het al niet weggeven: <u>dit is niet officieel!</u></p>
<p><a href="https://www.nvwa.nl/onderwerpen/biociden/fipronil-in-eieren/lijst-met-eicodes-waarvan-de-nvwa-adviseert-ze-niet-te-eten">HIER is de officiele lijst!</a></p>
<p> Laatst geüpdatet op 3 oktober 2017 @ 22:26</p>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script type="text/javascript">
function parse(text) {
var codes = $.map(text.match(/[\dX]-NL[\- ][\dX]+/g), function (val) { return val.replace(/X/g, '\\d').replace(/[ \-]/g, ''); });
return RegExp(`^(${codes.join('|')})$`, 'g');
}
var codes = (function () {
var result = {};
$('.input div').each(function (index, elem) {
var $elem = $(elem);
result[$elem.data().id] = parse($elem.text());
});
return result;
})();
function validate(code) {
var code = code.replace(/[ \-]/g, '').toUpperCase().trim();
var lijsten = ['veilig', 'lijst3', 'lijst2', 'lijst1'];
var lijst = null;
for (var i = 0; i < lijsten.length; i++) {
var pattern = codes[lijsten[i]];
if (pattern.test(code)) {
lijst = lijsten[i];
}
pattern.lastIndex = 0;
}
function toggle(name) {
$(`.resultaat div:not(.${name})`).hide();
$(`.resultaat div.${name}`).show();
}
toggle(lijst == null ? 'invoer' : lijst);
}
function getValue() {
return $('#kwaliteit').val() + $('#land').val() + $('#id').val();
}
$(document).ready(function () {
var kwaliteit = '';
$('#kwaliteit').on('change keyup', function () {
var currVal = $('#kwaliteit').val();
if (currVal.length && kwaliteit != currVal) {
$('#id').focus();
kwaliteit = currVal;
}
});
$('#kwaliteit,#land,#id').on('change keyup', function () {
validate(getValue());
});
validate(getValue());
});
</script>
</body>
</html>