Skip to content
This repository was archived by the owner on Aug 22, 2024. It is now read-only.

Commit 378a091

Browse files
author
Brandon Brown
committed
Some tweaks for mobile first
1 parent ca958be commit 378a091

File tree

5 files changed

+68
-32
lines changed

5 files changed

+68
-32
lines changed

_assets/styles/site.less

+32-17
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
@import 'skeleton.less';
66

7+
@mobile-width: 550px;
8+
79

810
// Main Site CSS
911

@@ -78,7 +80,7 @@
7880
}
7981

8082
// Restrict site width larger than mobile
81-
@media (min-width: 550px) {
83+
@media (min-width: @mobile-width) {
8284
.main-header,
8385
.main-footer,
8486
.main-content-feed,
@@ -103,7 +105,7 @@
103105
.margin-lr;
104106
}
105107

106-
@media (min-width: 550px) {
108+
@media (min-width: @mobile-width) {
107109
.main-header-title,
108110
.main-header-description,
109111
.main-header-nav,
@@ -141,7 +143,7 @@
141143
.navigation-item;
142144
}
143145

144-
@media (min-width: 550px) {
146+
@media (min-width: @mobile-width) {
145147
.main-header-image {
146148
height: 16rem;
147149
}
@@ -215,6 +217,20 @@
215217
}
216218
}
217219

220+
.page-title,
221+
.page-subtitle {
222+
display: inline;
223+
}
224+
225+
.page-title {
226+
227+
}
228+
229+
.page-subtitle {
230+
font-size: 80%;
231+
color: #666;
232+
}
233+
218234
// Main footer
219235
.main-footer {
220236
.u-text-center;
@@ -242,7 +258,7 @@
242258
transition: opacity .2s ease;
243259
}
244260

245-
@media (min-width: 550px) {
261+
@media (min-width: @mobile-width) {
246262
#checkin_map {
247263
height: 60rem;
248264
margin-top: 4rem;
@@ -256,26 +272,18 @@
256272
margin-left: -2rem;
257273
margin-right: -2rem;
258274
transition: opacity .2s ease;
259-
260-
display: flex;
261-
flex-wrap: wrap;
262-
justify-content: space-between;
263275
}
264276

265277
.instagram-post {
266-
width: calc(50% - 4rem);
267-
margin-right: 2rem;
268-
margin-bottom: 2rem;
269-
border-radius: .3rem;
278+
270279
}
271280

272281
.instagram-link {
273282
display: inline-block;
274-
height: 100%;
275283
}
276284

277285
.instagram-image {
278-
286+
width: 100vw;
279287
}
280288

281289
.instagram-caption {
@@ -289,9 +297,16 @@
289297

290298
}
291299

292-
293-
@media (min-width: 550px) {
300+
@media (min-width: @mobile-width) {
294301
#instagram_images {
295-
margin-top: 4rem;
302+
display: flex;
303+
flex-wrap: wrap;
304+
justify-content: space-between;
305+
}
306+
307+
.instagram-post {
308+
width: calc(50% - 4rem);
309+
margin-right: 2rem;
310+
margin-bottom: 2rem;
296311
}
297312
}

_includes/foot.html

+26-12
Original file line numberDiff line numberDiff line change
@@ -105,18 +105,32 @@
105105
var images_div = document.getElementById('instagram_images')
106106

107107
for (var imageId in results) {
108-
var imageItem = results[imageId]
109-
caption = imageItem.caption.replace(/\S*#(\S+)/gi, '<a href="https://instagram.com/explore/tags/$1" class="instagram-tag">#$1</a>')
110-
111-
images_div.innerHTML += ' \
112-
<div class="instagram-post"> \
113-
<a href="' + imageItem.url + '" class="instagram-link"> \
114-
<img src="' + imageItem.image + '" class="instagram-image" /> \
115-
</a> \
116-
<div class="instagram-caption"> \
117-
' + caption + ' \
118-
</div> \
119-
</div>'
108+
var data = results[imageId]
109+
caption = data.caption.replace(/\S*#(\S+)/gi, '<a href="https://instagram.com/explore/tags/$1" class="instagram-tag">#$1</a>')
110+
111+
if (data.type === 'image') {
112+
images_div.innerHTML += ' \
113+
<div class="instagram-post"> \
114+
<a href="' + data.url + '" class="instagram-link"> \
115+
<img src="' + data.image + '" class="instagram-image" /> \
116+
</a> \
117+
<div class="instagram-caption"> \
118+
' + caption + ' \
119+
</div> \
120+
</div>'
121+
}
122+
// TODO: UNTESTED!
123+
// else if (data.type === 'video') {
124+
// images_div.innerHTML += ' \
125+
// <div class="instagram-post"> \
126+
// <video width="480" height="480" controls> \
127+
// <source src="' + data.video + '" type="video/mp4"/> \
128+
// </video> \
129+
// <div class="instagram-caption"> \
130+
// ' + caption + ' \
131+
// </div> \
132+
// </div>'
133+
// }
120134
}
121135

122136
images_div.style.opacity = '1.0'

_layouts/page.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
---
44

55
<article class="main-content-page">
6-
<h2>
6+
<h2 class="page-title">
77
{{ page.title }}
88
</h2>
99

_pages/mk7-gti.html

+3
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,8 @@
55
include_in_nav: false
66
---
77

8+
<h5 class="page-subtitle">
9+
Powered by <a href="https://instagram.com/_vigti/">Instagram</a>
10+
</h5>
811

912
<div id="instagram_images" style="opacity:0;"></div>

gulp_tasks/tasks/instagram.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,21 @@ const buildJSON = (buildPath, callback) => {
4242
for (let item of response.data) {
4343
if (item.type === 'image') {
4444
imageItems[item.id] = {
45+
type: item.type,
4546
url: item.link,
4647
image: item.images.standard_resolution.url,
48+
height: item.images.standard_resolution.height,
49+
width: item.images.standard_resolution.width,
4750
caption: item.caption.text,
4851
tags: item.tags,
4952
likes: item.likes.count,
5053
}
5154
}
52-
else if (item.type === 'image') {
55+
else if (item.type === 'video') {
5356
imageItems[item.id] = {
57+
type: item.type,
5458
url: item.link,
55-
image: item.videos.standard_resolution.url,
59+
video: item.videos.standard_resolution.url,
5660
caption: item.caption.text,
5761
tags: item.tags,
5862
likes: item.likes.count,

0 commit comments

Comments
 (0)