Skip to content

Commit 0af5f1b

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 906957e + 50eb7b6 commit 0af5f1b

File tree

5 files changed

+71
-1
lines changed

5 files changed

+71
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
FreeCodeCamp Python Curriculum
2+
https://freecodecamp.github.io/python-coding-challenges
23
=============
34

45
To run locally:

index.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
<i class="fa fa-refresh"></i>
6161
</button>
6262

63-
<button id="map-button" class="btn">
63+
<button id="map-button" class="btn" onclick="toggleMap()">
6464
Map
6565
<i class="fa fa-list"></i>
6666
</button>
@@ -69,6 +69,17 @@
6969

7070
</div>
7171

72+
<div id="map" class="map">
73+
<a href="javascript:void(0)" class="close-map" onclick="toggleMap()">&times;</a>
74+
<div class="challenge-list">
75+
<a href="#" onclick="loadChallengeFromMap('a')">Addition</a>
76+
<a href="#" onclick="loadChallengeFromMap('b')">Subtraction</a>
77+
<a href="#" onclick="loadChallengeFromMap('c')">Dummy 1</a>
78+
<a href="#" onclick="loadChallengeFromMap('d')">Dummy 2</a>
79+
</div>
80+
</div>
81+
7282
<script src="load-challenges.js"></script>
83+
<script src="map.js"></script>
7384
</body>
7485
</html>

load-challenges.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,16 @@ function startLoadChallenge() {
101101
if ( !foundIncomplete ) courseComplete(challenges, challenges.length - 1);
102102
}
103103

104+
function loadChallengeFromMap(id) {
105+
const challenges = getChallengeList();
106+
for (const i in challenges) {
107+
let c = challenges[i];
108+
if ( c.id === id ) {
109+
loadChallenge(challenges, i);
110+
}
111+
}
112+
}
113+
104114
(() => {
105115
if ( localStorage.getItem('fcc-python-challenges') ) {
106116
startLoadChallenge();

map.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
function toggleMap() {
2+
const mapRef = document.getElementById("map");
3+
const currentWidth = mapRef.style.width;
4+
mapRef.style.width = currentWidth === "250px" ? "0" : "250px";
5+
}

stylesheet.css

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,3 +172,46 @@ h2 {
172172
cursor: pointer;
173173
text-decoration: underline;
174174
}
175+
176+
.map {
177+
height: 100%;
178+
width: 0;
179+
position: fixed;
180+
z-index: 1;
181+
top: 0;
182+
right: 0;
183+
background-color: #eee;
184+
overflow-x: hidden;
185+
padding-top: 60px;
186+
transition: 0.5s;
187+
}
188+
189+
.map a {
190+
padding: 8px 8px 8px 32px;
191+
text-decoration: none;
192+
font-size: 25px;
193+
color: #818181;
194+
display: block;
195+
transition: 0.3s;
196+
}
197+
198+
.map a:hover, .offcanvas a:focus {
199+
color: #006400;
200+
}
201+
202+
.map .close-map {
203+
position: absolute;
204+
top: 0;
205+
right: 25px;
206+
font-size: 36px;
207+
margin-left: 50px;
208+
}
209+
210+
@media screen and (max-height: 450px) {
211+
.map {padding-top: 15px;}
212+
.map a {font-size: 18px;}
213+
}
214+
215+
.challenge-list {
216+
border-top: 2px solid #006400;
217+
}

0 commit comments

Comments
 (0)