Skip to content

Commit ba8ccae

Browse files
authored
Update 1.6.4 Source Code
1 parent 6f2e5d8 commit ba8ccae

3 files changed

Lines changed: 53 additions & 61 deletions

File tree

index.html

Lines changed: 29 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -189,62 +189,36 @@
189189
largeImgId = data[0].id;
190190
smallImgId = data[1].id;
191191
}
192-
193-
194192
largeImgIcn.src = `https://cdn.discordapp.com/app-assets/${clientVar}/${largeImgId}.png`
195193
smallImgIcn.src = `https://cdn.discordapp.com/app-assets/${clientVar}/${smallImgId}.png`
196194
});
197-
198195
})
199196
}
200-
window.onload = function() {
201-
202-
203-
let elem1 = document.getElementById('save1')
204-
let elem2 = document.getElementById('save2')
205-
206-
if (elem1.dataset.selected=='true') {
207-
let gameId = localStorage.getItem('gameName');
208-
if (!gameId) {
209-
gameId = "Genshin Impact"
210-
}
211-
document.getElementById('name').value = gameId;
212-
document.getElementById("client").value = localStorage.getItem('clientVar');
213-
document.getElementById("state").value = localStorage.getItem('stateVar');
214-
document.getElementById("details").value = localStorage.getItem('detailsVar');
215-
document.getElementById("largeImgTxt").value = localStorage.getItem('largeTxtVar');
216-
document.getElementById("largeImgIdt").value = localStorage.getItem('largeIdtVar');
217-
document.getElementById("smallImgTxt").value = localStorage.getItem('smallTxtVar');
218-
document.getElementById("smallImgIdt").value = localStorage.getItem('smallIdtVar');
219-
document.getElementById("btnUrl1").value = localStorage.getItem('btnUrl1Var');
220-
document.getElementById("btnUrl2").value = localStorage.getItem('btnUrl2Var');
221-
document.getElementById("btnTxt1").value = localStorage.getItem('btnTxt1Var');
222-
document.getElementById("btnTxt2").value = localStorage.getItem('btnTxt2Var');
223-
} else {
224-
let gameId = localStorage.getItem('gameName2');
225-
if (!gameId) {
226-
gameId = "Genshin Impact"
227-
}
228-
document.getElementById('name').value = gameId;
229-
document.getElementById("client").value = localStorage.getItem('clientVar2');
230-
document.getElementById("state").value = localStorage.getItem('stateVar2');
231-
document.getElementById("details").value = localStorage.getItem('detailsVar2');
232-
document.getElementById("largeImgTxt").value = localStorage.getItem('largeTxtVar2');
233-
document.getElementById("largeImgIdt").value = localStorage.getItem('largeIdtVar2');
234-
document.getElementById("smallImgTxt").value = localStorage.getItem('smallTxtVar2');
235-
document.getElementById("smallImgIdt").value = localStorage.getItem('smallIdtVar2');
236-
document.getElementById("btnUrl1").value = localStorage.getItem('btnUrl1Var2');
237-
document.getElementById("btnUrl2").value = localStorage.getItem('btnUrl2Var2');
238-
document.getElementById("btnTxt1").value = localStorage.getItem('btnTxt1Var2');
239-
document.getElementById("btnTxt2").value = localStorage.getItem('btnTxt2Var2');
240-
}
241-
};
242197
window.addEventListener("load", function() {
243-
RPCfunc();
198+
let loadTxt = document.getElementById('loadingTxt')
199+
let loadBar = document.getElementById('loading-bar')
200+
let loadDiv = document.getElementById('loading')
244201
countUpFromTime(Date.now());
245-
document.getElementById('badgeTooltipText').innerText = `v${version} @ 20.06.22`
246-
toggleSaves()
202+
loadTxt.innerText = "Loading... (15%)"
203+
loadBar.style.width = '12vw'
204+
loadBar.style.opacity = "1"
247205
toggleSaves()
206+
loadTxt.innerText = "Loading... (55%)"
207+
loadBar.style.width = '44vw'
208+
setTimeout(() => {
209+
toggleSaves()
210+
loadTxt.innerText = "Loading... (87%)"
211+
loadBar.style.width = '69vw'
212+
document.getElementById('badgeTooltipText').innerText = `v${version} @ 20.06.22`
213+
loadTxt.innerText = "Loading... (100%)"
214+
loadBar.style.width = '80vw'
215+
setTimeout(() => {
216+
loadDiv.style.filter = "opacity(0)"
217+
setTimeout(() => {
218+
loadDiv.style.display='none'
219+
}, 400)
220+
}, 100)
221+
}, 500)
248222
})
249223

250224
const linethrough = () => {
@@ -265,7 +239,6 @@
265239

266240
};
267241

268-
269242
const toggleSaves = () => {
270243
let doc = document
271244
let save1 = doc.getElementById('save1')
@@ -296,7 +269,6 @@
296269
toggleSave = localStorage.getItem('selected')=='false'?false:true
297270
console.log(toggleSave)
298271

299-
300272
} else if (!toggleSave) {
301273
save1.setAttribute('data-selected', 'false')
302274
save2.setAttribute('data-selected', 'true')
@@ -322,11 +294,8 @@
322294
RPCfunc()
323295
toggleSave = localStorage.getItem('selected')=='true'?true:false
324296
console.log(toggleSave)
325-
326297
}
327-
328298
}
329-
330299
ipcRenderer.on('enableSaves', (arg, event) => {
331300
let url1div = document.getElementById('savesMenu');
332301
url1div.style.transition = "all 500ms ease";
@@ -429,6 +398,7 @@
429398

430399
}
431400
</script>
401+
432402
<!-- main HTML elements to recreate the rich presence preview-->
433403
<div id='bg'></div>
434404
<img src="./assets/Scrolling-Lines-Pink.gif" alt="Discord PFP" width="60" height="60", class='pfp' id='pfp'>
@@ -438,13 +408,10 @@
438408
<button type="button" class="elapsed thingy items" id="elapsed" readonly='true' unselectable="on" contenteditable="false" onselectstart="select=false" onclick='linethrough()'>00:01 Elapsed</button>
439409
<input type="text" class="btnTxt1 stuff items buttons" placeholder="Button Text 1" id="btnTxt1" value='Button Text 1' onclick="this.select()" onchange="RPCfunc()">
440410
<input type="text" class="btnTxt2 stuff items buttons" placeholder="Button Text 2" id="btnTxt2" value='Button Text 2' onclick="this.select()" onchange="RPCfunc()">
441-
442-
443411
<h3 class='nickname' id='nickname'> Testing Only</h3>
444412
<h4 class='username' id='username'> Test Account#0001</h4>
445413
<div class='images things' id='play'>Playing a game</div>
446414
<input type="text" class='genshin things' id='name' value='Genshin Impact' placeholder="Game Name" onclick="this.select()" onchange="RPCfunc()"></input>
447-
448415
<img src='https://cdn.discordapp.com/app-assets/929391097824821318/929483644731551754.png' alt='paimon' width="60" height="60" class='paimon things' id='paimon' onclick="paimonClick()">
449416
<img src='assets/yae.png' alt='small' width="20" height="20" class='yae things' id='small' onclick='smallClick()'>
450417
<img src="./assets/circle.png" alt="circle" width="10" height="10", class='circle'>
@@ -455,8 +422,6 @@ <h4 class='username' id='username'> Test Account#0001</h4>
455422
<div id="badgeTooltipText">v9.99.9 @ undefined</div>
456423
<div class='triangle'></div>
457424
</div>
458-
459-
460425
<img src="./assets/divider.png" alt="divider" width="230" height="1", class='divider'>
461426
<img src='./assets/cog-icon.png' alt='cog' width='15' height="15" class="cog things" id='cog1' onclick="url1func()">
462427
<img src='./assets/cog-icon.png' alt='cog' width='15' height="15" class="cog things" id='cog2' onclick="url2func()">
@@ -489,5 +454,9 @@ <h4 class='username' id='username'> Test Account#0001</h4>
489454
<button type="button" class="closeBtn" onclick="toggleSaves()" id="toggleSaves">Toggle Saves</button>
490455
<button type="button" class="closeBtn" onclick="closeFunc(5)" id="closeBtn5">Close Menu</button>
491456
</div>
492-
</body>
493-
</html>
457+
<div id='loading'>
458+
<div class='URL' id="loadingTxt">Loading... (0%)</div>
459+
<button class='stuff items btnUrls' id='empty-bar'></button>
460+
<button class='stuff items btnUrls' id='loading-bar'></button>
461+
</div>
462+
</html>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "gluta",
33
"productName": "Gluta",
4-
"version": "1.6.3",
4+
"version": "1.6.4",
55
"description": "A discord Rich Presence script built for Genshin Impact made to be as easy as possible to use.",
66
"main": "main.js",
77
"scripts": {

style.css

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,17 @@ body > * {
384384
transition: filter 400ms ease;
385385
}
386386

387+
388+
#loading {
389+
position: absolute;
390+
width: 100vw;
391+
height: 100vh;
392+
background-color: rgba(0,0,0,.9);
393+
z-index: 1;
394+
filter: opacity(1);
395+
transition: filter 400ms ease;
396+
}
397+
387398
#save1 {
388399
transform: translateY(9.5em) translateX(10vw);
389400
}
@@ -410,6 +421,18 @@ body > * {
410421
transform: translateY(20.25em) translateX(20vw) scale(1.05);
411422
}
412423

424+
#loadingTxt {
425+
text-align: center;
426+
transform: translateY(8em) translateX(30vw) scale(1);
427+
}
428+
429+
#loading-bar {
430+
border-width: 0em;
431+
width: 0;
432+
opacity: 0;
433+
background-color: rgba(53, 56, 61, 0.5);
434+
transition: all 1000ms ease;
435+
}
413436

414437
.URL {
415438
position: absolute;

0 commit comments

Comments
 (0)