diff --git a/assets/scss/common/_custom.scss b/assets/scss/common/_custom.scss
index 37053da7..7d7391ea 100644
--- a/assets/scss/common/_custom.scss
+++ b/assets/scss/common/_custom.scss
@@ -63,26 +63,26 @@
.navbar {
border: 0px;
- background: linear-gradient(104.24deg,#1a74fc -4.4%,#4ef286 112.23%);
+ background: linear-gradient(104.24deg, #1a74fc -4.4%, #4ef286 112.23%);
}
[data-dark-mode] .navbar {
background: rgba(33, 37, 41, 0.95);
}
-.offcanvas .show.nav-link.lp{
+.offcanvas .show.nav-link.lp {
color: black !important;
}
-.nav-link.lp{
+.nav-link.lp {
color: white;
}
-.nav-link.lp a:hover{
+.nav-link.lp a:hover {
color: white !important;
}
-.nav a:hover{
+.nav a:hover {
text-decoration: underline;
color: white !important;
}
@@ -98,19 +98,19 @@
}
@media (max-width: 767px) {
- .nav-link.lp{
+ .nav-link.lp {
color: black;
}
-
- .nav-link.lp a:hover{
+
+ .nav-link.lp a:hover {
color: black !important;
}
-
- .nav a:hover{
+
+ .nav a:hover {
text-decoration: underline;
color: black !important;
}
-
+
.nav-link.lp.active {
color: black;
text-decoration: underline;
@@ -155,7 +155,7 @@
color: black;
}
-[data-dark-mode] .landing-steps a {
+[data-dark-mode] .landing-steps a {
color: white;
}
@@ -304,4 +304,4 @@
[data-dark-mode] .landing-colo {
color: white;
-}
+}
\ No newline at end of file
diff --git a/content/en/curriculum/filecoin/drand(tutorial).md b/content/en/curriculum/filecoin/drand(tutorial).md
new file mode 100644
index 00000000..c01a22fb
--- /dev/null
+++ b/content/en/curriculum/filecoin/drand(tutorial).md
@@ -0,0 +1,58 @@
+---
+title: "Drand (Tutorial)"
+description: "Distributed, Unpredictable, Publicly-Verifiable, and Decentralized Randomness Generator"
+draft: false
+menu:
+ curriculum:
+ parent: "curriculum-filecoin"
+weight: 423
+category: lecture
+level:
+- deep
+---
+This example goes over how to use Drand as a client to retrieve a random value in a key-value pair list.
+
+**If a code section loads as a single line, try refreshing the page.**
+
+## Pre-Requisites
+* Make sure you have Node version 12 or greater installed. You can find instructions on how to do that on the [NodeJS website](https://nodejs.org/en/).
+* Clone the [launchpad-tutorials](https://github.com/protocol/launchpad-tutorials) repository and run `npm install`
+ 1) `npm install`
+ 2) `node bias.js`
+
+## Caveats
+* Drand mainnet releases a random number every 30 seconds. So if you run your results immediately after the other, you may get the exact same output. The problem that arises is if you want to test if the biased randomness works or not over time, it would take a really long time to test.
+* This "biased" algorithm is not sophisticated, it takes a random number and compares it against the list of user provided items, the last number smaller than the random number is chosen.
+
+## Instructions
+Imagine you are a full time L5 software engineer and have more important things to think about than what to get for lunch.
+You decide to leave it up to randomness to choose your next meal. But you still have preferences. You assign weights to your preferences such that items you would like to eat most often have heavier weights (chances of being chosen). And things you don't want to eat as often, have smaller chance of being chosen.
+
+To be able start talking with the Drand network you will need to import the necessary libraries.
+
+
+
+Now we can make calls to the Drand network. But to do that we have to create the Client to get the latest random number published.
+
+
+
+`client.get()` is an asynchronous function that returns an object where you can access the random number with `res.randomness`. This returns a 64-digit hexidecimal number as a **string**.
+
+We do not need 64 digits for this simple example let alone for them to be in hex. For our example we can just grab the first two digits from `rand` and convert it base 10. This will make it easier to compare the user weights to our random number.
+
+``` javascript
+rand = randomness.slice(0, 2);
+randomDecimal = parseInt(rand, HEX); // HEX = 16
+```
+
+ Unfortunately, a two digit Hexadecimal value [doesn't always convert to a 2 digit decimal number](https://kb.iu.edu/d/afdl). So we create a simple ["sliding window"](https://www.geeksforgeeks.org/window-sliding-technique/) function to find the first pair of digits that converts properly.
+
+
+
+Now that we have our random number we compare it against our food options to find out what we are having for lunch. This simple algorithm converts the user weights provided as decimal numbers to be integers, and adds the sums, the first weight that isn't bigger than our random number is what we are having for lunch.
+
+For example here is our food options,:
+``` javascript
+const FoodOptions = { "pho": 0.3, "croquets": 0.29, "pizza": 0.28, "pasta": 0.07, "molé_verde": 0.03, "shrimp": .03 };
+```
+
\ No newline at end of file
diff --git a/content/en/curriculum/filecoin/drand.md b/content/en/curriculum/filecoin/drand.md
index d9c96765..ff16d3b6 100644
--- a/content/en/curriculum/filecoin/drand.md
+++ b/content/en/curriculum/filecoin/drand.md
@@ -18,9 +18,9 @@ Drand uses [cryptographic methods](https://drand.love/docs/cryptography/#setup-p
{{< youtube ydwW2HFFxNI >}}
-#### [drand - The Distributed Randomness Beacon | ResNetLabs On Tour – Nicolas GAILLY](https://research.protocol.ai/tutorials/resnetlab-on-tour/modular-p2p-stack/)
+#### [Drand - The Distributed Randomness Beacon | ResNetLabs On Tour – Nicolas GAILLY](https://research.protocol.ai/tutorials/resnetlab-on-tour/modular-p2p-stack/)
-drand is a distributed randomness beacon. It provides publicly-verifiable, unpredictable, and bias-resistant random numbers as a public service. In this module, we’ll walk through:
+Drand is a distributed randomness beacon. It provides publicly-verifiable, unpredictable, and bias-resistant random numbers as a public service. In this module, we’ll walk through:
* Threshold Cryptography & Randomness
* Distributed Key Generation in drand
diff --git a/layouts/partials/footer/script-footer.html b/layouts/partials/footer/script-footer.html
index 5cae2790..f42928fc 100644
--- a/layouts/partials/footer/script-footer.html
+++ b/layouts/partials/footer/script-footer.html
@@ -17,44 +17,44 @@
{{ $slice := slice $app -}}
{{ if .Site.Params.options.lazySizes -}}
- {{ $lazySizes := resources.Get "js/lazysizes.js" -}}
- {{ $lazySizes := $lazySizes | js.Build -}}
- {{ $slice = $slice | append $lazySizes -}}
+{{ $lazySizes := resources.Get "js/lazysizes.js" -}}
+{{ $lazySizes := $lazySizes | js.Build -}}
+{{ $slice = $slice | append $lazySizes -}}
{{ end -}}
{{ if .Site.Params.options.clipBoard -}}
- {{ $clipBoard := resources.Get "js/clipboard.js" -}}
- {{ $clipBoard := $clipBoard | js.Build -}}
- {{ $slice = $slice | append $clipBoard -}}
+{{ $clipBoard := resources.Get "js/clipboard.js" -}}
+{{ $clipBoard := $clipBoard | js.Build -}}
+{{ $slice = $slice | append $clipBoard -}}
{{ end -}}
{{ if .Site.Params.options.instantPage -}}
- {{ $instantPage := resources.Get "js/instant.page.js" -}}
- {{ $instantPage := $instantPage | js.Build -}}
- {{ $slice = $slice | append $instantPage -}}
+{{ $instantPage := resources.Get "js/instant.page.js" -}}
+{{ $instantPage := $instantPage | js.Build -}}
+{{ $slice = $slice | append $instantPage -}}
{{ end -}}
{{ if .Site.Params.options.flexSearch -}}
- {{ $flexSearch := resources.Get "js/vendor/flexsearch/dist/flexsearch.bundle.js" -}}
- {{ $slice = $slice | append $flexSearch -}}
+{{ $flexSearch := resources.Get "js/vendor/flexsearch/dist/flexsearch.bundle.js" -}}
+{{ $slice = $slice | append $flexSearch -}}
{{ end -}}
{{ if .Site.Params.options.darkMode -}}
- {{ $darkMode := resources.Get "js/darkmode.js" -}}
- {{ $darkMode := $darkMode | js.Build -}}
- {{ $slice = $slice | append $darkMode -}}
+{{ $darkMode := resources.Get "js/darkmode.js" -}}
+{{ $darkMode := $darkMode | js.Build -}}
+{{ $slice = $slice | append $darkMode -}}
{{ end -}}
{{ if and (.Site.Params.alert) (.Site.Params.alertDismissable) -}}
- {{ $alert := resources.Get "js/alert.js" -}}
- {{ $alert := $alert | js.Build -}}
- {{ $slice = $slice | append $alert -}}
+{{ $alert := resources.Get "js/alert.js" -}}
+{{ $alert := $alert | js.Build -}}
+{{ $slice = $slice | append $alert -}}
{{ end -}}
{{ if .Site.Params.options.kaTex -}}
- {{ $katexConfig := resources.Get "js/katex.js" -}}
- {{ $katexConfig := $katexConfig | js.Build -}}
- {{ $slice = $slice | append $katexConfig -}}
+{{ $katexConfig := resources.Get "js/katex.js" -}}
+{{ $katexConfig := $katexConfig | js.Build -}}
+{{ $slice = $slice | append $katexConfig -}}
{{ end -}}
{{ $scrollLock := resources.Get "js/scroll-lock.js" | js.Build -}}
@@ -63,46 +63,49 @@
{{ $js := $slice | resources.Concat "main.js" -}}
{{ if eq (hugo.Environment) "development" -}}
- {{ if .Site.Params.options.bootStrapJs -}}
-
- {{ end -}}
- {{ if .Site.Params.options.highLight -}}
-
- {{ end -}}
- {{ if .Site.Params.options.kaTex -}}
-
-
- {{ end -}}
-
- {{ with .Params.mermaid -}}
-
- {{ end -}}
- {{ if and (.Site.Params.options.flexSearch) (not .IsHome) -}}
-
- {{ end -}}
+{{ if .Site.Params.options.bootStrapJs -}}
+
+{{ end -}}
+{{ if .Site.Params.options.highLight -}}
+
+{{ end -}}
+{{ if .Site.Params.options.kaTex -}}
+
+
+{{ end -}}
+
+{{ with .Params.mermaid -}}
+
+{{ end -}}
+{{ if and (.Site.Params.options.flexSearch) (not .IsHome) -}}
+
+{{ end -}}
{{ else -}}
- {{ $js := $js | minify | fingerprint "sha512" -}}
- {{ $index := $index | minify | fingerprint "sha512" -}}
- {{ $bs := $bs | minify | fingerprint "sha512" -}}
- {{ $highlight := $highlight | minify | fingerprint "sha512" -}}
- {{ $katex := $katex | minify | fingerprint "sha512" -}}
- {{ $katexAutoRender := $katexAutoRender | minify | fingerprint "sha512" -}}
- {{ $mermaid := $mermaid | minify | fingerprint "sha512" -}}
- {{ if .Site.Params.options.bootStrapJs -}}
-
- {{ end -}}
- {{ if .Site.Params.options.highLight -}}
-
- {{ end -}}
- {{ if .Site.Params.options.kaTex -}}
-
-
- {{ end -}}
-
- {{ with .Params.mermaid -}}
-
- {{ end -}}
- {{ if and (.Site.Params.options.flexSearch) (not .IsHome) -}}
-
- {{ end -}}
+{{ $js := $js | minify | fingerprint "sha512" -}}
+{{ $index := $index | minify | fingerprint "sha512" -}}
+{{ $bs := $bs | minify | fingerprint "sha512" -}}
+{{ $highlight := $highlight | minify | fingerprint "sha512" -}}
+{{ $katex := $katex | minify | fingerprint "sha512" -}}
+{{ $katexAutoRender := $katexAutoRender | minify | fingerprint "sha512" -}}
+{{ $mermaid := $mermaid | minify | fingerprint "sha512" -}}
+{{ if .Site.Params.options.bootStrapJs -}}
+
+{{ end -}}
+{{ if .Site.Params.options.highLight -}}
+
+{{ end -}}
+{{ if .Site.Params.options.kaTex -}}
+
+
+{{ end -}}
+
+{{ with .Params.mermaid -}}
+
+{{ end -}}
+{{ if and (.Site.Params.options.flexSearch) (not .IsHome) -}}
+
{{ end -}}
+{{ end -}}
\ No newline at end of file