I made dyamic island app which code is here : index.html "<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Dynamic Island</title>
    <style>
        body {
            margin: 0;
            padding: 0;
            overflow: hidden;
            background: transparent;
            font-family: Arial, sans-serif;
        }
        #dynamic-island {
            width: 200px;
            height: 40px;
            background-color: rgba(0, 0, 0, 0.8);
            color: white;
            border-radius: 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            transition: all 0.3s ease;
            padding: 0 15px;
            position: fixed;
            left: 50%;
            transform: translateX(-50%);
            box-sizing: border-box;
        }
        #dynamic-island.expanded {
            width: 300px;
            height: 100px;
            border-radius: 15px;
            flex-direction: column;
            justify-content: flex-start;
            padding-top: 10px;
        }
        .top-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            width: 100%;
            padding: 0 10px;
            box-sizing: border-box;
        }
        #time {
            font-size: 16px;
            font-weight: bold;
        }
        #volume-icon {
            width: 20px;
            height: 20px;
            cursor: pointer;
            padding: 5px;
        }
        #volume-control {
            display: none;
            flex-direction: column;
            align-items: center;
            width: 100%;
            padding: 15px;
            box-sizing: border-box;
        }
        #volume-slider {
            width: 90%;
            margin-top: 15px;
            cursor: pointer;
        }
        #volume-label {
            margin-top: 10px;
            font-size: 14px;
        }
        .click-area {
            position: fixed;
            top: -10px;
            left: 50%;
            transform: translateX(-50%);
            width: 220px;
            height: 60px;
            padding: 10px;
            cursor: pointer;
        }
    </style>
</head>
<body>
    <div class="click-area">
        <div id="dynamic-island">
            <div class="top-row">
                <div id="time"></div>
                <svg id="volume-icon" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
                    <path d="M11 5L6 9H2V15H6L11 19V5Z" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
                    <path d="M15.54 8.46C16.4774 9.39764 17.0039 10.6692 17.0039 11.995C17.0039 13.3208 16.4774 14.5924 15.54 15.53" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
                    <path d="M18.07 5.93C19.9447 7.80528 20.9979 10.3447 20.9979 13C20.9979 15.6553 19.9447 18.1947 18.07 20.07" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
                </svg>
            </div>
            <div id="volume-control">
                <input type="range" id="volume-slider" min="0" max="100" value="50">
                <div id="volume-label">Volume: 50%</div>
            </div>
        </div>
    </div>
    <script src="renderer.js"></script>
</body>
</html>
" and main.js "const { app, BrowserWindow, ipcMain, screen } = require('electron');
const { operatingSystem } = require('musicsound'); // Ensure you have musicsound installed

let mainWindow;

function createWindow() {
  const { width: screenWidth, height: screenHeight } = screen.getPrimaryDisplay().workAreaSize;

  mainWindow = new BrowserWindow({
    width: 350,
    height: 120,
    frame: false,
    transparent: true,
    alwaysOnTop: true,
    skipTaskbar: true,
    webPreferences: {
      nodeIntegration: true,
      contextIsolation: false,
    },
  });

  mainWindow.loadFile('index.html');
  mainWindow.setPosition((screenWidth - 350) / 2, 0);

  // Get initial volume
  operatingSystem.getVolume()
    .then(volume => {
      // Ensure the volume is between 0 and 100
      if (volume < 0 || volume > 100) {
        volume = 50; // Default to 50 if the value is out of range
      }
      mainWindow.webContents.send('initial-volume', volume);
    })
    .catch(err => console.error('Error fetching initial volume:', err));
}

app.on('ready', createWindow);

app.on('window-all-closed', () => {
  if (process.platform !== 'darwin') app.quit();
});

app.on('activate', () => {
  if (mainWindow === null) createWindow();
});

// Set system volume based on slider change
ipcMain.on('set-volume', (event, volume) => {
  // Ensure volume is within 0 to 100
  volume = Math.max(0, Math.min(100, volume));
  operatingSystem.setVolume(volume)
    .then(vol => {
      console.log(`System volume set to ${vol}`);
    })
    .catch(err => {
      console.error('Error setting volume:', err);
    });
});
" and renderer.js "const { ipcRenderer } = require('electron');

const dynamicIsland = document.getElementById('dynamic-island');
const timeElement = document.getElementById('time');
const volumeIcon = document.getElementById('volume-icon');
const volumeControl = document.getElementById('volume-control');
const volumeSlider = document.getElementById('volume-slider');
const volumeLabel = document.getElementById('volume-label');

let isExpanded = false;
let isManuallyExpanded = false;

// Update the clock
function updateTime() {
    const now = new Date();
    timeElement.textContent = now.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
}
setInterval(updateTime, 60000);
updateTime();

// Expand and collapse the Dynamic Island
function expandIsland() {
    dynamicIsland.classList.add('expanded');
    volumeControl.style.display = 'flex';
    isExpanded = true;
}
function collapseIsland() {
    if (!isManuallyExpanded) {
        dynamicIsland.classList.remove('expanded');
        volumeControl.style.display = 'none';
        isExpanded = false;
    }
}

// Set volume from main process
ipcRenderer.on('initial-volume', (event, volume) => {
    volumeSlider.value = volume;
    volumeLabel.textContent = `Volume: ${volume}%`;
});

// Event listeners
volumeIcon.addEventListener('click', () => {
    isManuallyExpanded = !isManuallyExpanded;
    if (isManuallyExpanded) expandIsland();
    else collapseIsland();
});

volumeSlider.addEventListener('input', e => {
    const volume = e.target.value;
    volumeLabel.textContent = `Volume: ${volume}%`;
    ipcRenderer.send('set-volume', parseInt(volume, 10)); // Send new volume to main process
});
" but main problem with this code is that it ui is perfect working but when i move volume slider in dynamic island then it sets system real volume to zero and i already installed necessary dependencies so give me correct code which 100% work and don't change ui of this app