Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
kiannp44 committed May 22, 2023
1 parent ba00159 commit a8fa9b4
Showing 1 changed file with 85 additions and 1 deletion.
86 changes: 85 additions & 1 deletion _notebooks/2023-05-16-jstest.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,50 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"<script lang=\"ts\">\n",
"\texport let title: string;\n",
"\texport let text: string;\n",
"\texport let link: string;\n",
" export let level: string;\n",
" let completed: Boolean;\n",
"\n",
"\n",
" Fetch();\n",
" \n",
" async function Fetch () {\n",
" fetch(\"https://monkeybackend.rohanj.dev/api/code/getLevelList\", {\n",
" method: 'POST',\n",
" credentials: 'include',\n",
" headers: {\n",
" 'Accept': 'application/json',\n",
" 'Content-Type': 'application/json'\n",
" }\n",
" })\n",
" .then(response =>\n",
" response.json().then(data => {\n",
" if (data[level] == \"Complete\") completed = true;\n",
" else completed = false;\n",
" }).catch(e => { })\n",
" )\n",
" .catch(error => {\n",
" \n",
" })\n",
" }\n",
"</script>\n",
"\n",
"<div class=\"card w-96 bg-green-700 shadow-xl border-green-800 border-2\">\n",
" <div class=\"card-body\">\n",
" <h2 class=\"card-title\">{title}</h2>\n",
" <p>{text}</p>\n",
" {#if completed}\n",
" <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"lucide lucide-check absolute right-7 top-5\"><polyline points=\"20 6 9 17 4 12\"></polyline></svg>\n",
" {/if}\n",
" <div class=\"card-actions justify-end\">\n",
" <a href=\"/frq/{link}\" class=\"btn btn-primary\">Go</a>\n",
" </div>\n",
" </div>\n",
" </div>\n",
"\n",
"<!DOCTYPE html>\n",
"<html>\n",
"<style>\n",
Expand Down Expand Up @@ -744,9 +788,49 @@
"metadata": {},
"source": [
"<script lang=\"ts\">\n",
" import Card from \"../../../components/Card.svelte\";\n",
"\texport let title: string;\n",
"\texport let text: string;\n",
"\texport let link: string;\n",
" export let level: string;\n",
" let completed: Boolean;\n",
"\n",
"\n",
" Fetch();\n",
" \n",
" async function Fetch () {\n",
" fetch(\"https://monkeybackend.rohanj.dev/api/code/getLevelList\", {\n",
" method: 'POST',\n",
" credentials: 'include',\n",
" headers: {\n",
" 'Accept': 'application/json',\n",
" 'Content-Type': 'application/json'\n",
" }\n",
" })\n",
" .then(response =>\n",
" response.json().then(data => {\n",
" if (data[level] == \"Complete\") completed = true;\n",
" else completed = false;\n",
" }).catch(e => { })\n",
" )\n",
" .catch(error => {\n",
" \n",
" })\n",
" }\n",
"</script>\n",
"\n",
"<div class=\"card w-96 bg-green-700 shadow-xl border-green-800 border-2\">\n",
" <div class=\"card-body\">\n",
" <h2 class=\"card-title\">{title}</h2>\n",
" <p>{text}</p>\n",
" {#if completed}\n",
" <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"lucide lucide-check absolute right-7 top-5\"><polyline points=\"20 6 9 17 4 12\"></polyline></svg>\n",
" {/if}\n",
" <div class=\"card-actions justify-end\">\n",
" <a href=\"/frq/{link}\" class=\"btn btn-primary\">Go</a>\n",
" </div>\n",
" </div>\n",
" </div>\n",
"\n",
"<div id=\"myBtnContainer\" class=\"bg-green-700\">\n",
" <button class=\"btn active\" onclick=\"filterSelection('all')\"> Show all</button>\n",
" <button class=\"btn\" onclick=\"filterSelection('mncs')\"> Methods and Control Structures</button>\n",
Expand Down

0 comments on commit a8fa9b4

Please sign in to comment.