Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated description; Added glow for selected patterns; Selected patte…

…rn name visible
  • Loading branch information...
commit 3a1f8bdeeb1e60939947fcf60dbd73bc6120d57e 1 parent dd6d7c7
@overra authored
View
2  extension/manifest.json
@@ -2,7 +2,7 @@
"name": "Subtle Patterns Preview",
"version": "0.0.4",
"manifest_version": 2,
- "description": "Preview patterns from Subtle Patterns as page background.",
+ "description": "Preview tool for Subtle Patterns.",
"icons": {
"48": "icon-48.png",
"128": "icon-128.png"
View
5 extension/popup.css
@@ -41,6 +41,11 @@ body {
z-index: 0;
}
+.pattern.selected {
+ box-shadow: inset 0px 1px 2px rgba(0,0,0,.2),
+ 0px 0px 2px 1px rgba(0,0,255,1);
+}
+
#details {
position: relative;
height: 25px;
View
10 extension/popup.js
@@ -5,7 +5,8 @@ var raw_url = 'https://raw.github.com/subtlepatterns/SubtlePatterns/master/',
prev_btn = document.getElementById('prev'),
target_div = document.getElementById('target'),
patterns,
- page;
+ page,
+ selected;
function loadPatterns() {
@@ -38,9 +39,14 @@ function loadPatterns() {
name_div.innerText = this.getAttribute('data-name');
};
pattern.onmouseout = function() {
- name_div.innerText = '';
+ name_div.innerText = selected.getAttribute('data-name')||'';
};
pattern.onclick = function() {
+ if (selected) {
+ selected.className = 'pattern';
+ }
+ this.className = 'pattern selected';
+ selected = this;
chrome.extension.sendMessage({
pattern: this.getAttribute('data-name'),
selector: target_div.value
Please sign in to comment.
Something went wrong with that request. Please try again.