Skip to content

Commit 497a61b

Browse files
authored
Add Pin Notification (#15)
* Add Pin Notification * Add Issue Templates * Update Dependencies * Add Right Padding * Update JSDocs * Update Issue Template * Update Issue Template
1 parent 33274ea commit 497a61b

File tree

10 files changed

+218
-48
lines changed

10 files changed

+218
-48
lines changed

.github/ISSUE_TEMPLATE/0-bug.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: "⚠️ Report an Issue"
2+
description: "Something Not Working Right? Please let us know..."
3+
labels: ["bug"]
4+
assignees:
5+
- smashedr
6+
7+
body:
8+
- type: input
9+
id: website
10+
validations:
11+
required: false
12+
attributes:
13+
label: Site Link
14+
description: Please provide a link to the page you are having issues on if possible.
15+
placeholder: https://www.smwcentral.net/?p=section&a=details&id=18238
16+
17+
- type: textarea
18+
id: description
19+
validations:
20+
required: true
21+
attributes:
22+
label: Details
23+
description: Please describe the issue you are experiencing and how to reproduce.
24+
placeholder: Provide as many details as you can...
25+
26+
- type: textarea
27+
id: logs
28+
validations:
29+
required: false
30+
attributes:
31+
label: Support Information
32+
description: Open the extension options, scroll to the bottom, click Copy Support Information and paste below.
33+
render: shell
34+
35+
- type: markdown
36+
attributes:
37+
value: |
38+
All issues/bugs that we can verify will be fixed. Thank you for taking the time to make this report!

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
blank_issues_enabled: true
2+
contact_links:
3+
- name: '💡 Request a Feature'
4+
about: Request a New Feature or Enhancement in the Discussions.
5+
url: https://github.com/cssnr/smwc-web-extension/discussions/new?category=feature-requests
6+
7+
- name: '❔ Ask a Question'
8+
about: Ask a General Question or start a Discussions.
9+
url: https://github.com/cssnr/smwc-web-extension/discussions/new?category=q-a
10+
11+
- name: '💬 Join Discord'
12+
about: Chat with us about Issues, Features, Questions and More.
13+
url: https://discord.gg/wXy6m2X8wY
14+
15+
- name: '📝 Submit Feedback'
16+
about: Send General Feedback.
17+
url: https://cssnr.github.io/feedback/?app=SMWC%20Web%20Extension

README.md

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
[![Build](https://img.shields.io/github/actions/workflow/status/cssnr/smwc-web-extension/build.yaml?logo=github&logoColor=white&label=build)](https://github.com/cssnr/smwc-web-extension/actions/workflows/build.yaml)
77
[![Test](https://img.shields.io/github/actions/workflow/status/cssnr/smwc-web-extension/test.yaml?logo=github&logoColor=white&label=test)](https://github.com/cssnr/smwc-web-extension/actions/workflows/test.yaml)
88
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=cssnr_smwc-web-extension&metric=alert_status&label=quality)](https://sonarcloud.io/summary/overall?id=cssnr_smwc-web-extension)
9-
[![Discord](https://img.shields.io/discord/536290056571453450?logo=discord&logoColor=white&label=discord&color=7289da)](https://discord.gg/ZrRbfdE6kz)
9+
[![GitHub Last Commit](https://img.shields.io/github/last-commit/cssnr/smwc-web-extension?logo=github&logoColor=white&label=updated)](https://github.com/cssnr/smwc-web-extension/graphs/commit-activity)
10+
[![GitHub Top Language](https://img.shields.io/github/languages/top/cssnr/smwc-web-extension?logo=htmx&logoColor=white)](https://github.com/cssnr/smwc-web-extension)
11+
[![GitHub Org Stars](https://img.shields.io/github/stars/cssnr?style=flat&logo=github&logoColor=white)](https://cssnr.github.io/)
12+
[![Discord](https://img.shields.io/discord/536290056571453450?logo=discord&logoColor=white&label=discord&color=7289da)](https://discord.gg/6pzXJE5)
1013
# SMWC Web Extension
1114

1215
Modern Chrome Web Extension and Firefox Browser Addon to easily Patch and Play ROMs Online via the [smwc.world](https://smwc.world) site.
@@ -17,6 +20,7 @@ Modern Chrome Web Extension and Firefox Browser Addon to easily Patch and Play R
1720
* [Support](#support)
1821
* [Development](#development)
1922
- [Building](#building)
23+
* [Contributing](#Contributing)
2024

2125
# Install
2226

@@ -58,13 +62,13 @@ For help using the web extension, utilize any these resources:
5862
If you are experiencing an issue/bug or getting unexpected results, use:
5963

6064
- Report an Issue: https://github.com/cssnr/smwc-web-extension/issues
61-
- Chat with us on Discord: https://discord.gg/wXy6m2X8wY
62-
- Provide Anonymous Feedback: https://cssnr.github.io/feedback
65+
- Chat with us on Discord: https://discord.gg/6pzXJE5
66+
- Provide General Feedback: [https://cssnr.github.io/feedback](https://cssnr.github.io/feedback/?app=SMWC%20Web%20Extension)
6367

6468
Logs can be found inspecting the page (Ctrl+Shift+I), clicking on the Console, and;
6569
Firefox: toggling Debug logs, Chrome: toggling Verbose from levels dropdown.
6670

67-
Note: When providing anonymous feedback there is no way to follow up and get more information unless you provide a contact method.
71+
To support this project, see the [Contributing](#Contributing) section at the bottom.
6872

6973
# Development
7074

@@ -135,3 +139,22 @@ You may also use an Unbranded Build: [https://wiki.mozilla.org/Add-ons/Extension
135139
1. Run `npm run build:firefox` then use `web-ext-artifacts/{name}-firefox-{version}.zip`.
136140
1. Open `about:config` search for `xpinstall.signatures.required` and set to `false`.
137141
1. Open `about:addons` and drag the zip file to the page or choose Install from File from the Settings wheel.
142+
143+
# Contributing
144+
145+
Currently, the best way to contribute to this project is to give a 5-star rating on
146+
[Google](https://chromewebstore.google.com/detail/smwc-web-extension/foalfafgmnglcgpgkhhmcfhjgmdcjide) or
147+
[Mozilla](https://addons.mozilla.org/addon/smwc-web-extension) and to star this project on GitHub.
148+
149+
Other Web Extensions I have created and published:
150+
151+
- [Link Extractor](https://github.com/cssnr/link-extractor)
152+
- [Open Links in New Tab](https://github.com/cssnr/open-links-in-new-tab)
153+
- [HLS Video Downloader](https://github.com/cssnr/hls-video-downloader)
154+
- [SMWC Web Extension](https://github.com/cssnr/smwc-web-extension)
155+
- [PlayDrift Extension](https://github.com/cssnr/playdrift-extension)
156+
- [ASN Plus](https://github.com/cssnr/asn-plus)
157+
- [Aviation Tools](https://github.com/cssnr/aviation-tools)
158+
- [Text Formatter](https://github.com/cssnr/text-formatter)
159+
160+
For a full list of current projects visit: [https://cssnr.github.io/](https://cssnr.github.io/)

package-lock.json

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

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"build": "npm run build:chrome && npm run build:firefox"
1515
},
1616
"dependencies": {
17-
"@fortawesome/fontawesome-free": "^6.5.2",
17+
"@fortawesome/fontawesome-free": "^6.6.0",
1818
"bootstrap": "^5.3.3",
1919
"jquery": "^3.7.1"
2020
},
@@ -23,7 +23,7 @@
2323
"eslint": "^8.57.0",
2424
"gulp": "^4.0.2",
2525
"json-merger": "^1.1.10",
26-
"prettier": "^3.3.2",
26+
"prettier": "^3.3.3",
2727
"web-ext": "^8.2.0"
2828
}
2929
}

src/css/options.css

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,45 @@
11
/* CSS for options.html */
22

3-
.card {
4-
min-width: 380px;
3+
body {
4+
min-width: 400px;
5+
}
6+
7+
#pin-notice {
8+
position: fixed;
9+
right: 10px;
10+
top: 0;
11+
cursor: pointer;
12+
user-select: none;
13+
}
14+
15+
[data-bs-theme='dark'] #pin-notice {
16+
text-shadow:
17+
0 0 3px #000,
18+
0 0 6px #000,
19+
0 0 9px #000,
20+
0 0 12px #000;
21+
}
22+
23+
[data-bs-theme='light'] #pin-notice {
24+
text-shadow:
25+
0 0 3px #fff,
26+
0 0 6px #fff,
27+
0 0 9px #fff,
28+
0 0 12px #fff;
29+
}
30+
31+
.bounce {
32+
animation: bounce 4s infinite;
33+
}
34+
35+
@keyframes bounce {
36+
0% {
37+
top: 0;
38+
}
39+
50% {
40+
top: 30px;
41+
}
42+
100% {
43+
top: 0;
44+
}
545
}

src/html/options.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,23 @@ <h1>SMWC Web Extension</h1>
8383
</div> <!-- flex -->
8484
</div> <!-- container -->
8585

86+
<div id="pin-notice" class="text-center bounce p-2 d-none">
87+
<i class="fa-solid fa-hand-point-up"></i>
88+
<br>
89+
To Add to Toolbar
90+
<br>
91+
Click the <i class="fa-solid fa-puzzle-piece mx-1"></i> Icon then
92+
<br>
93+
<span>
94+
Find the
95+
<img src="../images/logo16.png" class="mx-1 mb-1" alt="ASN Plus" title="ASN Plus" style="height: 1.1em;">
96+
Icon and Click
97+
<i class="fa-solid fa-thumbtack ms-1 d-none chromium"></i>
98+
<i class="fa-solid fa-gear d-none firefox"></i>
99+
<i class="fa-regular fa-eye-slash d-none edge"></i>
100+
</span>
101+
</div> <!-- pin-notice -->
102+
86103
<div aria-live="polite" aria-atomic="true" class="">
87104
<div id="toast-container" class="toast-container position-fixed bottom-0 end-0 p-3"></div>
88105
</div> <!-- toast -->

src/js/options.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ chrome.storage.onChanged.addListener(onChanged)
1111

1212
document.addEventListener('DOMContentLoaded', initOptions)
1313
document.getElementById('copy-support').addEventListener('click', copySupport)
14+
document.getElementById('pin-notice').addEventListener('click', pinClick)
1415
document
1516
.querySelectorAll('#options-form input')
1617
.forEach((el) => el.addEventListener('change', saveOptions))
@@ -25,6 +26,7 @@ document
2526
async function initOptions() {
2627
console.debug('initOptions')
2728

29+
checkInstall()
2830
updateManifest()
2931
await setShortcuts()
3032

@@ -33,6 +35,25 @@ async function initOptions() {
3335
updateOptions(options)
3436
}
3537

38+
function checkInstall() {
39+
if (window.location.search.includes('?install=new')) {
40+
console.debug('New Install Detected.')
41+
history.pushState(null, '', location.href.split('?')[0])
42+
const pin = document.getElementById('pin-notice')
43+
pin.classList.remove('d-none')
44+
if (navigator.userAgent.includes('Firefox/')) {
45+
console.log('Firefox')
46+
pin.querySelector('.firefox').classList.remove('d-none')
47+
} else if (navigator.userAgent.includes('Edg/')) {
48+
console.log('Edge')
49+
pin.querySelector('.edge').classList.remove('d-none')
50+
} else {
51+
console.log('Chromium/Other')
52+
pin.querySelector('.chromium').classList.remove('d-none')
53+
}
54+
}
55+
}
56+
3657
/**
3758
* On Changed Callback
3859
* @function onChanged
@@ -91,3 +112,14 @@ async function copySupport(event) {
91112
await navigator.clipboard.writeText(result.join('\n'))
92113
showToast('Support Information Copied.')
93114
}
115+
116+
/**
117+
* Pin Animation Click Callback
118+
* @function pinClick
119+
* @param {MouseEvent} event
120+
*/
121+
function pinClick(event) {
122+
const div = event.target.closest('div')
123+
console.log('div:', div)
124+
div.classList.add('d-none')
125+
}

0 commit comments

Comments
 (0)