Skip to content

Commit 465e5e9

Browse files
committed
[feature] adding scroll past end control
1 parent 03c81b7 commit 465e5e9

File tree

5 files changed

+32
-6
lines changed

5 files changed

+32
-6
lines changed

‎css/container.css‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@
3535
.is-layout-wide .container{
3636
width:70vw;
3737
}
38-
.is-layout-thin .container{
39-
width:30vw;
40-
}
38+
39+
.is-layout-thin .container{
40+
width:30vw;
41+
}
4142
}
4243

4344
@media (min-width:1600px){}

‎css/link.css‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
.link{
2-
margin-bottom:50vh;
2+
margin-bottom:2em;
33
width:100vw;
44
z-index:1;
55
}
66

7+
.is-scroll-past-end .link{
8+
margin-bottom:60vh;
9+
}
10+
711
.link-area{
812
width:100%;
913
display: grid;
@@ -27,7 +31,6 @@
2731
grid-template-columns:repeat(2,1fr);
2832
}
2933

30-
3134
.link-item{
3235
width:100%;
3336
height:var(--link-height);

‎index.html‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,13 @@ <h1 class="menu-header">Width</h1>
241241
<labelfor="control-layout-container-thin"><spanclass="label-icon"></span>Thin</label>
242242
</div>
243243
</div>
244+
<divclass="menu-item">
245+
<h1class="menu-header">Page</h1>
246+
<divclass="checkbox-wrap">
247+
<inputid="control-layout-scroll-past-end" class="control-layout-scroll-past-end" type="checkbox" tabindex="1">
248+
<labelfor="control-layout-scroll-past-end"><spanclass="label-icon"></span>Scroll past end</label>
249+
</div>
250+
</div>
244251
</div>
245252
</div>
246253
</div>

‎js/control.js‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,15 @@ var control = (function(){
6767
view[state.get().link.style]();
6868
};
6969
var_layout=function(){
70-
helper.removeClass(html,"is-layout-fludi");
70+
helper.removeClass(html,"is-layout-fluid");
7171
helper.removeClass(html,"is-layout-wide");
7272
helper.removeClass(html,"is-layout-thin");
7373
helper.addClass(html,"is-layout-"+state.get().layout.container);
74+
if(state.get().layout.scrollPastEnd){
75+
helper.addClass(html,"is-scroll-past-end");
76+
}else{
77+
helper.removeClass(html,"is-scroll-past-end");
78+
};
7479
};
7580
var_editAdd=function(){
7681
if(state.get().header.editAdd.active){
@@ -344,6 +349,14 @@ var control = (function(){
344349
data.save();
345350
},false);
346351
});
352+
helper.e(".control-layout-scroll-past-end").addEventListener("change",function(){
353+
state.change({
354+
path: "layout.scrollPastEnd",
355+
value: this.checked
356+
});
357+
render();
358+
data.save();
359+
},false);
347360
};
348361

349362
varupdate=function(){
@@ -366,6 +379,7 @@ var control = (function(){
366379
helper.e(".control-header-accent-active").checked=state.get().header.accent.active;
367380
helper.e(".control-layout-alignment-"+state.get().layout.alignment).checked=true;
368381
helper.e(".control-layout-container-"+state.get().layout.container).checked=true;
382+
helper.e(".control-layout-scroll-past-end").checked=state.get().layout.scrollPastEnd;
369383
};
370384

371385
varinit=function(){

‎js/state.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ var state = (function(){
5252
layout: {
5353
alignment: "left",
5454
container: "wide",
55+
scrollPastEnd: true,
5556
theme: {
5657
r: 0,
5758
g: 255,

0 commit comments

Comments
(0)