Skip to content

Commit

Permalink
Better Mobile view
Browse files Browse the repository at this point in the history
  • Loading branch information
aceberg committed Jan 6, 2024
1 parent f074d8d commit 2bde2d8
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 62 deletions.
8 changes: 4 additions & 4 deletions internal/web/templates/config.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{{ define "config.html" }}

<body>
<div class="container mt-5">
<div class="container-lg mt-5">
<div class="row">
<div class="col">
<div class="col-md">
<div class="card border-primary">
<div class="card-header">Config</div>
<div class="card-body">
<div class="card-body table-responsive">
<table class="table table-borderless">
<form action="/config/" method="post">
<tr>
Expand Down Expand Up @@ -49,7 +49,7 @@
</div>
</div>
</div>
<div class="col">
<div class="col-md">
<div class="card border-primary">
<div class="card-header">About</div>
<div class="card-body">
Expand Down
8 changes: 4 additions & 4 deletions internal/web/templates/exercise.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{{ define "exercise.html" }}

<body>
<div class="container mt-5">
<div class="container-lg mt-5">
<div class="row">
<div class="col">
<div class="col-md">
<div class="card border-primary">
<div class="card-header">Exercise</div>
<div class="card-body">
<div class="card-body table-responsive">
<table class="table table-borderless">
<form action="/exercise/" method="post">
<input name="id" type="hidden" value="{{ .OneEx.ID }}">
Expand Down Expand Up @@ -52,7 +52,7 @@
</div>
</div>
</div>
<div class="col">
<div class="col-md">
<div class="card border-primary">
<div class="card-header">Image</div>
<div class="card-body">
Expand Down
52 changes: 25 additions & 27 deletions internal/web/templates/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,34 +27,32 @@
{{ end }}
</head>
<body>
<nav class="navbar navbar-expand-sm navbar-dark bg-primary">
<div class="container">
<ul class="navbar-nav">
&nbsp;&nbsp;
<nav class="navbar navbar-expand-md navbar-dark bg-primary">
<div class="container-lg">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link active" href="/">
<img src="data:image/png;base64, {{ .Config.Icon }}" style="width: 2em"/>
</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link active dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown">
<i class="bi bi-list"></i>
</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="/exercise/?id=new">Add Exercise</a></li>
<li><a class="dropdown-item" href="/weight/">Weight</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item" href="/config/">Config</a></li>
<!-- <li><a class="dropdown-item" href="/stats/">Stats</a></li> -->
</ul>
</li>
</ul>
<!-- <ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link active" href="/">
<img src="data:image/png;base64, {{ .Config.Icon }}" width="30"/>
</a>
<a class="nav-link active fs-3 ms-md-2" target="_blank" href="https://github.com/aceberg/ExerciseDiary"><i class="bi bi-github"></i></a>
</li>
&nbsp;&nbsp;
<li class="nav-item dropdown">
<a class="nav-link active dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown">
<i class="bi bi-list"></i>
</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="/exercise/?id=new">Add Exercise</a></li>
<li><a class="dropdown-item" href="/weight/">Weight</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item" href="/config/">Config</a></li>
<!-- <li><a class="dropdown-item" href="/stats/">Stats</a></li> -->
</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="nav-item"><a class="nav-link active" target="_blank" href="https://github.com/aceberg/ExerciseDiary">
<h5><i class="bi bi-github"></i></h5>
</a></li>
</ul>
</ul> -->
</div>
</nav>
</nav>
{{ end }}
48 changes: 29 additions & 19 deletions internal/web/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,27 @@ <h5 class="modal-title">Add weight</h5>
</div>
</div>
<!-- End Modal -->
<div class="container">
<div class="container-lg">
<div class="row">
<div class="col">
<div class="col-md">
<div class="card border-primary">
<div class="card-body">
<div class="hstack gap-2">
<div class="chart-container m-auto">
<canvas id="matrix-chart" style="max-height: 100px; width: 820px;"></canvas>
<!-- <div class="hstack gap-2"> -->
<div class="row justify-content-evenly">
<div class="col-lg-7">
<!-- <div class="chart-container" style="max-width: fit-content;">
<canvas id="matrix-chart" style="max-height: 100px; width: 760px;"></canvas>
</div> -->
<div id="matrix-container" class="chart-container" style="max-height: 100px; width: 1100px;overflow-x: scroll;">
<canvas id="matrix-chart" style="height: 100%; width: 100%;"></canvas>
</div>
<div class="chart-container m-auto">
<canvas id="weight-chart" style="max-height: 100px;"></canvas>
</div>
<div class="m-auto">
<div class="col-md-2">
<div class="chart-container" style="max-width: fit-content">
<canvas id="weight-chart" style="max-height: 100px;"></canvas>
</div>
</div>
<div class="col-sm-1">
<button class="btn del-set-button" title="Add weight" data-bs-toggle="modal" data-bs-target="#mWeight" onclick='setWeightDate()'>
<h4><i class="bi bi-window-plus"></i></h4>
</button>
Expand All @@ -63,7 +71,7 @@ <h4><i class="bi bi-window-plus"></i></h4>
</div>
<br>
<div class="row">
<div class="col">
<div class="col-md">
<div class="accordion">
{{ range $gr, $grID := .GroupMap }}
<div class="accordion-item border-primary">
Expand Down Expand Up @@ -121,7 +129,7 @@ <h5 class="modal-title">{{ .Name }}</h5>
{{ end }}
</div>
</div>
<div class="col">
<div class="col-md">
<div class="card border-primary">
<!-- <div class="card-header">Today</div> -->
<div class="card-body">
Expand All @@ -132,15 +140,17 @@ <h5 class="modal-title">{{ .Name }}</h5>
</div>
<form action="/set/" method="post" name="sets">
<input name="date" type="hidden" id="formDate">
<table class="table table-borderless">
<thead>
<th style="width: 60%;">Name</th>
<th>Weight</th>
<th>Reps</th>
<th></th>
</thead>
<tbody id="todayEx"></tbody>
</table>
<div class="table-responsive">
<table class="table table-borderless">
<thead>
<th class="col-5">Name</th>
<th class="col-3">Weight</th>
<th class="col-3">Reps</th>
<th class="col-1"></th>
</thead>
<tbody id="todayEx"></tbody>
</table>
</div>
<button type="submit" class="btn btn-primary">Save</button>
</form>
</div>
Expand Down
16 changes: 8 additions & 8 deletions internal/web/templates/weight.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
<script src="/fs/public/js/weight-chart.js"></script>
<link rel="stylesheet" type="text/css" href="/fs/public/css/index.css" />
<body>
<div class="container mt-5">
<div class="container-lg mt-5">
<div class="row">
<div class="col-4">
<div class="col-md-4">
<div class="card border-primary">
<div class="card-header">Weight</div>
<div class="card-body">
<div class="card-body table-responsive">
<table class="table table-borderless">
<thead>
<th></th>
<th>Date</th>
<th>Weight</th>
<th>Del</th>
<th class="col-1"></th>
<th class="col-5">Date</th>
<th class="col-5">Weight</th>
<th class="col-1">Del</th>
</thead>
<tbody id="weightList">
</tbody>
Expand All @@ -26,7 +26,7 @@
</div>
</div>
</div>
<div class="col-8">
<div class="col-md-8">
<div class="card border-primary">
<div class="card-header">Chart</div>
<div class="card-body">
Expand Down

0 comments on commit 2bde2d8

Please sign in to comment.