From 0fd7618d5c92bf5f841762edb47e7a0f56c09f64 Mon Sep 17 00:00:00 2001 From: Kuldeep M Date: Wed, 11 Sep 2019 17:12:08 +0100 Subject: [PATCH] [feature] add tile shadow options --- package.json | 2 +- src/css/link.css | 16 +++++++++------- src/index.html | 5 +++++ src/js/control.js | 13 +++++++++++++ src/js/state.js | 3 +++ src/js/update.js | 6 ++++++ src/js/version.js | 2 +- src/manifest.json | 2 +- 8 files changed, 39 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index b9af4df2..5c1493f4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nighttab", - "version": "3.81.0", + "version": "3.82.0", "description": "A neutral new tab page accented with a chosen colour. Customise the layout, style, background and bookmarks in nightTab.", "main": "index.js", "scripts": { diff --git a/src/css/link.css b/src/css/link.css index 82572a4c..ea334ead 100755 --- a/src/css/link.css +++ b/src/css/link.css @@ -131,12 +131,9 @@ text-decoration: none; } -.link-item:focus .link-panel-front, -.link-item:focus-within .link-panel-front, -.link-item:hover .link-panel-front { - text-decoration: none; - outline: none; - background-color: rgb(var(--theme-gray-03)); +.is-link-item-shadow-show .link-item:focus .link-panel-front, +.is-link-item-shadow-show .link-item:focus-within .link-panel-front, +.is-link-item-shadow-show .link-item:hover .link-panel-front { box-shadow: var(--layout-shadow-large); } @@ -547,7 +544,12 @@ .is-link-edit .link-item:hover .link-panel-front, .is-link-edit .link-item:focus .link-panel-front { height: calc(100% - var(--link-item-edit-height)); - box-shadow: var(--layout-shadow-small); +} + +.is-link-item-shadow-show.is-link-edit .link-panel-front, +.is-link-item-shadow-show.is-link-edit .link-item:hover .link-panel-front, +.is-link-item-shadow-show.is-link-edit .link-item:focus .link-panel-front { + box-shadow: var(--layout-shadow-medium); } .is-link-edit.is-link-item-url-show .link-item:focus .link-panel-front, diff --git a/src/index.html b/src/index.html index e14aa1fb..7037a9bb 100644 --- a/src/index.html +++ b/src/index.html @@ -903,6 +903,11 @@
+
+ + +
+
diff --git a/src/js/control.js b/src/js/control.js index 551eb932..a777e40e 100644 --- a/src/js/control.js +++ b/src/js/control.js @@ -1947,6 +1947,13 @@ var control = (function() { func: function() { render.class(); } + }, { + element: helper.e(".control-link-item-shadow-show"), + path: "link.item.shadow.show", + type: "checkbox", + func: function() { + render.class(); + } }, { element: helper.e(".control-link-item-name-show"), path: "link.item.name.show", @@ -2531,6 +2538,7 @@ var control = (function() { helper.removeClass(html, "is-link-display-alignment-bottomright"); helper.removeClass(html, "is-link-item-url-show"); helper.removeClass(html, "is-link-item-line-show"); + helper.removeClass(html, "is-link-item-shadow-show"); helper.removeClass(html, "is-link-item-hoverscale"); helper.removeClass(html, "is-link-item-alignment-left"); helper.removeClass(html, "is-link-item-alignment-center"); @@ -2559,6 +2567,9 @@ var control = (function() { if (state.get().link.item.line.show) { helper.addClass(html, "is-link-item-line-show"); }; + if (state.get().link.item.shadow.show) { + helper.addClass(html, "is-link-item-shadow-show"); + }; if (state.get().link.item.hoverScale) { helper.addClass(html, "is-link-item-hoverscale"); }; @@ -2969,6 +2980,7 @@ var control = (function() { _disable.element(".control-link-item-order-namedisplay-helper", true); _disable.input(".control-link-item-url-show", true); _disable.input(".control-link-item-line-show", true); + _disable.input(".control-link-item-shadow-show", true); _disable.input(".control-link-item-hoverscale", true); _disable.element(".control-link-item-display-alignment-grid", true); _disable.element(".control-link-item-display-alignment-label", true); @@ -3015,6 +3027,7 @@ var control = (function() { _disable.input(".control-link-item-name-show", false); _disable.input(".control-link-item-url-show", false); _disable.input(".control-link-item-line-show", false); + _disable.input(".control-link-item-shadow-show", false); _disable.input(".control-link-item-hoverscale", false); _disable.input(".control-link-newtab", false); _disable.input(".control-link-style-block", false); diff --git a/src/js/state.js b/src/js/state.js index a4f9c1b3..eaaa1369 100644 --- a/src/js/state.js +++ b/src/js/state.js @@ -159,6 +159,9 @@ var state = (function() { line: { show: true }, + shadow: { + show: true + }, hoverScale: { show: true }, diff --git a/src/js/update.js b/src/js/update.js index b263fbb8..17e89da0 100644 --- a/src/js/update.js +++ b/src/js/update.js @@ -612,6 +612,12 @@ var update = (function() { "3.81.0": function(data) { data.state.link.orientation = "bottom"; return data; + }, + "3.82.0": function(data) { + data.state.link.item.shadow = { + show: true + }; + return data; } }; diff --git a/src/js/version.js b/src/js/version.js index 787a6893..4dbd821c 100644 --- a/src/js/version.js +++ b/src/js/version.js @@ -1,6 +1,6 @@ var version = (function() { - var current = "3.81.0"; + var current = "3.82.0"; var compare = function(a, b) { var pa = a.split("."); diff --git a/src/manifest.json b/src/manifest.json index 26c141c7..66497e94 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -2,7 +2,7 @@ "name": "nightTab", "short_name": "nightTab", "description": "A neutral new tab page accented with a chosen colour. Customise the layout, style, background and bookmarks in nightTab.", - "version": "3.81.0", + "version": "3.82.0", "manifest_version": 2, "chrome_url_overrides": { "newtab": "index.html"