Skip to content

Commit

Permalink
Add uncss
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianchinghc committed Jun 4, 2016
1 parent 4378c9c commit b156b98
Show file tree
Hide file tree
Showing 13 changed files with 126 additions and 60 deletions.
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,11 @@
# Ignore bower components
/bower_components

# Ignore node modules
/node_modules

# Ignore ruby-version
.ruby-version
.ruby-version

# Ignore logs
*.log
3 changes: 1 addition & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ruby '2.2.4'

gem 'dotenv'

gem 'middleman', '~>3.3.10'
gem 'middleman', '~>3.4.0'
gem 'middleman-blog'
gem 'middleman-livereload', '~> 3.1.0'
gem 'middleman-minify-html'
Expand Down Expand Up @@ -43,4 +43,3 @@ gem 'pry'
gem 'wdm', '~> 0.1.0', :platforms => [:mswin, :mingw]
# Windows does not come with time zone data
gem 'tzinfo-data', platforms: [:mswin, :mingw]

55 changes: 30 additions & 25 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (4.1.15)
i18n (~> 0.6, >= 0.6.9)
activesupport (4.2.6)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.3.8)
autoprefixer-rails (6.3.6.1)
autoprefixer-rails (6.3.6.2)
execjs
bourbon (4.2.7)
sass (~> 3.4)
thor (~> 0.19)
builder (3.2.2)
celluloid (0.16.0)
timers (~> 4.0.0)
capybara (2.4.4)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (~> 2.0)
chunky_png (1.3.5)
coderay (1.1.1)
coffee-script (2.4.1)
Expand Down Expand Up @@ -47,7 +51,6 @@ GEM
haml (4.0.7)
tilt
hike (1.2.3)
hitimes (1.2.4)
hooks (0.4.1)
uber (~> 0.0.14)
htmlcompressor (0.2.0)
Expand All @@ -68,19 +71,18 @@ GEM
json (1.8.3)
kramdown (1.11.1)
libv8 (3.16.14.15)
listen (2.10.1)
celluloid (~> 0.16.0)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
listen (3.0.8)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
method_source (0.8.2)
middleman (3.3.12)
middleman (3.4.1)
coffee-script (~> 2.2)
compass (>= 1.0.0, < 2.0.0)
compass-import-once (= 1.0.5)
execjs (~> 2.0)
haml (>= 4.0.5)
kramdown (~> 1.2)
middleman-core (= 3.3.12)
middleman-core (= 3.4.1)
middleman-sprockets (>= 3.1.2)
sass (>= 3.4.0, < 4.0)
uglifier (~> 2.5)
Expand All @@ -91,16 +93,16 @@ GEM
addressable (~> 2.3.5)
middleman-core (~> 3.2)
tzinfo (>= 0.3.0)
middleman-core (3.3.12)
activesupport (~> 4.1.0)
middleman-core (3.4.1)
activesupport (~> 4.1)
bundler (~> 1.1)
capybara (~> 2.4.4)
erubis
hooks (~> 0.3)
i18n (~> 0.7.0)
listen (>= 2.7.9, < 3.0)
listen (~> 3.0.3)
padrino-helpers (~> 0.12.3)
rack (>= 1.4.5, < 2.0)
rack-test (~> 0.6.2)
thor (>= 0.15.2, < 2.0)
tilt (~> 1.4.1, < 2.0)
middleman-deploy (1.0.0)
Expand Down Expand Up @@ -131,6 +133,9 @@ GEM
sprockets (~> 2.12.1)
sprockets-helpers (~> 1.1.0)
sprockets-sass (~> 1.3.0)
mime-types (3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mini_portile2 (2.0.0)
minitest (5.9.0)
multi_json (1.12.1)
Expand All @@ -139,12 +144,12 @@ GEM
net-ssh (3.1.1)
nokogiri (1.6.7.2)
mini_portile2 (~> 2.0.0.rc2)
oj (2.15.0)
padrino-helpers (0.12.6)
oj (2.15.1)
padrino-helpers (0.12.7)
i18n (~> 0.6, >= 0.6.7)
padrino-support (= 0.12.6)
padrino-support (= 0.12.7)
tilt (~> 1.4.1)
padrino-support (0.12.6)
padrino-support (0.12.7)
activesupport (>= 3.1)
progress (3.1.1)
pry (0.10.3)
Expand Down Expand Up @@ -189,14 +194,14 @@ GEM
thor (0.19.1)
thread_safe (0.3.5)
tilt (1.4.1)
timers (4.0.4)
hitimes
tzinfo (1.2.2)
thread_safe (~> 0.1)
uber (0.0.15)
uglifier (2.7.2)
execjs (>= 0.3.0)
json (>= 1.8.0)
xpath (2.0.0)
nokogiri (~> 1.3)

PLATFORMS
ruby
Expand All @@ -205,7 +210,7 @@ DEPENDENCIES
bourbon
builder
dotenv
middleman (~> 3.3.10)
middleman (~> 3.4.0)
middleman-autoprefixer
middleman-blog
middleman-deploy (~> 1.0)
Expand All @@ -229,4 +234,4 @@ RUBY VERSION
ruby 2.2.4p230

BUNDLED WITH
1.12.4
1.12.5
9 changes: 5 additions & 4 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
task default: %w[build]

desc 'Build the app and throw it into secret_sauce_api'
task :build do
desc 'Build the app and throw it into github'
task :deploy do
sh 'rm -rf build'
sh 'middleman build'
sh 'bundle exec middleman build'
sh 'gulp buildcss'
sh 'bundle exec middleman deploy'
end

17 changes: 17 additions & 0 deletions bin/middleman
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
#
# This file was generated by Bundler.
#
# The application 'middleman' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require "pathname"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)

require "rubygems"
require "bundler/setup"

load Gem.bin_path("middleman-core", "middleman")
2 changes: 1 addition & 1 deletion config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
activate :deploy do |deploy|
deploy.method = :git
deploy.branch = 'master'
deploy.build_before = true
deploy.build_before = false
end

Time.zone = "Kuala Lumpur"
Expand Down
18 changes: 18 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
var gulp = require('gulp'); // core gulp
var uncss = require('gulp-uncss'); // removes unused css
var csso = require('gulp-csso'); // minify css
var gzip = require('gulp-gzip'); // gzip compression

gulp.task('uncss', function() {
return gulp.src('build/assets/stylesheets/*.css')
.pipe(uncss({
html: ['build/**/*.html', 'build/*.html']
}))
.pipe(csso())
.pipe(gulp.dest('./build/assets/stylesheets'))
.pipe(gzip())
.pipe(gulp.dest('./build/assets/stylesheets'));
});

// Scan site, remove unused css
gulp.task('buildcss', ['uncss']);
23 changes: 23 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "adrianching.com",
"version": "1.0.0",
"description": "Personal Site of Adrian Ching",
"main": "gulpfile.js",
"dependencies": {},
"devDependencies": {
"gulp": "",
"gulp-uncss": "",
"gulp-csso": "",
"gulp-gzip": ""
},
"repository": {
"type": "git",
"url": "https://github.com/adrianchinghc/adrianchinghc.github.io.git"
},
"author": "Adrian Ching",
"license": "ISC",
"bugs": {
"url": "https://github.com/adrianchinghc/adrianchinghc.github.io/issues"
},
"homepage": "https://github.com/adrianchinghc/adrianchinghc.github.io#readme"
}
Binary file removed source/assets/images/blog/dribbble-image.png
Binary file not shown.
30 changes: 5 additions & 25 deletions source/blog.slim
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,18 @@ body.body-container
.container
.row
.widget.cats-widget.span4
h3 Categories
h3 Categories
=page_classes
.widget-content
ul
- blog.tags.each do |tag|
li
= link_to tag.first.capitalize, tag_path("#{tag.first}")
span = tag.last.count
.widget.span4
h3 Twitter
.widget.span8
h3 Subscribe to My Private Newsletter
.widget-content
.twitter-container
.tweet
p
| The State of
span.custom #WordPress
| Themes: 87% of all WordPress theme shops sell themes on Themeforest
a.custom href="#" http://supportdash.com/wordpress
.tweet
p
| What Are The Most Inspiring Markepplace Moments Of ALl Time
a.custom href="#" http://enva.to/1vgh5d
.tweet
p
| Our server maintenance is now done, so Envato Support should be working as normal now. If you see any problems please tweet
span.custom @envato_support
.widget.span4
h3 Dribbble
.widget-content
a.dribbble-image href="#"
img alt=("Latest Dribbble Project") src="../assets/images/blog/dribbble-image.png" /
= partial "layouts/partials/header_option_form"
header#header.header
.container
.row
Expand All @@ -51,8 +33,6 @@ body.body-container
ul
li.toggle
a href="#" Menu
/ li
/ a href="/" Home
li
a href="/blog" Blog
/ li
Expand Down
2 changes: 1 addition & 1 deletion source/layouts/layout.slim
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ html itemscope='' itemtype='http://schema.org/WebPage' lang=data.site.language
- if page_classes == 'index'
style
| .scroll_down,body{text-align:center}.navigation ul,ul{list-style:none}a,body,div,h1,h2,header,html,i,li,nav,span,ul{margin:0;padding:0;border:0;font:inherit;vertical-align:baseline}header,nav{display:block}body{line-height:1;background:#fff;font:300 14px 'Open Sans',sans-serif;color:#999}.navigation ul li a,h1,h2{font-family:Montserrat,sans-serif;text-transform:uppercase}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}a{color:#a67d4a;text-decoration:none}.container_small{width:100%;margin:0 auto;max-width:900px}.fade-in{opacity:0}#welcome{background:url(../assets/images/adrianching-cover.png) center no-repeat;background-size:cover;width:100%;height:100vh;position:relative}.fade{background:rgba(17,17,17,.4);width:100%;height:100%}.header_title{color:#fff;font-size:30px;letter-spacing:6px;margin:0 0 20px}.header_subtitle{color:#a67d4a;font-size:14px;letter-spacing:6px}.scroll_down{width:100%;position:absolute;bottom:25px;color:#fff}.parent{display:table}.child{display:table-cell;vertical-align:middle}.burger{position:fixed;top:50px;left:50px;height:40px;width:40px;z-index:100}.burger span{background:#a67d4a;border:none;height:2px;width:100%;position:absolute;top:10px;left:0}.burger span:nth-of-type(2){top:20px}.burger span:nth-of-type(3){top:30px}.navigation{position:fixed;top:0;left:0;width:100%;height:100vh;opacity:1;visibility:hidden;z-index:50}.navigation:before{content:'';background:#111;left:-105%;top:0;width:100%;height:100vh;position:absolute}.navigation nav,.navigation ul,.navigation ul li{position:relative}.navigation ul{display:inline-block;margin:20vh 0 0;padding:0;height:60vh}.navigation ul li{display:block;opacity:0;height:20vh;line-height:20vh}.navigation ul li a{font-size:24px;letter-spacing:6px}.simple_line{background:#252525;position:absolute;bottom:0;left:calc(50% - 25px);width:50px;height:1px}@media (max-width:768px){.burger{top:25px;left:25px;height:35px;width:35px}}
- elsif page_classes == 'blog'
- elsif page_classes == 'blog blog_index'
style
| .widget ul,header .logo{float:left;clear:both}.widget .dribbble-image,nav.menu ul li{position:relative}li a,nav,ul{font-family:Lato,sans-serif;font-weight:400;color:#636467;font-size:16px}.blog h3{font-family:Lato,sans-serif;font-weight:700;text-decoration:none;padding:0;margin-top:0;line-height:100%;font-size:18px!important}.tweet a,span.custom{color:#a67d4a!important}header .toggleSidebar{background-color:#a67d4a}body.blog{background:#f2f2f2}section.top-sidebar{padding-top:50px;padding-bottom:50px;background:#343434;width:100%;display:none}section.top-sidebar h3{color:#fff;text-transform:uppercase}section.top-sidebar .widget>h3{margin-bottom:25px}section.top-sidebar p,section.top-sidebar span,section.top-sidebar ul{color:#b0b0b0;font-size:14px}.widget.cats-widget.span4,.widget.span4{text-align:left}section.top-sidebar .widget{margin-bottom:30px;float:left}section.top-sidebar .container .row{margin-bottom:-30px;float:left}.widget ul{padding:0;margin:0;width:100%}.widget .twitter-container .tweet{float:left;clear:both;margin-bottom:18px}.widget .twitter-container .tweet:last-child{margin-bottom:0}header#header{background:#fff;width:100%;border-bottom:1px solid #E9E9E9;padding-top:28px;padding-bottom:28px}header .logo strong{font-size:30px;font-weight:900;font-family:Lato,sans-serif}header .top-content{float:right}nav.menu{float:left;margin-top:10px}nav.menu ul{padding:0;margin:0}nav.menu ul li{float:left;list-style:none;text-transform:uppercase;margin-right:8px}nav.menu>ul>li a:after{content:"•";opacity:.4;font-size:12px;line-height:18px;float:right;margin-left:8px;margin-right:5px;font-weight:400;color:#636467;margin-top:2px}nav.menu>ul>li.toggle a:after,nav.menu>ul>li:last-child a:after{content:"";margin:0;display:none}nav.menu ul li a{text-decoration:none;color:#c1c0c0;text-transform:uppercase;font-size:14px;font-weight:700}nav.menu li.toggle a{display:none;color:#fff!important;background:url(../assets/images/blog/toggle.png) top right no-repeat}header .toggleSidebar{background-image:url(../assets/images/blog/toggle-down.png);background-repeat:no-repeat;background-position:center center;float:right;margin-left:20px;height:38px;width:38px;border-radius:3px}@media (max-width:767px){header .top-content,nav.menu{width:100%}header .top-content,nav.menu,nav.menu ul li,nav.menu ul li a{clear:both;float:left}.blog header,section.top-sidebar{padding-left:20px;padding-right:20px}nav.menu{margin-bottom:10px}nav.menu>ul{border-radius:3px!important;overflow:hidden;padding-top:10px}nav.menu ul{background:#343434;width:100%!important}nav.menu ul li{width:96%!important;margin:0 0 10px 2%!important;list-style:none!important;border-radius:4px!important;overflow:hidden}nav.menu ul li:after,nav.menu>ul>li a:after{display:none}nav.menu ul li a{width:100%!important;background-color:#2b2b2b!important;display:block;color:#b0b0b0!important;font-size:14px!important;padding:10px 3%!important;position:relative;text-align:left;margin:0!important}header .logo,header .logo a{width:100%;text-align:center}nav.menu li.toggle{display:block;margin-left:-5px!important;padding-right:15px!important}nav.menu li.toggle a{display:block;color:#fff!important;background:url(../assets/images/blog/toggle.png) 96% 14px no-repeat!important;padding:0}nav.menu ul li{display:none}nav.menu>ul li.toggle{display:block!important}header .logo{margin:10px 0 20px;float:left}header .logo a strong{text-align:center;display:inline-block}header .toggleSidebar{display:none;margin-right:0;margin-left:0}}@media (max-width:640px){header .toggleSidebar{display:none;margin-right:0;margin-left:0}nav.menu li.toggle{margin-left:10px!important;padding-right:10px!important}}

Expand Down
17 changes: 17 additions & 0 deletions source/layouts/partials/header_option_form.slim
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#mc_embed_signup
form#mc-embedded-subscribe-form.validate[action="//adrianching.us12.list-manage.com/subscribe/post?u=a818b467193d9315e8f002c75&amp;id=bef9b73d36" method="post" name="mc-embedded-subscribe-form" target="_blank" novalidate]
#mc_embed_signup_scroll
.mc-field-group
input#mce-EMAIL.required.email[type="email" value="" name="EMAIL"]
.mc-field-group
input#mce-FNAME[type="text" value="" name="FNAME"]
#mce-responses.clear
#mce-error-response.response[style="display:none"]
#mce-success-response.response[style="display:none"]
div[style="position: absolute; left: -5000px;" aria-hidden="true"]
input[type="text" name="b_a818b467193d9315e8f002c75_bef9b73d36" tabindex="-1" value=""]
.clear
input#mc-embedded-subscribe.btn.btn-primary[type="submit" value="Subscribe" name="subscribe"]
script[type="text/javascript" src="//s3.amazonaws.com/downloads.mailchimp.com/js/mc-validate.js"]
script[type="text/javascript"]
| (function($) {window.fnames = new Array(); window.ftypes = new Array();fnames[0]='EMAIL';ftypes[0]='email';fnames[1]='FNAME';ftypes[1]='text';}(jQuery));var $mcj = jQuery.noConflict(true);
2 changes: 1 addition & 1 deletion source/layouts/post.slim
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ html itemscope='' itemtype='http://schema.org/WebPage' lang=data.site.language
h3 Dribbble
.widget-content
a.dribbble-image href="#"
img alt=("Latest Dribbble Project") src="../assets/images/blog/dribbble-image.png" /
/ img alt=("Latest Dribbble Project") src="../assets/images/blog/dribbble-image.png" /
header#header.header
.container
.row
Expand Down

0 comments on commit b156b98

Please sign in to comment.