Skip to content

Commit

Permalink
video embed shortcode, project single page with meta
Browse files Browse the repository at this point in the history
  • Loading branch information
bak11004 committed Mar 25, 2016
1 parent 29e5575 commit 8b30c98
Show file tree
Hide file tree
Showing 17 changed files with 215 additions and 62 deletions.
11 changes: 11 additions & 0 deletions www/wp-content/themes/ation2016/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@

Timber::$dirname = array('templates', 'views');

/* Controls output of video embed shortcode */
add_shortcode( 'vid_embed', 'video_embed_center' );
function video_embed_center( $atts ) {
$a = shortcode_atts( array(
'src' => null,
), $atts );
$embed_code = wp_oembed_get( $a['src'] );

return Timber::compile( 'video-embed.twig', array( 'src'=>$a['src'], 'embed'=>$embed_code ));
}

class StarterSite extends TimberSite {

function __construct() {
Expand Down
8 changes: 4 additions & 4 deletions www/wp-content/themes/ation2016/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ gulp.task('images', function(){

gulp.task('styles', function(){
gulp.src(['src/styles/site.scss'])
.pipe(sourcemaps.init())
//.pipe(sourcemaps.init())
.pipe(plumber({
errorHandler: function (error) {
console.log(error.message);
Expand All @@ -30,13 +30,13 @@ gulp.task('styles', function(){
.pipe(gulp.dest('static/styles/'))
.pipe(rename({suffix: '.min'}))
.pipe(minifycss())
.pipe(sourcemaps.write())
//.pipe(sourcemaps.write())
.pipe(gulp.dest('static/styles/'))
});

gulp.task('scripts', function(){
return gulp.src('src/scripts/**/*.js')
.pipe(sourcemaps.init())
//.pipe(sourcemaps.init())
.pipe(plumber({
errorHandler: function (error) {
console.log(error.message);
Expand All @@ -47,7 +47,7 @@ gulp.task('scripts', function(){
.pipe(gulp.dest('static/scripts/'))
.pipe(rename({suffix: '.min'}))
.pipe(uglify())
.pipe(sourcemaps.write())
//.pipe(sourcemaps.write())
.pipe(gulp.dest('static/scripts/'))
});

Expand Down
1 change: 0 additions & 1 deletion www/wp-content/themes/ation2016/single.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
$context = Timber::get_context();
$post = Timber::query_post();
$context['post'] = $post;
$context['comment_form'] = TimberHelper::get_comment_form();

if ( post_password_required( $post->ID ) ) {
Timber::render( 'single-password.twig', $context );
Expand Down
14 changes: 0 additions & 14 deletions www/wp-content/themes/ation2016/src/styles/components/_footer.scss
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
footer {
border-top: 1px solid $light-grey;
font-family: $header-font;
.footer-links {
ul {
list-style-type: none;
margin-left: 0;
padding-left: 0;
li {
display: inline-block;
color: $grey;
font-family: inherit;
padding-right: 20px;
}
}
}
}
16 changes: 12 additions & 4 deletions www/wp-content/themes/ation2016/src/styles/components/_header.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
$header-font-size: 25px;

.admin-bar {
header {
top: 32px;
Expand All @@ -8,20 +10,26 @@ header {
color: $orange;
width: 100%;
text-align: center;
font-size: 25px;
height: $header-height;
line-height: $header-height;
background: white;
transition: all 0.3s ease, box-shadow 0s ease;
top:0;
li {
line-height: $header-height;
font-size: $header-font-size;
transition: all 0.3s ease;
}
&.sticky {
font-size: 15px;
height: $header-height-sticky;
line-height: $header-height-sticky;
//text-align: left;
-webkit-box-shadow: -1px 2px 10px -1px $grey;
-moz-box-shadow: -1px 2px 10px -1px $grey;
box-shadow: -1px 2px 10px -1px $grey;
z-index: 1000;
li {
line-height: $header-height-sticky;
font-size: $header-font-size - 10px;
}
.header-logo {
img {
max-height: $header-height-sticky - 20px;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
$work-bar-height: 60px;
$work-bar-box-shadow-color: rgba(168,168,168,0.64);
$work-bar-box-shadow: 0px 4px 15px 0px $work-bar-box-shadow-color;

.work-bar {
background-color: $orange;
color: white;
Expand All @@ -9,9 +12,9 @@ $work-bar-height: 60px;
text-transform: uppercase;
font-family: $header-font;
margin-bottom: 15px;
-webkit-box-shadow: 0px 4px 15px 0px rgba(168,168,168,0.64);
-moz-box-shadow: 0px 4px 15px 0px rgba(168,168,168,0.64);
box-shadow: 0px 4px 15px 0px rgba(168,168,168,0.64);
-webkit-box-shadow: $work-bar-box-shadow;
-moz-box-shadow: $work-bar-box-shadow;
box-shadow: $work-bar-box-shadow;
a, a:hover {
color: inherit;
}
Expand Down
1 change: 1 addition & 0 deletions www/wp-content/themes/ation2016/src/styles/site.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ $header-height-sticky: 70px;
@import 'components/footer';

@import 'utility/images';
@import 'utility/embeds';

body {
background-color: $white;
Expand Down
60 changes: 54 additions & 6 deletions www/wp-content/themes/ation2016/src/styles/type/_typography.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,61 @@
h1, h2, h3, h4, h5, h6 {
$p-font-size: 18px;
$p-color: $grey;

$footer-font-size: 12px;
$footer-link-color: $grey;

$link-color: $orange;


h1, h2, h3, h4, h5, h6, p, li, aside {
font-family: $header-font;
&.grey {
color: $grey;
}
}

h1, h2, h3, h4, h5, h6 {
margin-bottom: 0.7em;
}

p, li, span {
font-family: $body-font;
p {
margin-bottom: 20px;
&:first-of-type {
margin-top: 20px;
}
}

p, li {
color: $p-color;
font-size: $p-font-size;
&.large {
font-size: $p-font-size + 4px;
//margin-top: 1em;
//margin-bottom: 1em;
}
}

a {
color: $link-color;
&:hover {
color: darken( $link-color, 10% );
}
}

#content {
p, li, span {
font-size: 18px;
.footer-links {
ul {
list-style-type: none;
margin: 0;
padding: 0;
li {
display: inline-block;
padding-right: 20px;
color: $p-color;
font-size: $footer-font-size;
line-height: ($footer-font-size * 2) + 12px;
a,a:hover {
color: $footer-link-color;
}
}
}
}
15 changes: 15 additions & 0 deletions www/wp-content/themes/ation2016/src/styles/utility/_embeds.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.video-contain {
position: relative;
padding-bottom: 53%;
padding-top: 30px;
height: 0;
overflow: hidden;

iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions www/wp-content/themes/ation2016/static/scripts/main.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

75 changes: 55 additions & 20 deletions www/wp-content/themes/ation2016/static/styles/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -5757,14 +5757,42 @@ button.close {
/* Color */
/* Type */
/* Header */
h1, h2, h3, h4, h5, h6 {
h1, h2, h3, h4, h5, h6, p, li, aside {
font-family: "Source Sans Pro", sans-serif; }
h1.grey, h2.grey, h3.grey, h4.grey, h5.grey, h6.grey, p.grey, li.grey, aside.grey {
color: #a8a8a8; }

p, li, span {
font-family: "Times New Roman", serif; }
h1, h2, h3, h4, h5, h6 {
margin-bottom: 0.7em; }

#content p, #content li, #content span {
p {
margin-bottom: 20px; }
p:first-of-type {
margin-top: 20px; }

p, li {
color: #a8a8a8;
font-size: 18px; }
p.large, li.large {
font-size: 22px; }

a {
color: #ff7200; }
a:hover {
color: #cc5b00; }

.footer-links ul {
list-style-type: none;
margin: 0;
padding: 0; }
.footer-links ul li {
display: inline-block;
padding-right: 20px;
color: #a8a8a8;
font-size: 12px;
line-height: 36px; }
.footer-links ul li a, .footer-links ul li a:hover {
color: #a8a8a8; }

.admin-bar header {
top: 32px; }
Expand All @@ -5774,17 +5802,21 @@ header {
color: #ff7200;
width: 100%;
text-align: center;
font-size: 25px;
height: 100px;
line-height: 100px;
background: white;
transition: all 0.3s ease, box-shadow 0s ease;
top: 0; }
header li {
line-height: 100px;
font-size: 25px;
transition: all 0.3s ease; }
header.sticky {
font-size: 15px;
height: 70px;
line-height: 70px;
box-shadow: -1px 2px 10px -1px #a8a8a8; }
box-shadow: -1px 2px 10px -1px #a8a8a8;
z-index: 1000; }
header.sticky li {
line-height: 70px;
font-size: 15px; }
header.sticky .header-logo img {
max-height: 50px; }
header .header-logo {
Expand Down Expand Up @@ -5829,22 +5861,25 @@ section#content {
margin-bottom: 10px; }

footer {
border-top: 1px solid #eeeeee;
font-family: "Source Sans Pro", sans-serif; }
footer .footer-links ul {
list-style-type: none;
margin-left: 0;
padding-left: 0; }
footer .footer-links ul li {
display: inline-block;
color: #a8a8a8;
font-family: inherit;
padding-right: 20px; }
border-top: 1px solid #eeeeee; }

img {
max-width: 100%;
display: block;
height: auto; }

.video-contain {
position: relative;
padding-bottom: 53%;
padding-top: 30px;
height: 0;
overflow: hidden; }
.video-contain iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%; }

body {
background-color: white; }
3 changes: 1 addition & 2 deletions www/wp-content/themes/ation2016/static/styles/site.min.css

Large diffs are not rendered by default.

43 changes: 43 additions & 0 deletions www/wp-content/themes/ation2016/templates/single-project.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{% extends "base.twig" %}

{% block content %}

<div class="content-wrapper">
<article class="post-type-{{post.post_type}} container" id="post-{{post.ID}}">
<section class="article-content">
<div class="row">
<div class="col-xs-12">
<h1 class="article-h1 grey">Case Study: {{post.title}}</h1>
</div>
</div>

<div class="row">
<div class="col-xs-12">
{{ post.content }}
</div>
</div>

<div class="row">
<div class="col-xs-12">
<p class="large">Services:
{% for service in post.terms('service') %}
<a href="{{ service.link }}">{{ service.name }}</a>{% if not loop.last %}, {% endif %}
{% endfor %}
</p>
</div>
</div>

<div class="row">
<div class="col-xs-12">
<p class="large">Credits:
{% for member in post.get_field('members') %}
<a href="{{ TimberPost(member).link }}">{{member.post_title}}</a>{% if not loop.last %}, {% endif %}
{% endfor %}
</p>
</div>
</div>
</section>

</article>
</div><!-- /content-wrapper -->
{% endblock %}
Loading

0 comments on commit 8b30c98

Please sign in to comment.