diff --git a/client/src/components/welcome.css b/client/src/components/welcome.css index b0dc705..c57f6e9 100644 --- a/client/src/components/welcome.css +++ b/client/src/components/welcome.css @@ -54,16 +54,16 @@ h5, h6 { /* SVG Graphic */ /***************/ -svg .world-title-wrapper { +svg .world-title-wrapper, svg .level-title-wrapper div { overflow: auto; } -svg .world-title-wrapper div { +svg .world-title-wrapper div, svg .level-title-wrapper div { width: 100%; height: 100%; } -svg .world-title-wrapper div { +svg .world-title-wrapper div, svg .level-title-wrapper div { display: flex; align-items:center; justify-content:center; @@ -71,13 +71,26 @@ svg .world-title-wrapper div { } -svg .world-title { - font-weight: 500; +svg .world-title, svg .level-title { color: white; margin: 0; padding: 0; } +svg .world-title { + font-weight: 700; +} + +svg .level-title { + font-weight: 400; + opacity: 0; + transition: opacity .3s; +} + +svg .level:hover .level-title { + opacity: 1; +} + /******************/ /* Privacy Button */ /******************/ diff --git a/client/src/components/welcome.tsx b/client/src/components/welcome.tsx index ab4c120..35122bf 100644 --- a/client/src/components/welcome.tsx +++ b/client/src/components/welcome.tsx @@ -36,8 +36,16 @@ function LevelIcon({ worldId, levelId, position, completed, available }) { // TODO: relative positioning? return ( - + + +
+

+ {levelId} +

+
+
) } @@ -118,11 +126,20 @@ function Welcome() { ) } - // Draw the worlds let worldUnlocked = completed[worldId][0] let worldCompleted = completed[worldId].slice(1).every(Boolean) + + // This selects the first uncompleted level + let nextLevel: number = completed[worldId].findIndex(c => !c) + if (nextLevel <= 1) { + // This uses the fact that `findIndex` returns `-1` if it does not find an uncompleted entry + // so `-1, 0, 1` are all the indices where we want to show the introduction. + nextLevel = 0 + } + + // Draw the worlds svgElements.push( - +