Skip to content

Instantly share code, notes, and snippets.

@code-nation
code-nation / _feature_video_styles.scss
Created September 13, 2016 13:12
Featured Youtube & Vimeo Videos
.videomodal-overlay {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 2147483647;
width: 100%;
height: 100%;
overflow: hidden;
@code-nation
code-nation / donation-page-optional-phone-field-hack.html
Created September 4, 2016 03:41
Hack for Optional Phone Field on Donate Page
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label for="donation_billing_address_phone_number" class="control-label">Phone</label>
{% phone_field "billing_address.phone_number", class:"text form-control", placeholder:"Phone" %}
<small style="display: block; padding-top: 5px; line-height: 16px;">
<a id="donate_no_phone" href="#">Click here</a> to make a donation without providing a phone number
</small>
<script type="text/javascript">
$(function(){
@code-nation
code-nation / _mixitup_styles.scss
Last active March 26, 2024 12:54
Mix it up in blog page
$theme_color1: #07daba;
$theme_color2: #085a4e;
body{
font-family: "proxima-nova",sans-serif;
}
h1, h2, h3, h4{
letter-spacing: 1px;
}
h1{
@code-nation
code-nation / _staged-donations.scss
Last active April 22, 2018 21:35
Bootstrap with Staged Donations
.page-pages-show-donation-wide {
font-family: "Proxima-nova", sans-serif;
background: #222;
// BUTTONS
.btn-gray {
background: #222;
text-decoration: none;
border-color: transparent;
color: #07daba;
font-size: 18px;
{% if body contains "###" %}
{% assign body_parts = body | split:'###' %}
{{ body_parts[0] }}
{% assign button_parts = body_parts[1] | strip_html | split:'|' %}
<!--[if mso]>
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="{{ button_parts[1] }}" style="height:40px;v-text-anchor:middle;width:220px;" arcsize="10%" strokecolor="#47b2a9" fillcolor="#47b2a9">
<w:anchorlock/>
<center style="color:#ffffff;font-family:sans-serif;font-size:13px;font-weight:bold;">{{ button_parts[0] }}</center>
</v:roundrect>
<![endif]-->
@code-nation
code-nation / next-and-previous-buttons.html
Last active February 27, 2016 17:14
Step 2 of 2: Add Next and Previous links to blog posts on your NationBuilder site
{% if previous_post.id.size > 0 %}
<div class="padtop padbottom">
<a href="{{ previous_post.url }}" class="submit-button btn btn-primary">Previous post: "{{ previous_post.headline }}"</a>
</div>
{% endif %}
{% if next_post.id.size > 0 %}
<div class="padtop padbottom">
<a href="{{ next_post.url }}" class="submit-button btn btn-primary">Next: "{{ next_post.headline }}"</a>
</div>
@code-nation
code-nation / next-and-previous-liquid-objects.html
Last active February 27, 2016 17:10
Step 1 of 2: Add Next and Previous links to blog posts on your NationBuilder site
{% assign ordered_posts = page.parent.children | sort:'published_at' %}
{% for post in ordered_posts %}
{% if post.id == page.id %}
{% assign previous_post_number = forloop.index | minus:1 %}
{% assign next_post_number = forloop.index | plus:1 %}
{% endif %}
{% endfor %}
{% for post in ordered_posts %}
@code-nation
code-nation / address-autocomplete.html
Last active December 28, 2020 10:44
Script to use Google Maps API and run an address autocomplete function as part of a form
<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?libraries=places"></script>
<script type="text/javascript">
/* Create address autocomplete */
var autocompleteOptions = {
types: ['address'],
// restrict to only Aussie addresses - change 'au' to any other 2-letter country code as you please
componentRestrictions: {country: 'au'}
};
function initAutocomplete() {
// Change the ID on the line below as required