Skip to content

Commit

Permalink
updated design
Browse files Browse the repository at this point in the history
  • Loading branch information
Leo Irudayam committed Dec 17, 2019
1 parent d19c383 commit b8b8930
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 8 deletions.
31 changes: 23 additions & 8 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>Best Practices Coding</title>
<title>the open Experience</title>
<script src="https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/run_prettify.js?autoload=true&amp;skin=sunburst&amp;lang=css" defer=""></script>
<script src="https://cdn.jsdelivr.net/gh/google/code-prettify@master/src/lang-swift.js"></script>
<script src="https://cdn.jsdelivr.net/gh/google/code-prettify@master/src/lang-kotlin.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js"></script>
<link href="https://fonts.googleapis.com/css?family=PT+Sans&display=swap" rel="stylesheet">
<link rel="icon" type="image/png" href="the_open_experience_favicon.png" sizes="96x96">

<link href="style.css" rel="stylesheet" />
<script defer="defer">
var iUnit = 0;
Expand All @@ -19,29 +21,43 @@
$('#dropdown_container').append("<div class=\"item\" onclick=\"navigate('" + i + "')\">Unit " + parseInt(i + 1) + ": " + val.name + "</div>");
});

oCurrentUnit = aUnits[iUnit];
processUnit();

$(document).ready(function(){
var theHash = window.location.hash;
theHash = theHash.substr(1);
if (theHash !== "") {
navigate(aUnits.findIndex(x => x.folder === theHash));
}
else {
goTo();
}
});
});



function navigateLeft() {
iUnit--;
if (iUnit < 0) {
iUnit = aUnits.length - 1;
}
oCurrentUnit = aUnits[iUnit];
processUnit();
goTo();
}

function navigateRight() {
iUnit = (iUnit + 1) % aUnits.length;
oCurrentUnit = aUnits[iUnit];
processUnit();
goTo();
}

function navigate(i) {
iUnit = Math.abs(i) % aUnits.length;
goTo();
}

function goTo() {
oCurrentUnit = aUnits[iUnit];
processUnit();
window.location.hash = "#" + oCurrentUnit.folder;
}

function processUnit() {
Expand All @@ -55,7 +71,6 @@
}, 'text');

$.get("bp_content/" + oCurrentUnit.folder + "/bad_practice.txt", function(data) {
console.log(oCurrentUnit.languageKey);
$("#bad_code").html(PR.prettyPrintOne(data, oCurrentUnit.languageKey));
$("#bad_code").attr("class", "prettyprint linenums:1 lang-" + oCurrentUnit.languageKey + " prettyprinted");
}, 'text');
Expand Down
4 changes: 4 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
body {
font-family: 'PT Sans', sans-serif;
background-color: #F1F1F1;
background-image: url(the_open_experience.png);
background-repeat: no-repeat;
background-position: 15px 15px;
background-size: 220px;
}

.dropdown {
Expand Down
Binary file added the_open_experience.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added the_open_experience_favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b8b8930

Please sign in to comment.