Skip to content

Commit 2b13ea4

Browse files
committed
🎉 Works
1 parent d04cc57 commit 2b13ea4

8 files changed

Lines changed: 90 additions & 7 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules/

index.css

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
body {
2+
width: 400px;
3+
}
4+
5+
button {
6+
width: 148px;
7+
height: 7pc;
8+
font-weight: 900;
9+
color: #fff;
10+
margin: 8px;
11+
border: none;
12+
border-radius: 10px;
13+
text-transform: uppercase;
14+
}
15+
16+
.blue {
17+
background-color: rgb(0, 121, 191);
18+
}
19+
20+
.yellow {
21+
background-color: rgb(210, 144, 52);
22+
}
23+
24+
.green {
25+
background-color: rgb(81, 152, 57);
26+
}
27+
28+
.red {
29+
background-color: rgb(176, 70, 50);
30+
}
31+
32+
.purple {
33+
background-color: rgb(137, 96, 158);
34+
}
35+
36+
.pink {
37+
background-color: rgb(205, 90, 145);
38+
}
39+
40+
.lightgreen {
41+
background-color: rgb(75, 191, 107);
42+
}
43+
44+
.lightblue {
45+
background-color: rgb(0, 174, 204);
46+
}
47+
48+
.grey {
49+
background-color: rgb(131, 140, 145);
50+
}

index.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,19 @@
22
<html>
33
<head>
44
<meta charset="utf-8">
5-
<link rel="stylesheet" href="./index.js">
5+
<script src="./node_modules/jquery/dist/jquery.min.js"></script>
6+
<link rel="stylesheet" href="./index.css">
67
</head>
78
<body>
9+
<button id="rgb(0, 121, 191)" class="blue">blue</button>
10+
<button id="rgb(210, 144, 52)" class="yellow">yellow</button>
11+
<button id="rgb(81, 152, 57)" class="green">green</button>
12+
<button id="rgb(176, 70, 50)" class="red">red</button>
13+
<button id="rgb(137, 96, 158)" class="purple">purple</button>
14+
<button id="rgb(205, 90, 145)" class="pink">pink</button>
15+
<button id="rgb(75, 191, 107)" class="lightgreen">light green</button>
16+
<button id="rgb(0, 174, 204)" class="lightblue">light blue</button>
17+
<button id="rgb(131, 140, 145)" class~"gray">gray</button>
18+
<script src="./index.js"></script>
819
</body>
920
</html>

index.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
function click(e) {
2+
chrome.tabs.executeScript(null,
3+
{code:"$('.board, .board-body').css('background-color','" + e.target.id + "');"});
4+
window.close();
5+
}
6+
document.addEventListener('DOMContentLoaded', function () {
7+
var buttons = document.querySelectorAll('button');
8+
for (var i = 0; i < buttons.length; i++) {
9+
buttons[i].addEventListener('click', click);
10+
}
11+
});

manifest.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
"matches": [
2121
"https://waffle.io/**/*"
2222
],
23-
"js": ["./index.js"],
23+
"js": ["./node_modules/jquery/dist/jquery.min.js"],
2424
"run_at": "document_end"
2525
}
2626
],
2727
"permissions": [
28-
"tabs", "http://*/*", "https://*/*"
28+
"tabs", "http://*/*", "https://*/*", "activeTab"
2929
]
30-
}
30+
}

node_modules/.yarn-integrity

Lines changed: 6 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,8 @@
44
"main": "index.js",
55
"repository": "https://github.com/risacan/chrome-extension-waffleio.git",
66
"author": "Risa Harada <risa.harada@kidsstar.co.jp>",
7-
"license": "MIT"
7+
"license": "MIT",
8+
"dependencies": {
9+
"jquery": "^3.2.1"
10+
}
811
}

yarn.lock

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@
22
# yarn lockfile v1
33

44

5+
jquery@^3.2.1:
6+
version "3.2.1"
7+
resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.2.1.tgz#5c4d9de652af6cd0a770154a631bba12b015c787"

0 commit comments

Comments
 (0)