summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Light <samlight1994@gmail.com>2025-04-02 00:04:42 +0100
committerSam Light <samlight1994@gmail.com>2025-04-02 00:04:42 +0100
commit233f0a22aff8cbf5aa11d9fc7926814a484ef8e9 (patch)
treed5bb2f5d2f8aab50ccf1bf1adff5f093df939f9c
parent719b4a30f9533c9683ec2da61338ec4a9a2d177c (diff)
Created icons for sorting
-rw-r--r--public/01c353b6ecdc71871ffc.svg23
-rw-r--r--public/9b267c666a977edd63c6.svg28
-rw-r--r--public/assets-manifest.json6
-rw-r--r--public/caaf53846ec958e9b63d.svg23
-rw-r--r--public/css/main.0de28bdb.css1
-rw-r--r--resources/scss/main.scss38
-rw-r--r--resources/svg/sortable-down.svg23
-rw-r--r--resources/svg/sortable-up.svg23
-rw-r--r--resources/svg/sortable.svg28
-rw-r--r--resources/views/table.blade.php17
10 files changed, 205 insertions, 5 deletions
diff --git a/public/01c353b6ecdc71871ffc.svg b/public/01c353b6ecdc71871ffc.svg
new file mode 100644
index 0000000..9dae1ef
--- /dev/null
+++ b/public/01c353b6ecdc71871ffc.svg
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ width="150.76077"
+ height="199.67154"
+ viewBox="0 0 39.888787 52.829761"
+ version="1.1"
+ id="svg1"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:svg="http://www.w3.org/2000/svg">
+ <defs
+ id="defs1" />
+ <g
+ id="layer1"
+ transform="translate(-6.5139393,-0.00342273)">
+ <path
+ style="fill:#000000;stroke:#000000;stroke-width:0.264583"
+ id="path1"
+ d="m 20.455914,9.8688898 -10.300609,0 5.150305,-8.92058944 z"
+ transform="matrix(3.707522,0,0,2.2368556,-30.287552,-1.5259543)" />
+ </g>
+</svg>
diff --git a/public/9b267c666a977edd63c6.svg b/public/9b267c666a977edd63c6.svg
new file mode 100644
index 0000000..eb177ef
--- /dev/null
+++ b/public/9b267c666a977edd63c6.svg
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ width="150.76077"
+ height="199.67154"
+ viewBox="0 0 39.888787 52.829761"
+ version="1.1"
+ id="svg1"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:svg="http://www.w3.org/2000/svg">
+ <defs
+ id="defs1" />
+ <g
+ id="layer1"
+ transform="translate(-6.5139393,-0.00342273)">
+ <path
+ style="fill:#000000;stroke:#000000;stroke-width:0.264583"
+ id="path1"
+ d="m 20.455914,9.8688898 -10.300609,0 5.150305,-8.92058944 z"
+ transform="matrix(3.707522,0,0,2.2368556,-30.287552,-1.5259543)" />
+ <path
+ style="fill:#000000;stroke:#000000;stroke-width:0.264583"
+ id="path1-5"
+ d="m 20.455914,9.8688898 -10.300609,0 5.150305,-8.92058944 z"
+ transform="matrix(3.6945189,0,0,-2.1968419,-30.088531,54.335204)" />
+ </g>
+</svg>
diff --git a/public/assets-manifest.json b/public/assets-manifest.json
new file mode 100644
index 0000000..8dd26ed
--- /dev/null
+++ b/public/assets-manifest.json
@@ -0,0 +1,6 @@
+{
+ "css/main.css": "css/main.0de28bdb.css",
+ "sortable-down.svg": "caaf53846ec958e9b63d.svg",
+ "sortable-up.svg": "01c353b6ecdc71871ffc.svg",
+ "sortable.svg": "9b267c666a977edd63c6.svg"
+} \ No newline at end of file
diff --git a/public/caaf53846ec958e9b63d.svg b/public/caaf53846ec958e9b63d.svg
new file mode 100644
index 0000000..d4d5d19
--- /dev/null
+++ b/public/caaf53846ec958e9b63d.svg
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ width="150.76077"
+ height="199.67154"
+ viewBox="0 0 39.888787 52.829761"
+ version="1.1"
+ id="svg1"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:svg="http://www.w3.org/2000/svg">
+ <defs
+ id="defs1" />
+ <g
+ id="layer1"
+ transform="translate(-6.5139393,-0.00342273)">
+ <path
+ style="fill:#000000;stroke:#000000;stroke-width:0.264583"
+ id="path1-5"
+ d="m 20.455914,9.8688898 -10.300609,0 5.150305,-8.92058944 z"
+ transform="matrix(3.6945189,0,0,-2.1968419,-30.088531,54.335204)" />
+ </g>
+</svg>
diff --git a/public/css/main.0de28bdb.css b/public/css/main.0de28bdb.css
new file mode 100644
index 0000000..d09951b
--- /dev/null
+++ b/public/css/main.0de28bdb.css
@@ -0,0 +1 @@
+th .ordered{display:flex;justify-content:space-between;align-items:center;cursor:pointer}th .ordered::after{display:block;content:"";width:13px;height:16px;opacity:.5;background-image:url(../9b267c666a977edd63c6.svg);background-size:contain;background-position:center;background-repeat:no-repeat}th .ordered:hover::after{opacity:1}th .ordered-asc::after,th .ordered-desc::after{opacity:1}th .ordered-asc::after{background-image:url(../caaf53846ec958e9b63d.svg)}th .ordered-desc::after{background-image:url(../01c353b6ecdc71871ffc.svg)}
diff --git a/resources/scss/main.scss b/resources/scss/main.scss
index e69de29..1ba548e 100644
--- a/resources/scss/main.scss
+++ b/resources/scss/main.scss
@@ -0,0 +1,38 @@
+th {
+ .ordered {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ cursor: pointer;
+
+ &::after {
+ display: block;
+ content: "";
+ width: 13px;
+ height: 16px;
+ opacity: 0.5;
+ background-image: url('../svg/sortable.svg');
+ background-size: contain;
+ background-position: center;
+ background-repeat: no-repeat;
+ }
+
+ &:hover::after {
+ opacity: 1;
+ }
+ }
+
+ .ordered-asc::after,
+ .ordered-desc::after
+ {
+ opacity: 1;
+ }
+
+ .ordered-asc::after {
+ background-image: url('../svg/sortable-down.svg');
+ }
+
+ .ordered-desc::after {
+ background-image: url('../svg/sortable-up.svg');
+ }
+}
diff --git a/resources/svg/sortable-down.svg b/resources/svg/sortable-down.svg
new file mode 100644
index 0000000..d4d5d19
--- /dev/null
+++ b/resources/svg/sortable-down.svg
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ width="150.76077"
+ height="199.67154"
+ viewBox="0 0 39.888787 52.829761"
+ version="1.1"
+ id="svg1"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:svg="http://www.w3.org/2000/svg">
+ <defs
+ id="defs1" />
+ <g
+ id="layer1"
+ transform="translate(-6.5139393,-0.00342273)">
+ <path
+ style="fill:#000000;stroke:#000000;stroke-width:0.264583"
+ id="path1-5"
+ d="m 20.455914,9.8688898 -10.300609,0 5.150305,-8.92058944 z"
+ transform="matrix(3.6945189,0,0,-2.1968419,-30.088531,54.335204)" />
+ </g>
+</svg>
diff --git a/resources/svg/sortable-up.svg b/resources/svg/sortable-up.svg
new file mode 100644
index 0000000..9dae1ef
--- /dev/null
+++ b/resources/svg/sortable-up.svg
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ width="150.76077"
+ height="199.67154"
+ viewBox="0 0 39.888787 52.829761"
+ version="1.1"
+ id="svg1"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:svg="http://www.w3.org/2000/svg">
+ <defs
+ id="defs1" />
+ <g
+ id="layer1"
+ transform="translate(-6.5139393,-0.00342273)">
+ <path
+ style="fill:#000000;stroke:#000000;stroke-width:0.264583"
+ id="path1"
+ d="m 20.455914,9.8688898 -10.300609,0 5.150305,-8.92058944 z"
+ transform="matrix(3.707522,0,0,2.2368556,-30.287552,-1.5259543)" />
+ </g>
+</svg>
diff --git a/resources/svg/sortable.svg b/resources/svg/sortable.svg
new file mode 100644
index 0000000..eb177ef
--- /dev/null
+++ b/resources/svg/sortable.svg
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ width="150.76077"
+ height="199.67154"
+ viewBox="0 0 39.888787 52.829761"
+ version="1.1"
+ id="svg1"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:svg="http://www.w3.org/2000/svg">
+ <defs
+ id="defs1" />
+ <g
+ id="layer1"
+ transform="translate(-6.5139393,-0.00342273)">
+ <path
+ style="fill:#000000;stroke:#000000;stroke-width:0.264583"
+ id="path1"
+ d="m 20.455914,9.8688898 -10.300609,0 5.150305,-8.92058944 z"
+ transform="matrix(3.707522,0,0,2.2368556,-30.287552,-1.5259543)" />
+ <path
+ style="fill:#000000;stroke:#000000;stroke-width:0.264583"
+ id="path1-5"
+ d="m 20.455914,9.8688898 -10.300609,0 5.150305,-8.92058944 z"
+ transform="matrix(3.6945189,0,0,-2.1968419,-30.088531,54.335204)" />
+ </g>
+</svg>
diff --git a/resources/views/table.blade.php b/resources/views/table.blade.php
index 448a290..ec2cd25 100644
--- a/resources/views/table.blade.php
+++ b/resources/views/table.blade.php
@@ -11,12 +11,19 @@
@foreach($columns as $column)
<th
scope="col"
- @class(['sortable' => $column->isSortable()])
- @if($column->isSortable())
- wire:click="orderBy('{{ $column->name }}')"
- @endif
>
- {{ $column->getTitle() }}
+ <div
+ @class([
+ 'ordered' => $column->isSortable(),
+ 'ordered-asc' => $column->name === $order && $orderDirection === 'asc',
+ 'ordered-desc' => $column->name === $order && $orderDirection === 'desc',
+ ])
+ @if($column->isSortable())
+ wire:click="orderBy('{{ $column->name }}')"
+ @endif
+ >
+ {{ $column->getTitle() }}
+ </div>
</th>
@endforeach
</tr>