New home page :)

This commit is contained in:
Rico Sta. Cruz 2017-08-29 02:21:48 +08:00
parent 5b3a6b4119
commit 18203ffc41
No known key found for this signature in database
GPG Key ID: CAAD38AE2962619A
9 changed files with 155 additions and 47 deletions

View File

@ -5,10 +5,23 @@ type: website
{% include 2017/top-nav.html page=page %} {% include 2017/top-nav.html page=page %}
<div class='SideAd'>
<script async src='//cdn.carbonads.com/carbon.js?zoneid=1673&serve=C6AILKT&placement=ricostacruzcom' id="_carbonads_js"></script>
</div>
<div class='body-area -slim'> <div class='body-area -slim'>
<form data-js-search-form class='search-box'> <div class='site-header'>
<h1>
Rico's cheatsheets
</h1>
<p>
Hey! I'm <a href='https://ricostacruz.com'>@rstacruz</a> and this is a
modest collection of cheatsheets I've written.
</p>
<form data-js-search-form class='search-box search'>
<input type='text' placeholder='Search...' autofocus data-js-search-input> <input type='text' placeholder='Search...' autofocus data-js-search-input>
</form> </form>
</div>
<div class='pages-list'> <div class='pages-list'>
<h2 class='category item' id='{{ category | downcase | replace: " ", "-" }}' data-js-searchable-header> <h2 class='category item' id='{{ category | downcase | replace: " ", "-" }}' data-js-searchable-header>

View File

@ -12,6 +12,7 @@
.HeadlineAd { .HeadlineAd {
@include font-size(-1); @include font-size(-1);
@include carbon-style;
& { & {
display: inline-block; display: inline-block;
@ -36,44 +37,8 @@
zoom: 1; zoom: 1;
} }
.carbon-img,
.carbon-text,
.carbon-poweredby {
text-decoration: none;
display: block;
}
.carbon-img { .carbon-img {
float: right; float: right;
margin-left: 16px; margin-left: 16px;
width: 130px;
height: 100px;
box-shadow: $shadow3;
}
.carbon-img > img {
border-radius: 3px;
background: white;
}
.carbon-img:hover {
transform: translate3d(0, -1px, 0);
box-shadow: $shadow6;
}
.carbon-text,
.carbon-text:visited {
color: $gray-text;
}
.carbon-poweredby,
.carbon-poweredby:visited {
color: lighten($gray-text, 20%);
}
.carbon-text:hover,
.carbon-poweredby:hover {
color: $base-a;
} }
} }

View File

@ -0,0 +1,26 @@
.search-box {
background: $base-panel;
box-shadow: $shadow3;
display: flex;
height: 64px;
& > input {
@include font-size(2);
padding: 16px;
height: 64px;
background: transparent;
border: 0;
Flex: 1 0 auto;
}
&::before {
@include ion-icon('md-search');
font-size: 32px;
color: $base-head;
flex: 0 0 48px;
width: 48px;
line-height: 64px;
text-indent: 16px;
text-align: center;
}
}

View File

@ -0,0 +1,35 @@
.SideAd {
@include font-size(-1);
@include carbon-style;
@media (min-width: 769px) {
position: absolute;
right: 32px;
top: 80px;
width: 130px;
.carbon-img {
margin-bottom: 16px;
}
}
@media (max-width: 768px) {
& {
margin: 16px auto;
max-width: 300px;
}
&::after {
content: '';
display: table;
clear: both;
zoom: 1;
}
.carbon-img {
float: left;
margin-right: 16px;
}
}
}

View File

@ -0,0 +1,27 @@
.site-header {
margin: 32px 0;
& > p {
margin: 0;
padding: 0;
text-align: center;
color: $base-mute;
}
& > p > a {
text-decoration: none;
}
& > h1 {
@include font-size(5);
margin: 0;
padding: 0;
color: $base-head;
font-weight: 300;
text-align: center;
}
& > .search {
margin-top: 32px;
}
}

View File

@ -2,6 +2,7 @@
@import './variables'; @import './variables';
@import '../vendor/modularscale/modularscale'; @import '../vendor/modularscale/modularscale';
@import '../vendor/iconfonts/ionicons@3'; @import '../vendor/iconfonts/ionicons@3';
@import './utils/carbon-style';
@import './utils/font-size'; @import './utils/font-size';
@import './utils/gutter'; @import './utils/gutter';
@import './utils/heading-style'; @import './utils/heading-style';
@ -11,6 +12,7 @@
@import './markdown/headings'; @import './markdown/headings';
@import './markdown/table'; @import './markdown/table';
@import './markdown/ul'; @import './markdown/ul';
@import './components/attribute-peg';
@import './components/body-area'; @import './components/body-area';
@import './components/h2-section'; @import './components/h2-section';
@import './components/h3-section'; @import './components/h3-section';
@ -20,5 +22,7 @@
@import './components/notice-box'; @import './components/notice-box';
@import './components/page-actions'; @import './components/page-actions';
@import './components/pages-list'; @import './components/pages-list';
@import './components/search-box';
@import './components/side-ad';
@import './components/site-header';
@import './components/top-nav'; @import './components/top-nav';
@import './components/attribute-peg';

View File

@ -0,0 +1,44 @@
/*
* Base carbon ads style
*/
@mixin carbon-style {
.carbon-img,
.carbon-text,
.carbon-poweredby {
text-decoration: none;
display: block;
}
.carbon-img {
width: 130px;
height: 100px;
box-shadow: $shadow3;
}
.carbon-img > img {
border-radius: 3px;
background: white;
}
.carbon-img:hover {
transform: translate3d(0, -1px, 0);
box-shadow: $shadow6;
}
.carbon-text,
.carbon-text:visited {
color: $gray-text;
}
.carbon-poweredby,
.carbon-poweredby:visited {
color: lighten($gray-text, 20%);
}
.carbon-text:hover,
.carbon-poweredby:hover {
color: $base-a;
}
}

View File

@ -1,6 +1,6 @@
--- ---
full_title: "Cheatsheets — for web development and more" full_title: "Cheatsheets — for web development and more"
description: "A collection of cheatsheets I've written." description: "A collection of cheatsheets I've written."
layout: home layout: 2017/home
type: website type: website
--- ---

View File

@ -1,6 +0,0 @@
---
full_title: "Cheatsheets — for web development and more"
description: "A collection of cheatsheets I've written."
layout: 2017/home
type: website
---