Skip to content

Commit 7a0309b

Browse files
committed
Fluid Selection by Kalitsune
dscalzi#351
1 parent b64a292 commit 7a0309b

File tree

6 files changed

+151
-135
lines changed

6 files changed

+151
-135
lines changed

app/assets/css/launcher.css

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -542,15 +542,15 @@ body, button {
542542
10%, 90% {
543543
transform: translate3d(-1px, 0, 0);
544544
}
545-
545+
546546
20%, 80% {
547547
transform: translate3d(2px, 0, 0);
548548
}
549-
549+
550550
30%, 50%, 70% {
551551
transform: translate3d(-4px, 0, 0);
552552
}
553-
553+
554554
40%, 60% {
555555
transform: translate3d(4px, 0, 0);
556556
}
@@ -3426,7 +3426,7 @@ input:checked + .toggleSwitchSlider:before {
34263426
top: 25px;
34273427
display: none;
34283428
}
3429-
3429+
34303430
/* Left side of launch details container, displays percentage and a divider. */
34313431
#launch_details_left {
34323432
display: flex;
@@ -3713,10 +3713,6 @@ input:checked + .toggleSwitchSlider:before {
37133713
position: relative;
37143714
background: rgba(0, 0, 0, 0.25);
37153715
}
3716-
.accountListing[selected] {
3717-
cursor: default;
3718-
opacity: 1.0;
3719-
}
37203716
.accountListing:hover,
37213717
.accountListing:focus {
37223718
outline: none;
@@ -3854,7 +3850,8 @@ input:checked + .toggleSwitchSlider:before {
38543850

38553851
/* Server selection confirm button styles. */
38563852
#serverSelectConfirm,
3857-
#accountSelectConfirm {
3853+
#accountSelectConfirm,
3854+
#accountSelectManage {
38583855
background: none;
38593856
border: 1px solid #ffffff;
38603857
color: white;
@@ -3965,4 +3962,4 @@ input:checked + .toggleSwitchSlider:before {
39653962
/* Class which is applied when the spinner image is spinning. */
39663963
.rotating {
39673964
animation: rotating 10s linear infinite;
3968-
}
3965+
}

app/assets/js/scripts/landing.js

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const loggerLanding = LoggerUtil.getLogger('Landing')
4646

4747
/**
4848
* Show/hide the loading area.
49-
*
49+
*
5050
* @param {boolean} loading True if the loading area should be shown, otherwise false.
5151
*/
5252
function toggleLaunchArea(loading){
@@ -61,7 +61,7 @@ function toggleLaunchArea(loading){
6161

6262
/**
6363
* Set the details text of the loading area.
64-
*
64+
*
6565
* @param {string} details The new text for the loading details.
6666
*/
6767
function setLaunchDetails(details){
@@ -70,7 +70,7 @@ function setLaunchDetails(details){
7070

7171
/**
7272
* Set the value of the loading progress bar and display that value.
73-
*
73+
*
7474
* @param {number} percent Percentage (0-100)
7575
*/
7676
function setLaunchPercentage(percent){
@@ -81,7 +81,7 @@ function setLaunchPercentage(percent){
8181

8282
/**
8383
* Set the value of the OS progress bar and display that on the UI.
84-
*
84+
*
8585
* @param {number} percent Percentage (0-100)
8686
*/
8787
function setDownloadPercentage(percent){
@@ -91,7 +91,7 @@ function setDownloadPercentage(percent){
9191

9292
/**
9393
* Enable or disable the launch button.
94-
*
94+
*
9595
* @param {boolean} val True to enable, false to disable.
9696
*/
9797
function setLaunchEnabled(val){
@@ -135,10 +135,8 @@ document.getElementById('settingsMediaButton').onclick = async e => {
135135

136136
// Bind avatar overlay button.
137137
document.getElementById('avatarOverlay').onclick = async e => {
138-
await prepareSettings()
139-
switchView(getCurrentView(), VIEWS.settings, 500, 500, () => {
140-
settingsNavItemListener(document.getElementById('settingsNavAccount'), false)
141-
})
138+
e.target.blur()
139+
await toggleAccountSelection(true, true)
142140
}
143141

144142
// Bind selected account
@@ -192,7 +190,7 @@ const refreshMojangStatuses = async function(){
192190
loggerLanding.warn('Unable to refresh Mojang service status.')
193191
statuses = MojangRestAPI.getDefaultStatuses()
194192
}
195-
193+
196194
greenCount = 0
197195
greyCount = 0
198196

@@ -229,7 +227,7 @@ const refreshMojangStatuses = async function(){
229227
status = 'green'
230228
}
231229
}
232-
230+
233231
document.getElementById('mojangStatusEssentialContainer').innerHTML = tooltipEssentialHTML
234232
document.getElementById('mojangStatusNonEssentialContainer').innerHTML = tooltipNonEssentialHTML
235233
document.getElementById('mojang_status_icon').style.color = MojangRestAPI.statusToHex(status)
@@ -263,7 +261,7 @@ const refreshServerStatus = async (fade = false) => {
263261
document.getElementById('landingPlayerLabel').innerHTML = pLabel
264262
document.getElementById('player_count').innerHTML = pVal
265263
}
266-
264+
267265
}
268266

269267
refreshMojangStatuses()
@@ -276,7 +274,7 @@ let serverStatusListener = setInterval(() => refreshServerStatus(true), 300000)
276274

277275
/**
278276
* Shows an error overlay, toggles off the launch area.
279-
*
277+
*
280278
* @param {string} title The overlay title.
281279
* @param {string} desc The overlay description.
282280
*/
@@ -295,8 +293,8 @@ function showLaunchFailure(title, desc){
295293

296294
/**
297295
* Asynchronously scan the system for valid Java installations.
298-
*
299-
* @param {boolean} launchAfter Whether we should begin to launch after scanning.
296+
*
297+
* @param {boolean} launchAfter Whether we should begin to launch after scanning.
300298
*/
301299
async function asyncSystemScan(effectiveJavaOptions, launchAfter = true){
302300

@@ -321,7 +319,7 @@ async function asyncSystemScan(effectiveJavaOptions, launchAfter = true){
321319
setOverlayHandler(() => {
322320
setLaunchDetails(Lang.queryJS('landing.systemScan.javaDownloadPrepare'))
323321
toggleOverlay(false)
324-
322+
325323
try {
326324
downloadJava(effectiveJavaOptions, launchAfter)
327325
} catch(err) {
@@ -512,7 +510,7 @@ async function dlAsync(login = true) {
512510
showLaunchFailure(Lang.queryJS('landing.dlAsync.errorDuringFileVerificationTitle'), err.displayable || Lang.queryJS('landing.dlAsync.seeConsoleForDetails'))
513511
return
514512
}
515-
513+
516514

517515
if(invalidFileCount > 0) {
518516
loggerLaunchSuite.info('Downloading files.')
@@ -656,8 +654,8 @@ let newsGlideCount = 0
656654

657655
/**
658656
* Show the news UI via a slide animation.
659-
*
660-
* @param {boolean} up True to slide up, otherwise false.
657+
*
658+
* @param {boolean} up True to slide up, otherwise false.
661659
*/
662660
function slide_(up){
663661
const lCUpper = document.querySelector('#landingContainer > #upper')
@@ -731,7 +729,7 @@ let newsLoadingListener = null
731729

732730
/**
733731
* Set the news loading animation.
734-
*
732+
*
735733
* @param {boolean} val True to set loading animation, otherwise false.
736734
*/
737735
function setNewsLoading(val){
@@ -773,7 +771,7 @@ newsArticleContentScrollable.onscroll = (e) => {
773771

774772
/**
775773
* Reload the news without restarting.
776-
*
774+
*
777775
* @returns {Promise.<void>} A promise which resolves when the news
778776
* content has finished loading and transitioning.
779777
*/
@@ -811,7 +809,7 @@ async function digestMessage(str) {
811809
/**
812810
* Initialize News UI. This will load the news and prepare
813811
* the UI accordingly.
814-
*
812+
*
815813
* @returns {Promise.<void>} A promise which resolves when the news
816814
* content has finished loading and transitioning.
817815
*/
@@ -890,7 +888,7 @@ async function initNews(){
890888
const switchHandler = (forward) => {
891889
let cArt = parseInt(newsContent.getAttribute('article'))
892890
let nxtArt = forward ? (cArt >= newsArr.length-1 ? 0 : cArt + 1) : (cArt <= 0 ? newsArr.length-1 : cArt - 1)
893-
891+
894892
displayArticle(newsArr[nxtArt], nxtArt+1)
895893
}
896894

@@ -930,7 +928,7 @@ document.addEventListener('keydown', (e) => {
930928

931929
/**
932930
* Display a news article on the UI.
933-
*
931+
*
934932
* @param {Object} articleObject The article meta object.
935933
* @param {number} index The article index.
936934
*/
@@ -965,7 +963,7 @@ async function loadNews(){
965963
}
966964

967965
const promise = new Promise((resolve, reject) => {
968-
966+
969967
const newsFeed = distroData.rawDistribution.rss
970968
const newsHost = new URL(newsFeed).origin + '/'
971969
$.ajax({

0 commit comments

Comments
 (0)