Skip to content

Commit 8a09330

Browse files
arc9693nkprince007
authored andcommitted
Fixes #17:Make the site mobile friendly (#25)
Make the site mobile friendly
1 parent 790d76b commit 8a09330

File tree

6 files changed

+52
-12
lines changed

6 files changed

+52
-12
lines changed

_includes/assets.html

+1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@
44
<!--Scripts-->
55
<script type="text/javascript" src={{ "/js/jquery.min.js" | relative_url }}></script>
66
<script type="text/javascript" src={{ "/js/materialize.min.js" | relative_url }}></script>
7+
<script type="text/javascript" src={{ "/js/main.js" | relative_url }}></script>
78
<script src="https://use.fontawesome.com/d4f41d4038.js"></script>

_includes/footer.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@
99
padding-top: 1%;
1010
padding-bottom: 1%;
1111
margin: 0%;
12-
font-size: 1.4rem;
12+
font-size: 3vh;
1313
}
1414

1515
footer .credits {
1616
margin: 0px;
17-
font-size: 1.2rem;
17+
font-size: 2.8vh;
1818
}
1919

2020
footer .footer-copyright {
21-
font-size: 1.2rem;
21+
font-size: 2.8vh;
2222
font-weight: normal !important;
2323
}
2424
</style>

_includes/header.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<nav class="blue navbar">
33
<div class="row nav-wrapper">
44
<a href="{{ '/' | relative_url }}" class="brand-logo">{{ site.title | escape }}</a>
5-
<a href="#" data-activates="mobile-demo" class="button-collapse"><i class="fa fa-bars"></i></a>
5+
<a href="#" data-activates="mobile-demo" class="button-collapse menu-btn"><i class="fa fa-bars"></i></a>
66
<ul id="nav-mobile" class="right hide-on-med-and-down">
77
{% for page in site.pages %} {% if site.nav contains page.path %}
88
<li><a href="{{ page.url | relative_url }}">{{ page.title | escape }}</a></li>

_layouts/home.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ <h1 class="title">NIT DGP Open Source</h1>
1919
<h2 class="description">{{site.description}}</h2>
2020
</div>
2121
</div>
22-
<div class="page-content center-align">
23-
<div class="main">{{ content }}</div>
22+
<div class="page-content center-align container">
23+
<div class="main col s12 l10">{{ content }}</div>
2424
</div>
2525
</main>
2626
{% include footer.html %}

css/styles.scss

+34-6
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,20 @@ html, body {
4646
}
4747

4848
.page-content {
49-
width: 70%;
5049
margin: auto;
5150
margin-bottom: 5%;
5251

5352
img {
5453
display: block;
55-
width: 75%;
54+
width: 95%;
55+
height:100%;
5656
padding: 2%;
5757
margin: auto;
5858
}
5959

6060
a {
6161
color: limegreen;
62-
font-weight: 700;
62+
font-weight: 500;
6363
border-bottom: 2px solid transparent;
6464
transition: all 0.5s ease;
6565

@@ -73,7 +73,7 @@ html, body {
7373
}
7474

7575
p {
76-
font-size: 22px;
76+
font-size: 3.2vh;
7777
display: inline-block;
7878
margin-top: 10px;
7979
}
@@ -88,15 +88,15 @@ html, body {
8888
code {
8989
font-family: 'Roboto Mono', monospace;
9090
color: yellow;
91-
font-size: 1.2rem;
91+
font-size: 3.2vh;
9292
}
9393
}
9494

9595
ul, ol {
9696
text-align: left;
9797

9898
li {
99-
font-size: 22px;
99+
font-size: 3.2vh;
100100
width: 95%;
101101
margin: auto;
102102
margin-top: 10px;
@@ -107,3 +107,31 @@ html, body {
107107
}
108108
}
109109
}
110+
111+
.navbar-fixed {
112+
z-index: 998 !important;
113+
}
114+
115+
h1 {
116+
font-size: 3em;
117+
}
118+
119+
h2 {
120+
font-size: 2.5em;
121+
}
122+
123+
h3 {
124+
font-size: 2em;
125+
}
126+
127+
h4 {
128+
font-size: 1.5em;
129+
}
130+
131+
h5 {
132+
font-size: 1em;
133+
}
134+
135+
h6 {
136+
font-size: 0.8em;
137+
}

js/main.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
(function($) {
2+
$(function() {
3+
4+
$('.menu-btn').sideNav({
5+
edge: 'left', // Choose the horizontal origin
6+
closeOnClick: true, // Closes side-nav on <a> clicks
7+
draggable: true // Choose whether you can drag to open on touch screens
8+
});
9+
10+
}); // end of document ready
11+
})(jQuery); // end of jQuery name space

0 commit comments

Comments
 (0)