Skip to content

Commit

Permalink
Merge pull request #8 from kemzops/main
Browse files Browse the repository at this point in the history
اضافة امكانية التعديل على مستوى الصوت
  • Loading branch information
rn0x authored Dec 29, 2022
2 parents aff7528 + 0db5bc9 commit 476aa11
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 10 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
dist
node_modules
package-lock.json
package-lock.json
screenshots
.vscode
2 changes: 1 addition & 1 deletion Window/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = async function homeWindow(BrowserWindow, ipcMain, app, Tray, Me

win = new BrowserWindow({
width: 1000,
height: 600,
height: 620,
minWidth: 1000,
minHeight: 600,
show: false,
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ app.setLoginItemSettings({
openAtLogin: true,
path: path.join(process.resourcesPath, '../Altaqwaa.exe'),
args: ['--hidden']
});
});
7 changes: 7 additions & 0 deletions pages/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,13 @@
</label>
</td>
</tr>
<tr>
<td class="name">مستوى الصوت (للإستماع للقرآن)</td>
<td>
<input type="range" value="100" min="1" max="100" id="volume">
<output id="volume_value">100</output>
</td>
</tr>
</table>
<button id="save">حفظ</button>
</div>
Expand Down
4 changes: 2 additions & 2 deletions preload/quran_mp3.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module.exports = function quran_mp3(App_Path) {

let Quran_json = fs.readJsonSync(path.join(__dirname, '../data/Quran.json'));
let mp3quran_json = fs.readJsonSync(path.join(__dirname, '../data/mp3quran.json'));
let volume = fs.readJsonSync(path.join(App_Path, './data/settings.json')).volume;
let ul_group = document.getElementById('ul_group');
let Sheikh = document.getElementById('Sheikh');
let li_Sheikh_number = 1
Expand Down Expand Up @@ -96,8 +97,7 @@ module.exports = function quran_mp3(App_Path) {
audio.src = url
audio.preload = 'none'
audio.autoplay = false


audio.volume = volume ? volume : 1
}

let icon_mp3 = document.getElementsByClassName('icon_mp3');
Expand Down
17 changes: 15 additions & 2 deletions preload/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,32 @@ module.exports = function settings(App_Path) {
let alrt = document.getElementById('alrt');//selected
let selected = document.getElementById(settings?.Calculation);

const volumeRange = document.getElementById('volume');
const volumeValue = document.getElementById('volume_value');
volumeRange.addEventListener('input', handleVolumeRange)

if(settings.volume && settings.value != 100) {
volumeValue.innerHTML = settings.volume * 100;
volumeRange.value = settings.volume * 100;
}

notifications_adhan.checked = settings?.notifications_adhan
notifications_adhkar.checked = settings?.notifications_adhkar
selected.selected = "selected"


function handleVolumeRange(volume) {
volumeValue.innerHTML = volumeRange.value;
}

save.addEventListener('click', e => {

let opj = {

Calculation: Calculation.value,
notifications_adhan: notifications_adhan.checked,
notifications_adhkar: notifications_adhkar.checked
notifications_adhkar: notifications_adhkar.checked,
volume: volumeRange.value / 100

}

if (latitude.value !== '') {
Expand Down
12 changes: 9 additions & 3 deletions public/css/settings.css
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,15 @@ input:checked+.slider:before {
transform: translateX(26px);
}

/* for the volume value box */
output {
background: #2196F3;
font-size: small;
padding: 4px 12px;
border-radius: 3px;
color: #fff;
}

/* Rounded sliders */
.slider.round {
border-radius: 34px;
Expand Down Expand Up @@ -147,8 +156,5 @@ input:checked+.slider:before {

#save:hover {
background-color: #6bc077;
width: 220px;
padding: 16px;
transition: 0.5s ease-in-out;
box-shadow: 5px 15px 15px 0px #00000048;
}

0 comments on commit 476aa11

Please sign in to comment.