Skip to content

Commit 6692d54

Browse files
committed
Improve use cases navigation
1 parent 7ebc5ed commit 6692d54

File tree

5 files changed

+58
-12
lines changed

5 files changed

+58
-12
lines changed

_data/use-cases.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,32 @@
11
- id: smart-energy
22
title: Smart Energy
33
link: /smart-energy/
4+
icon: /images/case-eng-icon.svg
45
- id: smart-farming
56
title: Smart Farming
67
link: /smart-farming/
8+
icon: /images/case-fam-icon.svg
79
- id: fleet-tracking
810
title: Fleet Tracking
911
link: /fleet-tracking/
12+
icon: /images/case-trk-icon.svg
1013
- id: smart-metering
1114
title: Smart Metering
1215
link: /smart-metering/
16+
icon: /images/case-met-icon.svg
1317
- id: environment-monitoring
1418
title: Environment Monitoring
1519
link: /use-cases/environment-monitoring/
20+
icon: /images/case-env-icon.svg
1621
- id: smart-office
1722
title: Smart Office
1823
link: /use-cases/smart-office/
24+
icon: /images/case-off-icon.svg
1925
- id: water-metering
2026
title: Water Metering
2127
link: /use-cases/water-metering/
28+
icon: /images/case-wat-icon.svg
2229
- id: smart-retail
2330
title: Smart Retail
2431
link: /use-cases/smart-retail/
32+
icon: /images/case-ret-icon.svg

_includes/usecase-nav.html

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,36 @@
22
<div class="crop-nav">
33
<ul>
44
{% for usecase in site.data.use-cases %}
5-
<li><a href="{{usecase.link}}" class="{% if usecase.id == include.usecase %}active{% endif %}">{{usecase.title}}</a></li>
5+
<li><a href="{{usecase.link}}" class="{% if usecase.id == include.usecase %}active{% endif %}"><img src="{{usecase.icon}}">{{usecase.title}}</a></li>
66
{% endfor %}
77
</ul>
88
</div>
99
</nav>
10+
<script type="text/javascript">
11+
document.querySelector('.crop-nav ul li a.active').parentElement.scrollIntoView();
12+
jqueryDefer(function () {
13+
$( document ).ready(function() {
14+
var x,left,down;
15+
16+
$('.crop-nav').mousedown(function(e){
17+
e.preventDefault();
18+
down = true;
19+
x = e.pageX;
20+
left = $(this).scrollLeft();
21+
$('.crop-nav').css('cursor', 'grabbing');
22+
});
23+
24+
$('body').mousemove(function(e){
25+
if(down){
26+
var newX = e.pageX;
27+
$('.crop-nav').scrollLeft(left - newX + x);
28+
}
29+
});
30+
31+
$('body').mouseup(function(e){
32+
down = false;
33+
$('.crop-nav').css('cursor', 'grab');
34+
});
35+
});
36+
});
37+
</script>

_includes/usecase-nav.sass

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#docsContent
22
.usecase-nav
3-
display: flex
43
margin-bottom: 56px
54
z-index: 2
65
position: fixed
@@ -15,8 +14,9 @@
1514
.crop-nav
1615
overflow-x: auto
1716
display: flex
18-
width: 100%
1917
margin: 0 30px
18+
cursor: grab
19+
+tiny-scrollbar(4px)
2020
ul
2121
flex-wrap: unset
2222
display: flex
@@ -26,31 +26,40 @@
2626
position: relative
2727
display: block
2828
align-items: center
29+
padding: 8px 36px 8px 0
2930
margin: 0
30-
margin-right: 28px
3131
float: left
3232
width: max-content
3333
a
3434
color: rgba(33,37,41, 0.6)
3535
text-decoration: none
3636
font-size: 18px
3737
font-weight: 400
38+
img
39+
padding-right: 10px
40+
width: 40px
41+
height: 40px
42+
filter: grayscale(1)
3843
&:hover
3944
color: #212529
45+
img
46+
filter: grayscale(1) brightness(0.75) contrast(2)
4047
&.active
4148
color: #2A7DEC
4249
font-weight: 500
50+
img
51+
filter: unset
4352
&:last-child
44-
margin: 0
53+
padding: 8px 0
4554

4655
@media screen and (min-width: 1025px)
4756
#docsContent
4857
.usecase-nav
4958
.crop-nav
5059
max-width: 1200px
60+
margin: auto
5161
ul
52-
display: unset
53-
flex-wrap: wrap
62+
flex-wrap: unset
5463

5564
@media screen and (min-width: 1500px)
5665
#docsContent

_sass/_reset.sass

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,10 @@ a
6969
&:-ms-input-placeholder
7070
@content
7171

72-
=tiny-scrollbar
72+
=tiny-scrollbar($size: 6px)
7373
&::-webkit-scrollbar
74-
width: 6px
74+
width: $size
75+
height: $size
7576
&::-webkit-scrollbar-track
7677
background: #f1f1f1
7778
&::-webkit-scrollbar-thumb

use-cases/use-cases.sass

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
font-weight: 500
2020
line-height: 54px
2121
width: 100%
22-
margin: 60px 0 56px
22+
margin: 80px 0 56px
2323
padding: 0
2424

2525
#usecase-list
@@ -41,7 +41,7 @@
4141
width: 100%
4242
order: 2
4343
overflow: hidden
44-
box-shadow: -8px 8px 15px rgba(0, 0, 0, 0.15), -12px 12px 40px rgba(0, 0, 0, 0.15)
44+
box-shadow: 0 30px 50px -20px rgba(0, 0, 0, 0.15), 0 0 30px 0 rgba(0, 0, 0, 0.05)
4545
border-radius: 6px
4646
.item-description
4747
width: 100%
@@ -270,7 +270,7 @@
270270
right: 789px
271271
border: 4px solid #305680
272272
&.usecase-big-bg1
273-
top: -1180px
273+
top: -890px
274274
width: 2560px
275275
height: 845px
276276
left: -1280px

0 commit comments

Comments
 (0)