Skip to content

Commit dc2a727

Browse files
committed
Mobile-only/not options
1 parent d18e6ef commit dc2a727

4 files changed

Lines changed: 21 additions & 5 deletions

File tree

src/manifest.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ declare global {
33
const __VERSION__: string;
44
}
55

6-
export default {
6+
const manifest: browser._manifest.WebExtensionManifest = {
77
manifest_version: 2,
88
name: '__MSG_title__',
99
description: '__MSG_extensionDescription__',
@@ -62,4 +62,5 @@ export default {
6262
},
6363
},
6464
default_locale: 'en',
65-
};
65+
};
66+
export default manifest;

src/options.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<form>
1111
<h1 class="i18n page-title">__MSG_optionsTitle__</h1>
1212
<h2 class="i18n">__MSG_optionsTitlePlayer__</h2>
13-
<p>
13+
<p class="no-mobile">
1414
<label>
1515
<span class="title i18n">__MSG_optionsPlaybackChangeRateTitle__:</span>
1616
<input type="number" name="playbackChange" data-default="0.1" step="0.05" size="5" placeholder="0.1" />
@@ -25,7 +25,7 @@ <h2 class="i18n">__MSG_optionsTitlePlayer__</h2>
2525
<label><span class="flex"><input type="checkbox" name="autoplayQueue" data-default="" /> <span class="i18n">__MSG_optionsAutoplayQueue__</span></span></label>
2626
<span class="hint i18n">__MSG_optionsAutoplayHint__</span>
2727
</p>
28-
<p>
28+
<p class="no-mobile">
2929
<label>
3030
<span class="title i18n">__MSG_optionsVolumeScrollTitle__:</span>
3131
<span class="flex"><input type="checkbox" name="volumeEnabled" data-default="" /> <span class="i18n">__MSG_optionsEnable__</span></span>
@@ -35,6 +35,12 @@ <h2 class="i18n">__MSG_optionsTitlePlayer__</h2>
3535
<label><span class="flex"><span class="i18n">__MSG_optionsVolumeScrollChange__:</span> <input type="number" name="volumeChange" data-default="0.1" step="0.05" size="5" placeholder="0.1" min="-1" max="1" /></span></label>
3636
<span class="hint i18n">__MSG_optionsVolumeScrollHint__</span>
3737
</p>
38+
<p class="mobile">
39+
<label>
40+
<span class="title i18n">__MSG_optionsVolumeScrollShow__:</span>
41+
<span class="flex"><input type="checkbox" name="volumeShow" data-default="" /> <span class="i18n">__MSG_optionsEnable__</span></span>
42+
</label>
43+
</p>
3844

3945
<h2 class="i18n">__MSG_optionsTitlePage__</h2>
4046
<label>

src/scripts/options.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getBrowserInstance } from './helpers/sharedExt';
1+
import { getBrowserInstance, isMobile } from './helpers/sharedExt';
22
import { load } from './options/form';
33
import { showLogs } from './options/logs';
44
import { Settings } from './options/settings';
@@ -7,6 +7,7 @@ import { standalone } from './options/standalone';
77
const cl = decodeURIComponent(window.location.hash.slice(1)).split(' ').filter(c => !!c);
88
if (cl.length)
99
document.body.classList.add(...cl);
10+
document.body.classList.toggle('mobile', isMobile());
1011

1112
const els = Settings.get();
1213
const { local } = getBrowserInstance().storage;

src/styles/options.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ html, body {
77

88
body {
99
margin-bottom: 12px;
10+
11+
&.mobile .no-mobile {
12+
display: none;
13+
}
14+
15+
&:not(.mobile) .mobile {
16+
display: none;
17+
}
1018
}
1119

1220
form {

0 commit comments

Comments
 (0)