Skip to content

Commit e8830ef

Browse files
authored
Tweaks (#7)
* Tweaks * Add Fontawesome * Tweaks * Tweaks * Tweaks * Tweaks * Tweaks * Tweaks
1 parent 08e15a2 commit e8830ef

File tree

6 files changed

+45
-31
lines changed

6 files changed

+45
-31
lines changed

gulpfile.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,23 @@ gulp.task('bootstrap', () => {
99
.pipe(gulp.dest('src/dist/bootstrap'))
1010
})
1111

12+
gulp.task('fontawesome', () => {
13+
return gulp
14+
.src(
15+
[
16+
'node_modules/@fortawesome/fontawesome-free/css/all.min.css',
17+
'node_modules/@fortawesome/fontawesome-free/webfonts/fa-regular-*',
18+
'node_modules/@fortawesome/fontawesome-free/webfonts/fa-solid-*',
19+
],
20+
{ base: 'node_modules/@fortawesome/fontawesome-free' }
21+
)
22+
.pipe(gulp.dest('src/dist/fontawesome'))
23+
})
24+
1225
gulp.task('jquery', () => {
1326
return gulp
1427
.src('node_modules/jquery/dist/jquery.min.js')
1528
.pipe(gulp.dest('src/dist/jquery'))
1629
})
1730

18-
gulp.task('default', gulp.parallel('bootstrap', 'jquery'))
31+
gulp.task('default', gulp.parallel('bootstrap', 'fontawesome', 'jquery'))

package-lock.json

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

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"build": "npm run build:chrome && npm run build:firefox"
1212
},
1313
"dependencies": {
14+
"@fortawesome/fontawesome-free": "^6.5.1",
1415
"bootstrap": "^5.3.2",
1516
"jquery": "^3.7.1"
1617
},

src/html/options.html

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<title>SMWC Web Extension</title>
55
<link rel="icon" href="../images/logo16.png" sizes="any">
66
<link rel="stylesheet" type="text/css" href="../dist/bootstrap/bootstrap.min.css">
7+
<link rel="stylesheet" type="text/css" href="../dist/fontawesome/css/all.min.css">
78
<link rel="stylesheet" type="text/css" href="../css/main.css">
89
<link rel="stylesheet" type="text/css" href="../css/options.css">
910
<script type="text/javascript" src="../js/theme.js"></script>
@@ -15,9 +16,10 @@
1516
<div class="col-xl-6 col-md-8 col-12 m-auto">
1617
<div class="card" >
1718
<div class="card-body">
18-
<div class="justify-content-center align-items-center d-flex">
19-
<img src="../images/logo48.png" class="img-fluid float-start me-2" alt="SMWC Web Extension" height="48" width="48">
20-
<h1 class="align-middle">SMWC Web Extension</h1>
19+
<div class="d-flex justify-content-center align-items-center">
20+
<img src="../images/logo48.png" class="me-2" height="48" width="48"
21+
alt="SMWC Web Extension" title="SMWC Web Extension">
22+
<h1>SMWC Web Extension</h1>
2123
</div>
2224
<div class="clearfix"></div>
2325
<p class="text-center lead">v<span id="version"></span></p>
@@ -26,7 +28,7 @@ <h1 class="align-middle">SMWC Web Extension</h1>
2628
<thead class="visually-hidden"><tr><th>Description</th><th>Shortcut</th></tr></thead>
2729
<tbody>
2830
<tr>
29-
<td>Show Popup Action <svg class="ms-1"><use xlink:href="#bi-keyboard" /></svg></td>
31+
<td>Show Popup Action <i class="fa-regular fa-keyboard ms-1"></i></td>
3032
<td class="text-end" title="Keyboard Shortcut"><kbd id="mainKey">Unknown</kbd></td>
3133
</tr>
3234
</tbody>
@@ -38,7 +40,7 @@ <h1 class="align-middle">SMWC Web Extension</h1>
3840
<label class="form-check-label" for="contextMenu" aria-describedby="contextMenuHelp">
3941
Enable Right Click Menu
4042
<span data-bs-toggle="tooltip" data-bs-title="Show Context Menu on Right Click.">
41-
<svg class="ms-1"><use xlink:href="#bi-info-circle-fill" /></svg>
43+
<i class="fa-solid fa-circle-info ms-1"></i>
4244
</span>
4345
</label>
4446
</div>
@@ -47,7 +49,7 @@ <h1 class="align-middle">SMWC Web Extension</h1>
4749
<label class="form-check-label" for="showUpdate" aria-describedby="showUpdateHelp">
4850
Show Release Notes on Update
4951
<span data-bs-toggle="tooltip" data-bs-title="Show Release Notes on Version Update.">
50-
<svg class="ms-1"><use xlink:href="#bi-info-circle-fill" /></svg>
52+
<i class="fa-solid fa-circle-info ms-1"></i>
5153
</span>
5254
</label>
5355
</div>
@@ -108,13 +110,6 @@ <h1 class="align-middle">SMWC Web Extension</h1>
108110
<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" id="bi-dot" viewBox="0 0 16 16">
109111
<path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3"/>
110112
</svg>
111-
<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" id="bi-info-circle-fill" viewBox="0 0 16 16">
112-
<path d="M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16zm.93-9.412-1 4.705c-.07.34.029.533.304.533.194 0 .487-.07.686-.246l-.088.416c-.287.346-.92.598-1.465.598-.703 0-1.002-.422-.808-1.319l.738-3.468c.064-.293.006-.399-.287-.47l-.451-.081.082-.381 2.29-.287zM8 5.5a1 1 0 1 1 0-2 1 1 0 0 1 0 2z"/>
113-
</svg>
114-
<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" id="bi-keyboard" viewBox="0 0 16 16">
115-
<path d="M14 5a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1zM2 4a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z"/>
116-
<path d="M13 10.25a.25.25 0 0 1 .25-.25h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5a.25.25 0 0 1-.25-.25zm0-2a.25.25 0 0 1 .25-.25h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5a.25.25 0 0 1-.25-.25zm-5 0A.25.25 0 0 1 8.25 8h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5A.25.25 0 0 1 8 8.75zm2 0a.25.25 0 0 1 .25-.25h1.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-1.5a.25.25 0 0 1-.25-.25zm1 2a.25.25 0 0 1 .25-.25h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5a.25.25 0 0 1-.25-.25zm-5-2A.25.25 0 0 1 6.25 8h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5A.25.25 0 0 1 6 8.75zm-2 0A.25.25 0 0 1 4.25 8h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5A.25.25 0 0 1 4 8.75zm-2 0A.25.25 0 0 1 2.25 8h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5A.25.25 0 0 1 2 8.75zm11-2a.25.25 0 0 1 .25-.25h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5a.25.25 0 0 1-.25-.25zm-2 0a.25.25 0 0 1 .25-.25h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5a.25.25 0 0 1-.25-.25zm-2 0A.25.25 0 0 1 9.25 6h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5A.25.25 0 0 1 9 6.75zm-2 0A.25.25 0 0 1 7.25 6h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5A.25.25 0 0 1 7 6.75zm-2 0A.25.25 0 0 1 5.25 6h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5A.25.25 0 0 1 5 6.75zm-3 0A.25.25 0 0 1 2.25 6h1.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-1.5A.25.25 0 0 1 2 6.75zm0 4a.25.25 0 0 1 .25-.25h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5a.25.25 0 0 1-.25-.25zm2 0a.25.25 0 0 1 .25-.25h5.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-5.5a.25.25 0 0 1-.25-.25z"/>
117-
</svg>
118113
</div>
119114

120115
<script type="text/javascript" src="../dist/jquery/jquery.min.js"></script>

src/html/popup.html

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<title>SMWC Web Extension</title>
55
<link rel="icon" href="../images/logo16.png" sizes="any">
66
<link rel="stylesheet" type="text/css" href="../dist/bootstrap/bootstrap.min.css">
7+
<link rel="stylesheet" type="text/css" href="../dist/fontawesome/css/all.min.css">
78
<link rel="stylesheet" type="text/css" href="../css/main.css">
89
<link rel="stylesheet" type="text/css" href="../css/popup.css">
910
<script type="text/javascript" src="../js/theme.js"></script>
@@ -13,8 +14,10 @@
1314
<div class="container-fluid p-3">
1415
<div class="d-grid gap-2 d-md-flex justify-content-md-end">
1516
<div class="btn-group btn-group-sm" role="group" aria-label="SMWC.world">
16-
<a role="button" class="btn btn-outline-info" href="https://smwc.world/patcher/">Patcher</a>
17-
<a role="button" class="btn btn-outline-info" href="https://smwc.world/play/">Player</a>
17+
<a role="button" class="btn btn-outline-info" href="https://smwc.world/patcher/">
18+
<i class="fa-solid fa-hard-drive me-1"></i> Patcher</a>
19+
<a role="button" class="btn btn-outline-info" href="https://smwc.world/play/">
20+
<i class="fa-solid fa-gamepad me-1"></i> Player</a>
1821
</div>
1922
<a class="btn btn-success btn-sm w-100" role="button" href="https://www.smwcentral.net/?p=section&s=smwhacks">
2023
SMW Central Rom Hacks</a>
@@ -48,7 +51,7 @@
4851
<label class="form-check-label" for="contextMenu" aria-describedby="contextMenuHelp">
4952
Enable Right Click Menu
5053
<span data-bs-toggle="tooltip" data-bs-title="Show Context Menu on Right Click.">
51-
<svg class="ms-1"><use xlink:href="#bi-info-circle-fill" /></svg>
54+
<i class="fa-solid fa-circle-info ms-1"></i>
5255
</span>
5356
</label>
5457
</div>
@@ -57,28 +60,21 @@
5760
<label class="form-check-label" for="showUpdate" aria-describedby="showUpdateHelp">
5861
Show Release Notes on Update
5962
<span data-bs-toggle="tooltip" data-bs-title="Show Release Notes on Version Update.">
60-
<svg class="ms-1"><use xlink:href="#bi-info-circle-fill" /></svg>
63+
<i class="fa-solid fa-circle-info ms-1"></i>
6164
</span>
6265
</label>
6366
</div>
6467
</form>
6568
<a class="btn btn-outline-primary btn-sm w-100" role="button" href="../html/options.html">
66-
Open Options
67-
</a>
69+
<i class="fa-solid fa-sliders me-1"></i> Open Options</a>
6870
<hr>
6971
<div class="justify-content-center align-items-center d-flex text-center small">
70-
<img src="../images/logo16.png" alt="SMWC Web Extension" class="me-1">
72+
<img src="../images/logo16.png" class="me-1" alt="SMWC Web Extension" title="SMWC Web Extension">
7173
<a class="link-offset-2 link-underline link-underline-opacity-0 link-underline-opacity-75-hover mx-2" type="button" rel="noopener"
7274
id="homepage_url" href="">SMWC Web Extension</a> v<span id="version"></span>
7375
</div>
7476
</div>
7577

76-
<div class="d-none">
77-
<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" id="bi-info-circle-fill" viewBox="0 0 16 16">
78-
<path d="M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16zm.93-9.412-1 4.705c-.07.34.029.533.304.533.194 0 .487-.07.686-.246l-.088.416c-.287.346-.92.598-1.465.598-.703 0-1.002-.422-.808-1.319l.738-3.468c.064-.293.006-.399-.287-.47l-.451-.081.082-.381 2.29-.287zM8 5.5a1 1 0 1 1 0-2 1 1 0 0 1 0 2z"/>
79-
</svg>
80-
</div>
81-
8278
<script type="text/javascript" src="../dist/jquery/jquery.min.js"></script>
8379
<script type="text/javascript" src="../dist/bootstrap/bootstrap.bundle.min.js"></script>
8480
<script type="module" src="../js/popup.js"></script>

src/js/popup.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,9 @@ async function initPopup() {
2727
console.log('initPopup')
2828
document.getElementById('patch-input').focus()
2929

30-
document.getElementById('version').textContent =
31-
chrome.runtime.getManifest().version
32-
document.getElementById('homepage_url').href =
33-
chrome.runtime.getManifest().homepage_url
30+
const manifest = chrome.runtime.getManifest()
31+
document.getElementById('version').textContent = manifest.version
32+
document.getElementById('homepage_url').href = manifest.homepage_url
3433

3534
const { options, popup } = await chrome.storage.sync.get([
3635
'options',

0 commit comments

Comments
 (0)