feat: add navbar
Fixes #5 Signed-off-by: Matej Focko <mfocko@redhat.com>
This commit is contained in:
parent
4b021a62f0
commit
421862aaae
2 changed files with 156 additions and 36 deletions
139
comparator.html
139
comparator.html
|
@ -4,17 +4,56 @@
|
|||
<meta charset="UTF-8" />
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet"
|
||||
integrity="sha384-0evHe/X+R7YkIZDRvuzKMRqM+OrBnVFBL6DOitfPri4tjfHxaWutUpFmBp4vmVor" crossorigin="anonymous" />
|
||||
<link
|
||||
href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/css/bootstrap.min.css"
|
||||
rel="stylesheet"
|
||||
integrity="sha384-0evHe/X+R7YkIZDRvuzKMRqM+OrBnVFBL6DOitfPri4tjfHxaWutUpFmBp4vmVor"
|
||||
crossorigin="anonymous"
|
||||
/>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<nav class="navbar navbar-expand-lg bg-light">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="./index.html">WAVL Tree Visualization</a>
|
||||
<button
|
||||
class="navbar-toggler"
|
||||
type="button"
|
||||
data-bs-toggle="collapse"
|
||||
data-bs-target="#navbarNav"
|
||||
aria-controls="navbarNav"
|
||||
aria-expanded="false"
|
||||
aria-label="Toggle navigation"
|
||||
>
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarNav">
|
||||
<ul class="navbar-nav">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="./index.html">Visualization</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" aria-current="page" href="#"
|
||||
>Comparator</a
|
||||
>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="container px-5 py-5">
|
||||
<div class="row">
|
||||
<div class="col-auto">
|
||||
<form class="row" id="insertTree" onSubmit="return insertCallback()">
|
||||
<div class="col-auto">
|
||||
<input class="form-control" id="insertInput" type="text" placeholder="Number to insert" autofocus />
|
||||
<input
|
||||
class="form-control"
|
||||
id="insertInput"
|
||||
type="text"
|
||||
placeholder="Number to insert"
|
||||
autofocus
|
||||
/>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<button class="btn btn-primary" type="submit">Insert</button>
|
||||
|
@ -25,7 +64,12 @@
|
|||
<div class="col-auto">
|
||||
<form class="row" id="deleteTree" onSubmit="return deleteCallback()">
|
||||
<div class="col-auto">
|
||||
<input class="form-control" id="deleteInput" type="text" placeholder="Number to delete" />
|
||||
<input
|
||||
class="form-control"
|
||||
id="deleteInput"
|
||||
type="text"
|
||||
placeholder="Number to delete"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<input class="btn btn-primary" type="submit" value="Delete" />
|
||||
|
@ -34,23 +78,45 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row py-3">
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<h4 class="col-auto">Choose left tree:</h4>
|
||||
<div class="btn-group col-auto" role="group">
|
||||
<input type="radio" class="btn-check" name="leftTreeSelection" id="lWavlTreeBtn" autocomplete="off"
|
||||
onclick="switchTree(WAVLTree, 'left')" />
|
||||
<label class="btn btn-outline-primary" for="lWavlTreeBtn">WAVL</label>
|
||||
<input
|
||||
type="radio"
|
||||
class="btn-check"
|
||||
name="leftTreeSelection"
|
||||
id="lWavlTreeBtn"
|
||||
autocomplete="off"
|
||||
onclick="switchTree(WAVLTree, 'left')"
|
||||
/>
|
||||
<label class="btn btn-outline-primary" for="lWavlTreeBtn"
|
||||
>WAVL</label
|
||||
>
|
||||
|
||||
<input type="radio" class="btn-check" name="leftTreeSelection" id="lAvlTreeBtn" checked autocomplete="off"
|
||||
onclick="switchTree(AVLTree, 'left')" />
|
||||
<input
|
||||
type="radio"
|
||||
class="btn-check"
|
||||
name="leftTreeSelection"
|
||||
id="lAvlTreeBtn"
|
||||
checked
|
||||
autocomplete="off"
|
||||
onclick="switchTree(AVLTree, 'left')"
|
||||
/>
|
||||
<label class="btn btn-outline-primary" for="lAvlTreeBtn">AVL</label>
|
||||
|
||||
<input type="radio" class="btn-check" name="leftTreeSelection" id="lRavlTreeBtn" autocomplete="off"
|
||||
onclick="switchTree(RAVLTree, 'left')" />
|
||||
<label class="btn btn-outline-primary" for="lRavlTreeBtn">rAVL</label>
|
||||
<input
|
||||
type="radio"
|
||||
class="btn-check"
|
||||
name="leftTreeSelection"
|
||||
id="lRavlTreeBtn"
|
||||
autocomplete="off"
|
||||
onclick="switchTree(RAVLTree, 'left')"
|
||||
/>
|
||||
<label class="btn btn-outline-primary" for="lRavlTreeBtn"
|
||||
>rAVL</label
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -59,23 +125,46 @@
|
|||
<div class="row">
|
||||
<h4 class="col-auto">Choose right tree:</h4>
|
||||
<div class="btn-group col-auto" role="group">
|
||||
<input type="radio" class="btn-check" name="rightTreeSelection" id="rWavlTreeBtn" checked autocomplete="off"
|
||||
onclick="switchTree(WAVLTree, 'right')" />
|
||||
<label class="btn btn-outline-primary" for="rWavlTreeBtn">WAVL</label>
|
||||
<input
|
||||
type="radio"
|
||||
class="btn-check"
|
||||
name="rightTreeSelection"
|
||||
id="rWavlTreeBtn"
|
||||
checked
|
||||
autocomplete="off"
|
||||
onclick="switchTree(WAVLTree, 'right')"
|
||||
/>
|
||||
<label class="btn btn-outline-primary" for="rWavlTreeBtn"
|
||||
>WAVL</label
|
||||
>
|
||||
|
||||
<input type="radio" class="btn-check" name="rightTreeSelection" id="rAvlTreeBtn" autocomplete="off"
|
||||
onclick="switchTree(AVLTree, 'right')" />
|
||||
<input
|
||||
type="radio"
|
||||
class="btn-check"
|
||||
name="rightTreeSelection"
|
||||
id="rAvlTreeBtn"
|
||||
autocomplete="off"
|
||||
onclick="switchTree(AVLTree, 'right')"
|
||||
/>
|
||||
<label class="btn btn-outline-primary" for="rAvlTreeBtn">AVL</label>
|
||||
|
||||
<input type="radio" class="btn-check" name="rightTreeSelection" id="rRavlTreeBtn" autocomplete="off"
|
||||
onclick="switchTree(RAVLTree, 'right')" />
|
||||
<label class="btn btn-outline-primary" for="rRavlTreeBtn">rAVL</label>
|
||||
<input
|
||||
type="radio"
|
||||
class="btn-check"
|
||||
name="rightTreeSelection"
|
||||
id="rRavlTreeBtn"
|
||||
autocomplete="off"
|
||||
onclick="switchTree(RAVLTree, 'right')"
|
||||
/>
|
||||
<label class="btn btn-outline-primary" for="rRavlTreeBtn"
|
||||
>rAVL</label
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row py-3">
|
||||
<div class="col px-3" style="text-align: center;" id="left"></div>
|
||||
<div class="col px-3" style="text-align: center;" id="right"></div>
|
||||
<div class="col px-3" style="text-align: center" id="left"></div>
|
||||
<div class="col px-3" style="text-align: center" id="right"></div>
|
||||
|
||||
<div class="col-2 px-1">
|
||||
<div class="row">
|
||||
|
@ -111,6 +200,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="https://d3js.org/d3.v5.min.js"></script>
|
||||
<script src="https://unpkg.com/@hpcc-js/wasm@0.3.11/dist/index.min.js"></script>
|
||||
|
@ -126,7 +216,8 @@
|
|||
|
||||
<script src="recorder.js"></script>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/js/bootstrap.bundle.min.js"
|
||||
<script
|
||||
src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/js/bootstrap.bundle.min.js"
|
||||
integrity="sha384-pprn3073KE6tl6bjs2QrFaJGz5/SUsLqktiwsUTF55Jfv3qYSDhgCecCxMW52nD2"
|
||||
crossorigin="anonymous"
|
||||
></script>
|
||||
|
|
29
index.html
29
index.html
|
@ -13,6 +13,35 @@
|
|||
</head>
|
||||
|
||||
<body>
|
||||
<nav class="navbar navbar-expand-lg bg-light">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="#">WAVL Tree Visualization</a>
|
||||
<button
|
||||
class="navbar-toggler"
|
||||
type="button"
|
||||
data-bs-toggle="collapse"
|
||||
data-bs-target="#navbarNav"
|
||||
aria-controls="navbarNav"
|
||||
aria-expanded="false"
|
||||
aria-label="Toggle navigation"
|
||||
>
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarNav">
|
||||
<ul class="navbar-nav">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" aria-current="page" href="#"
|
||||
>Visualization</a
|
||||
>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="./comparator.html">Comparator</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="container px-5 py-5">
|
||||
<div class="row">
|
||||
<div class="col-auto">
|
||||
|
|
Loading…
Reference in a new issue