Skip to content

Instantly share code, notes, and snippets.

View nikolaswise's full-sized avatar
🌡

Nikolas Wise nikolaswise

🌡
View GitHub Profile
export const $ = (selector, context = document) => Array(...context.querySelectorAll(selector))
export const isEven = n => n === 0 || !!(n && !(n%2));
export const isInViewport = (el)=> {
var rect = el.getBoundingClientRect();
return (
rect.top >= 0 &&
rect.left >= 0 &&
rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && /*or $(window).height() */
// TOGS????
<section class="js-toggle-group">
<nav>
<button
data-toggle="one"
class="js-toggle-link">
One
</button>
<button
@nikolaswise
nikolaswise / image-filter.html
Created August 21, 2018 22:03
A grayscale & multiplied image that fades to full color on hover
<!-- html -->
<figure class="multiply-image lead-1 ns-lead-0">
<img class="multiply-image-source" src="{{section.settings.about_image | img_url: '900x' }}" alt="{{section.settings.about_caption}}">
<img class="multiply-image-copy" src="{{section.settings.about_image | img_url: '900x' }}" alt="{{section.settings.about_caption}}">
<caption class="txt-gray multiply">{{section.settings.about_caption}}</caption>
</figure>
<!-- css -->
.multiply-image {

Typography

  • Full list of type families & faces
  • Full list of font sizes & line heights used

Layout

  • Max width of constrained layout

If using a grid system:

@nikolaswise
nikolaswise / shopify.md
Created May 15, 2018 18:04
What shopify about tho

Shopify Technical Platform Notes

What Shopify Does

  • Inventory Management
  • Credit Card processing
  • Order & Shipping tracking
  • Creation of basic content types:
    • Collections
    • Products
    • Product Variants
const channels = {
z: {
channel: 'z',
description: 'Getting nothing but static, getting nothing but static / Static in my attic from Channel Z',
emits: 'Space Junk',
listeners: []
}
}
const check = channel => typeof channels[channel] == 'object'
@nikolaswise
nikolaswise / sample.html
Created March 15, 2018 17:16
simple boilerplate
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta content="IE=edge" http-equiv="X-UA-Compatible">
<meta name="viewport" content="width=device-width, user-scalable=no">
<title>Your Title</title>
<link rel="shortcut icon" href="/img/favicon.ico">
<!-- get calcite-web css from the cdn (use latest version) -->
<link rel="stylesheet" href="/style.min.css?v1.0.0">
@nikolaswise
nikolaswise / shopify-product-variants.html
Created March 12, 2018 18:23
`n` dimensional product variants
<div class="product-options">
{% for option in product.options_with_values %}
<div class="product-option">
<h4 class="txt-size-0">{{ option.name }}</h4>
<select class="product-option-select js-variant-select" data-axis="{{ option.name | downcase }}">
{% for value in option.values %}
<option {% if option.selected_value == value %}selected{% endif %}>
{{ value }}
</option>
// β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
// β”‚ CSS Grid: β”‚
// β”‚ Good for β”‚
// β”‚ spanning β”‚
// β”‚ horizontal β”‚
// β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
.masonry {
display: grid;
grid-template-columns: repeat(4, 1fr);
// β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
// β”‚ Multi-Col: β”‚
// β”‚ Good for β”‚
// β”‚ Pinterest β”‚
// β”‚ Style. β”‚
// β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
.masonry {
column-count: 4;
column-gap: $gutter;