Skip to content

Commit 09f9725

Browse files
committed
LukyVj#61 Added site build files.
1 parent 8f8713a commit 09f9725

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

build/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ <h3>odd-between</h3>
233233
<header>
234234
<h3>n-between</h3>
235235
</header>
236-
<pre><code id='n-between'><span class="param">@include</span> n-between(<span class="num" contenteditable id="n-between-a">3</span>,<span class="num" contenteditable id="n-between-b">3</span>,<span class="num" contenteditable id="n-between-c">13</span>)&#x000A;<span class="comment"> // This mixin uses 3 arguments, the first one is equal to N item,&#x000A; // the second is the starting item and the thirs the end item. </span>&#x000A;</code></pre>
236+
<pre><code id='n-between'><span class="param">@include</span> n-between(<span class="num" contenteditable id="n-between-a">3</span>,<span class="num" contenteditable id="n-between-b">3</span>,<span class="num" contenteditable id="n-between-c">13</span>)&#x000A;<span class="comment"> // This mixin uses 3 arguments, the first one is equal to N item,&#x000A; // the second is the starting item and the third the end item. </span>&#x000A;</code></pre>
237237
<ul class='n-between'>
238238
<li>1</li>
239239
<li>2</li>
@@ -274,7 +274,7 @@ <h3>all-but</h3>
274274
<header>
275275
<h3>each</h3>
276276
</header>
277-
<pre><code><span class="param"> @include</span> each(<span class="num" contenteditable id="each">3</span>)&#x000A;&#x000A;<span class="comment"> // Alias of each()</span>&#x000A;<span class="param"> @include</span> every(<span class="num" contenteditable id="each">3</span>)&#x000A;</code></pre>
277+
<pre><code id='each'><span class="param"> @include</span> each(<span class="num" contenteditable id="each-every">3</span>,<span class="num" contenteditable id="each-from">0</span>)&#x000A;<span class="comment"> // This mixin uses 2 arguments, the first one is equal to N item,&#x000A; // the second is the starting item and can be omitted, the default value is 0. </span>&#x000A;&#x000A;<span class="param"> @include</span> every(<span class="num">3</span>, <span class="num">1</span>)&#x000A;<span class="comment"> // Alias of each(), but the starting item defaults to 1.</span>&#x000A;</code></pre>
278278
<ul class='each'>
279279
<li>1</li>
280280
<li>2</li>

build/javascripts/demo.js

+18-7
Original file line numberDiff line numberDiff line change
@@ -211,20 +211,31 @@ document.getElementById('all-but').addEventListener('keyup', function(){
211211
// each
212212
///////////////////////////////
213213

214-
function each(num) {
215-
function injectStyle(num){
214+
function each(numa, numb) {
215+
function injectStyle(numa, numb){
216216
document.getElementById('style-each').innerHTML = `ul.each li { ${preStyle} }`;
217-
document.getElementById('style-each').innerHTML += `.each li:nth-child(${num}n){
218-
${selectedStyle}
217+
218+
if (numb == 0) {
219+
document.getElementById('style-each').innerHTML += `.each li:nth-child(${numa}n){
220+
${selectedStyle}
221+
}
222+
`
223+
}
224+
else {
225+
document.getElementById('style-each').innerHTML += `.each li:nth-child(${numa}n + ${numb}){
226+
${selectedStyle}
227+
}
228+
`
219229
}
220-
`
221230
}
222231

223-
var newStyle = injectStyle(num);
232+
var newStyle = injectStyle(numa, numb);
224233

225234
}
226235
document.getElementById('each').addEventListener('keyup', function(){
227-
each(this.innerHTML)
236+
var vala = document.getElementById('each-every').innerHTML;
237+
var valb = document.getElementById('each-from').innerHTML;
238+
each(vala, valb)
228239
})
229240

230241
///////////////////////////////

0 commit comments

Comments
 (0)