Skip to content

Commit

Permalink
Updates/fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanhogan committed Feb 16, 2016
1 parent f376f0e commit 3eeac93
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 14 deletions.
13 changes: 3 additions & 10 deletions app/scripts/components/handleData.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

window.$ = require('jquery');
var $ = require('jquery');
var handleMainPage = require('./handleMainPage');

function handleData (data, lang) {
var contentEl = document.getElementById('content');
Expand Down Expand Up @@ -34,15 +35,7 @@ function handleData (data, lang) {

$('html').addClass( pageTitle );

if (pageTitle === 'main_page') {
// Assumes thumb size of 100px
var imgSrc = $('#mp-tfa-img img').attr('src').split('/100px')[0].replace('thumb/', ''),
arr = imgSrc.split('/')

arr.splice(arr.length - 1);

$('#mp-tfa-img').css({ 'background-image' : 'url("' + arr.join('/') + '")' });
}
if (pageTitle === 'main_page') handleMainPage();

var titleEl = document.createElement('h1');
titleEl.classList.add('page-title')
Expand Down
24 changes: 24 additions & 0 deletions app/scripts/components/handleMainPage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

const $ = require('jquery');
require('slick-carousel');

function handleMainPage () {
var imgSrc = $('#mp-tfa-img img').attr('src').split('/100px')[0].replace('thumb/', ''),
arr = imgSrc.split('/')

arr.splice(arr.length - 1);
$('#mp-tfa-img').css({ 'background-image' : 'url("' + arr.join('/') + '")' });

$('head').append('<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.5.9/slick.min.css">');

$('#mp-dyk ul').slick({
arrows: false,
autoplay: true,
autoplaySpeed: 5000,
dots: true,
fade: true
});

}

module.exports = handleMainPage;
17 changes: 17 additions & 0 deletions app/styles/_content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,23 @@ html {
line-height: 1.75em;
counter-reset: section;

table.vertical-navbox {
display: none;
}

p:first-of-type {
b {
font-family: "Playfair Display","PT Serif","Lora",Georgia,serif;
}

// &:first-letter {
// font-size: 4em;
// float: left;
// margin: .1667em .05em 0 0;
// font-family: "Playfair Display","PT Serif","Lora",Georgia,serif;
// }
}

h2 {
margin: 0;
counter-increment: section;
Expand Down
51 changes: 48 additions & 3 deletions app/styles/_main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

.container {
padding: 0;
padding-bottom: $padding;
max-width: 100%;
padding-left: $left-column-width;
}
Expand Down Expand Up @@ -177,7 +178,6 @@

#mp-itn, #mp-otd, #mp-dyk {
padding: 2em $padding;
padding-bottom: 0;

i {
display: none;
Expand Down Expand Up @@ -207,10 +207,55 @@
padding-top: 0;
}
}
}

&.hlist li {
.hlist li {
border: 0 !important;
padding: 0;
}
}

#mp-dyk {
ul li {
border: 0 !important;
text-align: center;
padding: 1em !important;
}

ul.slick-dots {
text-align: center;

li {
display: inline-block;
padding: 0 !important;
border: 0;
padding: 0;

button {
position: relative;
display: block;
text-indent: -9999px;
width: 20px;
height: 20px;
overflow: hidden;
padding: 0;
background: transparent;

&:before {
content: '';
position: absolute;
top: 50%;
left: 50%;
margin: -4px;
width: 8px;
height: 8px;
border-radius: 50%;
background: #aaa;
}
}
}

li.slick-active button:before {
background: black;
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
},
"dependencies": {
"fastclick": "^1.0.6",
"jquery": "^2.1.4"
"jquery": "^2.1.4",
"slick-carousel": "^1.5.9"
}
}

0 comments on commit 3eeac93

Please sign in to comment.