Skip to content

Commit

Permalink
v3.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
inulute committed Nov 27, 2024
1 parent 6001dae commit ea4f5c0
Show file tree
Hide file tree
Showing 11 changed files with 983 additions and 49 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
node_modules
release-builds
obfuscate.js
134 changes: 98 additions & 36 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,47 +1,109 @@
<!-- index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Perplexity AI</title>
<link rel="stylesheet" href="./src/css/styles.css">
<title>Settings</title>
<link rel="stylesheet" href="./src/css/settings.css">

<style>

</style>
</head>
<body>
<div id="container">
<nav id="sidebar">
<a href="#" class="menu-item" onclick="window.electronAPI.switchAITool('https://perplexity.ai')">
<img src="./assets/icons/svg/perplexity-ai-icon.svg" alt="Perplexity AI" title="Perplexity AI"/>
</a>
<a href="#" class="menu-item" onclick="window.electronAPI.switchAITool('https://labs.perplexity.ai')">
<img src="./assets/icons/svg/perplexity-labs-icon.svg" alt="Perplexity Labs" title="Perplexity Labs"/>
</a>
<a href="#" class="menu-item" onclick="window.electronAPI.switchAITool('refresh')">
<img src="./assets/icons/svg/refresh-icon.svg" alt="Refresh" title="Refresh"/>
</a>
<div class="spacer"></div>
<a href="#" class="menu-item" onclick="window.electronAPI.switchAITool('https://donate.inulute.com')">
<img src="./assets/icons/svg/coffee-icon.svg" alt="Donate" title="Buy me a Coffee"/>
</a>
<a href="#" class="menu-item" onclick="window.electronAPI.openSettings()">
<img src="./assets/icons/svg/settings-icon.svg" alt="Settings" title="Settings"/>
</a>
<div class="version-display">v{version}</div>
</nav>
<div id="content">
<div id="webview-container">
<div id="settings-container">
<div class="settings-header">
<img src="./assets/icons/svg/settings-icon.svg" alt="Settings Icon" class="settings-icon">
<h2>Settings</h2>
<button class="close-button" onclick="closeSettings()">&#x2715;</button>
</div>
<form id="settings-form">
<div class="settings-section">
<h3>General</h3>
<div class="setting-item">
<label for="defaultAI">
<img src="./assets/icons/svg/ai-icon.svg" alt="Default AI">
Default AI Site:
</label>
<select id="defaultAI">
<option value="https://perplexity.ai">Perplexity AI Search</option>
<option value="https://labs.perplexity.ai">Perplexity AI Chat</option>
</select>
</div>
</div>
<div id="loading">
<div class="spinner"></div>

<div class="settings-section">

<div class="toggle-container">
<span class="toggle-description">Enable Shortcuts</span>
<i class="fas fa-keyboard toggle-icon"></i>
<input type="checkbox" id="toggleShortcuts" class="toggle-input">
<label for="toggleShortcuts" class="toggle-label">
<span class="toggle-slider"></span>
</label>

</div>





<div class="shortcut-item">
<label>
<img src="./assets/icons/svg/perplexity-ai-icon.svg" alt="Perplexity AI">
Perplexity AI:
</label>
<input type="text" id="shortcut-perplexityAI" class="shortcut-input" readonly placeholder="Press keys..." required>
<div class="warning"></div>
</div>
<div class="shortcut-item">
<label>
<img src="./assets/icons/svg/perplexity-labs-icon.svg" alt="Perplexity Labs">
Perplexity Labs:
</label>
<input type="text" id="shortcut-perplexityLabs" class="shortcut-input" readonly placeholder="Press keys..." required>
<div class="warning"></div>
</div>
<div class="shortcut-item">
<label>
<img src="./assets/icons/svg/minimize-icon.svg" alt="Minimize App">
Minimize App:
</label>
<input type="text" id="shortcut-minimizeApp" class="shortcut-input" readonly placeholder="Press keys..." required>
<div class="warning"></div>
</div>
<div class="shortcut-item">
<label>
<img src="./assets/icons/svg/tray-icon.svg" alt="Send to Tray">
Send to Tray:
</label>
<input type="text" id="shortcut-sendToTray" class="shortcut-input" readonly placeholder="Press keys..." required>
<div class="warning"></div>
</div>
<div class="shortcut-item">
<label>
<img src="./assets/icons/svg/restore-icon.svg" alt="Restore App">
Restore App:
</label>
<input type="text" id="shortcut-restoreApp" class="shortcut-input" readonly placeholder="Press keys..." required>
<div class="warning"></div>
</div>
<div class="shortcut-item">
<label>
<img src="./assets/icons/svg/refresh-icon.svg" alt="Reload">
Reload:
</label>
<input type="text" id="shortcut-reload" class="shortcut-input" readonly placeholder="Press keys..." required>
<div class="warning"></div>
</div>
</div>
</div>
</div>
<div id="update-modal" class="modal hidden">
<div class="modal-content">
<button class="close-button" id="update-close-button">&#x2715;</button>
<h2>Update Available</h2>
<p>A new version (v<span id="latest-version"></span>) is available.</p>
<button id="download-update-button">Download Update</button>
</div>

<div class="button-container">
<button type="submit" class="save-button">Save Settings</button>
<button type="button" id="restore-button" class="restore-button" title="Restore Defaults">
<img src="./assets/icons/svg/revert-icon.svg" alt="Restore Defaults Icon">
</button>
</div>
</form>
</div>

<script src="./src/js/renderer/renderer.js"></script>
Expand Down
417 changes: 416 additions & 1 deletion main.js

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions release_notes/v3.2.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
### **Perplexity AI v3.1.1**

---

- **Fixed**: Shortcuts not working after closing the window.
- **Added**: Option to disable shortcuts completely.
- **Fixed**: Threads not being deleted properly.
- **Improved**: Various minor enhancements for better performance and stability.

---

<img src='https://raw.githubusercontent.com/inulute/perplexity-ai-app/refs/tags/v3.1.0/assets/screenshots/perplexity_app.png'>

---

**Upgrade now to Perplexity AI v3.1.1!**
67 changes: 66 additions & 1 deletion src/css/settings.css
Original file line number Diff line number Diff line change
Expand Up @@ -199,4 +199,69 @@
opacity: 0.8;
transition: opacity 0.2s;
}



input[disabled] {
background-color: #2d2d2d;
color: #aaa;
border-color: #343434;
}


/* Style for Enable Shortcuts section */
.toggle-container {
display: flex;
align-items: center;
gap: 10px;
margin-top: 20px;
margin-bottom: 20px;
}

.toggle-container .toggle-description {
font-size: 16px;
color: #e0e0e0; /* Lighter color for better visibility */
font-weight: 500;
margin-left: 5px;

}

.toggle-container input[type="checkbox"] {
appearance: none;
width: 45px;
height: 24px;
background-color: #aeaeae;
border-radius: 12px;
position: relative;
outline: none;
cursor: pointer;
transition: background-color 0.3s;
}

.toggle-container input[type="checkbox"]:checked {
background-color: #20808D;
}

.toggle-container input[type="checkbox"]:before {
content: '';
position: absolute;
top: 2px;
left: 2px;
width: 20px;
height: 20px;
background-color: #fff;
border-radius: 50%;
transition: transform 0.3s ease-in-out;
}

.toggle-container input[type="checkbox"]:checked:before {
transform: translateX(26px);
}

.toggle-container .toggle-icon {
font-size: 20px;
color: #e0e0e0;
}

.toggle-container:hover .toggle-icon {
color: #ffffff;
}
19 changes: 18 additions & 1 deletion src/js/preload/preload.js
Original file line number Diff line number Diff line change
@@ -1 +1,18 @@
function _0x349a(_0x145600,_0x4e6452){const _0x4e1ea4=_0xeeb1();return _0x349a=function(_0x36b45d,_0x48794a){_0x36b45d=_0x36b45d-0x15d;let _0x128451=_0x4e1ea4[_0x36b45d];return _0x128451;},_0x349a(_0x145600,_0x4e6452);}const _0x24fa95=_0x349a;(function(_0x154eb5,_0x21fef9){const _0x4edc32=_0x349a,_0x22c2c6=_0x154eb5();while(!![]){try{const _0x5802bf=parseInt(_0x4edc32(0x174))/0x1+parseInt(_0x4edc32(0x187))/0x2*(-parseInt(_0x4edc32(0x15d))/0x3)+parseInt(_0x4edc32(0x15f))/0x4+-parseInt(_0x4edc32(0x165))/0x5*(-parseInt(_0x4edc32(0x160))/0x6)+parseInt(_0x4edc32(0x175))/0x7+parseInt(_0x4edc32(0x186))/0x8*(parseInt(_0x4edc32(0x168))/0x9)+parseInt(_0x4edc32(0x17f))/0xa*(-parseInt(_0x4edc32(0x172))/0xb);if(_0x5802bf===_0x21fef9)break;else _0x22c2c6['push'](_0x22c2c6['shift']());}catch(_0x3ea1d1){_0x22c2c6['push'](_0x22c2c6['shift']());}}}(_0xeeb1,0x76e04));const _0x48794a=(function(){const _0x3259e0=_0x349a,_0x3883de={'pttHV':function(_0x309fab,_0x41656b){return _0x309fab+_0x41656b;},'mRsbt':function(_0x2416a1){return _0x2416a1();},'xYpkV':function(_0x4a5647,_0x595d4f){return _0x4a5647!==_0x595d4f;},'qxisB':_0x3259e0(0x18b),'uhLyK':'jkzrs','PiwIz':'zNstV'};let _0x1b4bd0=!![];return function(_0x992712,_0x3db6df){const _0x6dbf5a=_0x1b4bd0?function(){const _0x6501d0=_0x349a,_0x31270d={'NvDMu':function(_0x1d55e4,_0x3329f7){return _0x3883de['pttHV'](_0x1d55e4,_0x3329f7);},'EgBin':function(_0x50e315){const _0x2d62c7=_0x349a;return _0x3883de[_0x2d62c7(0x188)](_0x50e315);}};if(_0x3883de[_0x6501d0(0x16f)](_0x3883de[_0x6501d0(0x18a)],'mTYIC')){if(_0x3db6df){if(_0x3883de[_0x6501d0(0x184)]===_0x3883de[_0x6501d0(0x16b)]){const _0x1f3159=_0x5c5478?function(){const _0xdfae0b=_0x6501d0;if(_0x291fa5){const _0x2f84ed=_0x384128[_0xdfae0b(0x169)](_0x188610,arguments);return _0x234307=null,_0x2f84ed;}}:function(){};return _0x5d0afb=![],_0x1f3159;}else{const _0x5ec1e6=_0x3db6df[_0x6501d0(0x169)](_0x992712,arguments);return _0x3db6df=null,_0x5ec1e6;}}}else{const _0x357eac=_0x57c629(_0x31270d[_0x6501d0(0x164)](_0x6501d0(0x17c)+'{}.constructor(\x22return\x20this\x22)(\x20)',');'));_0x588fa2=_0x31270d['EgBin'](_0x357eac);}}:function(){};return _0x1b4bd0=![],_0x6dbf5a;};}()),_0x36b45d=_0x48794a(this,function(){const _0x58ca37=_0x349a,_0x4911a7={'WxeRo':function(_0x278425,_0x304fe7){return _0x278425+_0x304fe7;},'vpQks':_0x58ca37(0x17c),'gKgne':_0x58ca37(0x17a),'TASkv':function(_0x143c5b){return _0x143c5b();},'jHosh':_0x58ca37(0x177),'zZVag':'warn','oDYih':_0x58ca37(0x16d),'SMhlE':'error','thZlu':_0x58ca37(0x162),'LWdko':'table','FGVVG':_0x58ca37(0x181)};let _0x492cfd;try{const _0x44fb50=Function(_0x4911a7['WxeRo'](_0x4911a7[_0x58ca37(0x163)]+_0x4911a7[_0x58ca37(0x167)],');'));_0x492cfd=_0x4911a7[_0x58ca37(0x179)](_0x44fb50);}catch(_0x21f574){_0x492cfd=window;}const _0x405b79=_0x492cfd['console']=_0x492cfd[_0x58ca37(0x185)]||{},_0x5ed141=[_0x4911a7['jHosh'],_0x4911a7[_0x58ca37(0x161)],_0x4911a7[_0x58ca37(0x16e)],_0x4911a7[_0x58ca37(0x16a)],_0x4911a7[_0x58ca37(0x17b)],_0x4911a7[_0x58ca37(0x17d)],_0x4911a7[_0x58ca37(0x15e)]];for(let _0x1ee9bc=0x0;_0x1ee9bc<_0x5ed141[_0x58ca37(0x171)];_0x1ee9bc++){const _0x203d25=_0x48794a['constructor']['prototype']['bind'](_0x48794a),_0x1ad53e=_0x5ed141[_0x1ee9bc],_0x3f588f=_0x405b79[_0x1ad53e]||_0x203d25;_0x203d25[_0x58ca37(0x189)]=_0x48794a[_0x58ca37(0x182)](_0x48794a),_0x203d25[_0x58ca37(0x17e)]=_0x3f588f[_0x58ca37(0x17e)][_0x58ca37(0x182)](_0x3f588f),_0x405b79[_0x1ad53e]=_0x203d25;}});_0x36b45d();const {contextBridge,ipcRenderer}=require(_0x24fa95(0x16c));function _0xeeb1(){const _0x10e66b=['exposeInMainWorld','trace','bind','switch-ai-tool','uhLyK','console','38944gTjKyc','4iiTdDN','mRsbt','__proto__','qxisB','URJQs','get-app-version','electronAPI','37227tHDzTa','FGVVG','2638640wwABfz','6siJpOT','zZVag','exception','vpQks','NvDMu','1742210uqNAaL','send','gKgne','243kjHnxD','apply','SMhlE','PiwIz','electron','info','oDYih','xYpkV','open-settings','length','253iNuxXe','page-loading','321638kJljcN','1692740Jzwypi','invoke','log','set-shortcuts','TASkv','{}.constructor(\x22return\x20this\x22)(\x20)','thZlu','return\x20(function()\x20','LWdko','toString','517940BHrDdY'];_0xeeb1=function(){return _0x10e66b;};return _0xeeb1();}contextBridge[_0x24fa95(0x180)](_0x24fa95(0x18d),{'switchAITool':_0x2e9332=>ipcRenderer[_0x24fa95(0x166)](_0x24fa95(0x183),_0x2e9332),'onPageLoading':_0x4cc46d=>ipcRenderer['on'](_0x24fa95(0x173),(_0x7461ce,_0x106081)=>_0x4cc46d(_0x106081)),'openSettings':()=>ipcRenderer['send'](_0x24fa95(0x170)),'getShortcuts':()=>ipcRenderer[_0x24fa95(0x166)]('get-shortcuts'),'onShortcutsReceived':_0x47e332=>ipcRenderer['on']('shortcuts',(_0x454d15,_0xb6e151)=>_0x47e332(_0xb6e151)),'setShortcuts':_0x261201=>ipcRenderer[_0x24fa95(0x166)](_0x24fa95(0x178),_0x261201),'closeSettings':()=>ipcRenderer[_0x24fa95(0x166)]('close-settings'),'getSettings':()=>ipcRenderer[_0x24fa95(0x166)]('get-settings'),'onSettingsReceived':_0x1694f3=>ipcRenderer['on']('settings',(_0xe3f2b2,_0x26db1b)=>_0x1694f3(_0x26db1b)),'setSettings':_0x47119e=>ipcRenderer[_0x24fa95(0x166)]('set-settings',_0x47119e),'getAppVersion':()=>ipcRenderer[_0x24fa95(0x176)](_0x24fa95(0x18c)),'platform':process['platform']});
// preload.js

const { contextBridge, ipcRenderer } = require('electron');

contextBridge.exposeInMainWorld('electronAPI', {
switchAITool: (url) => ipcRenderer.send('switch-ai-tool', url),
onPageLoading: (callback) => ipcRenderer.on('page-loading', (event, isLoading) => callback(isLoading)),
openSettings: () => ipcRenderer.send('open-settings'),
getShortcuts: () => ipcRenderer.send('get-shortcuts'),
onShortcutsReceived: (callback) => ipcRenderer.on('shortcuts', (event, shortcuts) => callback(shortcuts)),
setShortcuts: (shortcuts) => ipcRenderer.send('set-shortcuts', shortcuts),
closeSettings: () => ipcRenderer.send('close-settings'),
getSettings: () => ipcRenderer.send('get-settings'),
onSettingsReceived: (callback) => ipcRenderer.on('settings', (event, data) => callback(data)),
setSettings: (data) => ipcRenderer.send('set-settings', data),
getAppVersion: () => ipcRenderer.invoke('get-app-version'),
platform: process.platform,
});
Loading

0 comments on commit ea4f5c0

Please sign in to comment.