Skip to content

Commit 6d8f1c2

Browse files
committed
[feature] adding control for link item grow on hover
1 parent e0ae960 commit 6d8f1c2

File tree

6 files changed

+51
-23
lines changed

6 files changed

+51
-23
lines changed

‎css/link.css‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@
4949
z-index:1;
5050
}
5151

52-
.link-item:focus-within,
53-
.link-item:focus,
54-
.link-item:hover{
52+
.is-link-item-hover-scale .link-item:focus-within,
53+
.is-link-item-hover-scale .link-item:focus,
54+
.is-link-item-hover-scale .link-item:hover{
5555
transform:scale(1.05);
5656
z-index:2;
5757
outline:0;
5858
}
5959

60-
.link-item:active{
60+
.is-link-item-hover-scale .link-item:active{
6161
transform:scale(1.04);
6262
transition: none;
6363
}
@@ -75,7 +75,7 @@
7575
transition: background-color var(--animation-speed-fast) ease-in-out, height var(--animation-speed-fast) ease-in-out, box-shadow var(--animation-speed-fast) ease-in-out;
7676
}
7777

78-
.is-link-item-line-show .link-panel-front{
78+
.is-link-item-line .link-panel-front{
7979
height:calc(100%-var(--line-width));
8080
}
8181

@@ -175,14 +175,14 @@
175175
transition: height var(--animation-speed-fast) ease-in-out, top var(--animation-speed-fast) ease-in-out;
176176
}
177177

178-
.is-link-item-line-show .link-panel-back{
178+
.is-link-item-line .link-panel-back{
179179
height:calc(100%-var(--line-width));
180180
}
181181

182182
.is-link-edit .link-panel-back,
183-
.is-link-url-show:not(.is-link-item-line-show) .link-item:focus .link-panel-back,
184-
.is-link-url-show:not(.is-link-item-line-show) .link-item:focus-within .link-panel-back,
185-
.is-link-url-show:not(.is-link-item-line-show) .link-item:hover .link-panel-back{
183+
.is-link-url-show:not(.is-link-item-line) .link-item:focus .link-panel-back,
184+
.is-link-url-show:not(.is-link-item-line) .link-item:focus-within .link-panel-back,
185+
.is-link-url-show:not(.is-link-item-line) .link-item:hover .link-panel-back{
186186
top:0;
187187
height:100%;
188188
}

‎index.html‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -803,8 +803,13 @@ <h1 class="menu-item-header-text">Bookmarks</h1>
803803
</div>
804804
<hr>
805805
<divclass="input-wrap">
806-
<inputid="control-link-item-line-show" class="control-link-item-line-show" type="checkbox" tabindex="1">
807-
<labelfor="control-link-item-line-show">Tile line</label>
806+
<inputid="control-link-item-line" class="control-link-item-line" type="checkbox" tabindex="1">
807+
<labelfor="control-link-item-line">Tile line</label>
808+
</div>
809+
<hr>
810+
<divclass="input-wrap">
811+
<inputid="control-link-item-hover-scale" class="control-link-item-hover-scale" type="checkbox" tabindex="1">
812+
<labelfor="control-link-item-hover-scale">Grow on hover</label>
808813
</div>
809814
<hr>
810815
<labelclass="control-link-item-display-alignment-horizontal-label">Content Horizontal Alignment</label>

‎js/control.js‎

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1841,8 +1841,15 @@ var control = (function(){
18411841
render();
18421842
}
18431843
},{
1844-
element: helper.e(".control-link-item-line-show"),
1845-
path: "link.item.line.show",
1844+
element: helper.e(".control-link-item-line"),
1845+
path: "link.item.line",
1846+
type: "checkbox",
1847+
func: function(){
1848+
render();
1849+
}
1850+
},{
1851+
element: helper.e(".control-link-item-hover-scale"),
1852+
path: "link.item.hoverScale",
18461853
type: "checkbox",
18471854
func: function(){
18481855
render();
@@ -2312,7 +2319,8 @@ var control = (function(){
23122319
helper.removeClass(html,"is-link-url-show");
23132320
helper.removeClass(html,"is-link-url-style-light");
23142321
helper.removeClass(html,"is-link-url-style-dark");
2315-
helper.removeClass(html,"is-link-item-line-show");
2322+
helper.removeClass(html,"is-link-item-line");
2323+
helper.removeClass(html,"is-link-item-hover-scale");
23162324
helper.removeClass(html,"is-link-item-alignment-horizontal-left");
23172325
helper.removeClass(html,"is-link-item-alignment-horizontal-center");
23182326
helper.removeClass(html,"is-link-item-alignment-horizontal-right");
@@ -2336,8 +2344,11 @@ var control = (function(){
23362344
if(state.get().link.item.url.show){
23372345
helper.addClass(html,"is-link-url-show");
23382346
};
2339-
if(state.get().link.item.line.show){
2340-
helper.addClass(html,"is-link-item-line-show");
2347+
if(state.get().link.item.line){
2348+
helper.addClass(html,"is-link-item-line");
2349+
};
2350+
if(state.get().link.item.hoverScale){
2351+
helper.addClass(html,"is-link-item-hover-scale");
23412352
};
23422353
if(state.get().link.edit){
23432354
helper.addClass(html,"is-link-edit");
@@ -2688,7 +2699,8 @@ var control = (function(){
26882699
helper.e(".control-link-item-url-show").disabled=true;
26892700
helper.e(".control-link-item-url-style-dark").disabled=true;
26902701
helper.e(".control-link-item-url-style-light").disabled=true;
2691-
helper.e(".control-link-item-line-show").disabled=true;
2702+
helper.e(".control-link-item-line").disabled=true;
2703+
helper.e(".control-link-item-hover-scale").disabled=true;
26922704
helper.e(".control-link-item-display-alignment-horizontal-label").setAttribute("disabled","");
26932705
helper.e(".control-link-item-display-alignment-horizontal-left").disabled=true;
26942706
helper.e(".control-link-item-display-alignment-horizontal-center").disabled=true;
@@ -2718,7 +2730,8 @@ var control = (function(){
27182730
helper.e(".control-link-item-display-show").disabled=false;
27192731
helper.e(".control-link-item-name-show").disabled=false;
27202732
helper.e(".control-link-item-url-show").disabled=false;
2721-
helper.e(".control-link-item-line-show").disabled=false;
2733+
helper.e(".control-link-item-line").disabled=false;
2734+
helper.e(".control-link-item-hover-scale").disabled=false;
27222735
helper.e(".control-link-new-tab").disabled=false;
27232736
helper.e(".control-link-style-block").disabled=false;
27242737
helper.e(".control-link-style-list").disabled=false;

‎js/state.js‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ var state = (function(){
138138
}
139139
},
140140
item: {
141-
size: 1,
142141
display: {
143142
show: true,
144143
size: 2,
@@ -161,9 +160,9 @@ var state = (function(){
161160
show: true,
162161
style: "dark"
163162
},
164-
line: {
165-
show: true
166-
}
163+
size: 1,
164+
line: true,
165+
hoverScale: true
167166
},
168167
show: true,
169168
newTab: false,

‎js/update.js‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,13 @@ var update = (function(){
471471
returndata;
472472
};
473473

474+
var_update_3110=function(data){
475+
data.version="3.11.0";
476+
data.state.link.item.line=data.state.link.item.line.show;
477+
data.state.link.item.hoverScale=true;
478+
returndata;
479+
};
480+
474481
// var _update_300 = function(data){
475482
// data.version = 3.00;
476483
// return data;
@@ -597,6 +604,10 @@ var update = (function(){
597604
console.log("\t= running update 3.10.0");
598605
data=_update_3100(data);
599606
};
607+
if(version.compare(data.version,"3.11.0")==-1){
608+
console.log("\t= running update 3.11.0");
609+
data=_update_3110(data);
610+
};
600611
};
601612
// if no update is needed
602613
// version bump

‎js/version.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
varversion=(function(){
22

33
// version is normally bumped when the state needs changing or any new functionality is added
4-
varcurrent="3.10.3";
4+
varcurrent="3.11.0";
55

66
varcompare=function(a,b){
77
varpa=a.split(".");

0 commit comments

Comments
(0)