Skip to content

Instantly share code, notes, and snippets.

View ohiosveryown's full-sized avatar
🏀

Matthew Pence ohiosveryown

🏀
View GitHub Profile
@ohiosveryown
ohiosveryown / change-class-on-scroll.html
Last active May 9, 2024 16:56
Vanilla JS – change/add class based on scroll position.
// https://codepen.io/cmykw/pen/gemxJm
// layout
<nav/>
// style
<style>
body { min-height: 200vh; }
nav {
@ohiosveryown
ohiosveryown / grid.scss
Last active November 5, 2018 16:42
Grid & System Font Stack mainly for codepen imports
// System Font Stack
$system-font: -apple-system, ".SFNSText-Regular", "San Francisco", "Roboto", "Segoe UI", "Helvetica Neue", "Lucida Grande", sans-serif;
// Gird
$columns: 12;
$gutter: 2%;
@function grid-width($cols, $has-gutter:false) {
@if $has-gutter {
@return calc(((100% / #{$columns}) * #{$cols}) - #{$gutter});
*,*:before,*:after{box-sizing:inherit}html{box-sizing:border-box;overflow-x:hidden;font-size:62.5%;-webkit-font-smoothing:antialiased !important;text-rendering:optimizeLegibility !important}body{background:#fff;color:rgba(0,0,0,0.8);font:400 1.6rem/1.4 -apple-system, BlinkMacSystemFont, 'avenir next', avenir, 'helvetica neue', helvetica, ubuntu, roboto, noto, 'segoe ui', arial, sans-serif;overflow-x:hidden;margin:0;padding:0}a{color:inherit;text-decoration:none}h1,h2,h3,h4,h5,h6,img,ul,li,section,article,figure,main{margin:0;padding:0}button{border:none;background:black;cursor:pointer;margin:0}img{max-width:100%}ul{list-style-type:none}li{display:inline-block}.debug{outline:2px solid pink}.mb-0{margin-bottom:.809rem}.mb-1{margin-bottom:1.618rem}.mb-2{margin-bottom:3.236rem}.mb-3{margin-bottom:4.854rem}.mb-4{margin-bottom:6.472rem}.mb-5{margin-bottom:8.09rem}.mb-6{margin-bottom:9.708rem}.mb-7{margin-bottom:11.326rem}.mb-8{margin-bottom:12.944rem}.mb-9{margin-bottom:14.562rem}@media (min-width: 700px){.mt-6-ns{
@ohiosveryown
ohiosveryown / easing.css
Created June 20, 2017 13:59
CSS Easing Variables
/* https://gist.github.com/bendc/ac03faac0bf2aee25b49e5fd260a727d */
:root {
--ease-in-quad: cubic-bezier(.55, .085, .68, .53);
--ease-in-cubic: cubic-bezier(.550, .055, .675, .19);
--ease-in-quart: cubic-bezier(.895, .03, .685, .22);
--ease-in-quint: cubic-bezier(.755, .05, .855, .06);
--ease-in-expo: cubic-bezier(.95, .05, .795, .035);
--ease-in-circ: cubic-bezier(.6, .04, .98, .335);
@ohiosveryown
ohiosveryown / click.vue
Last active November 5, 2018 16:34
vue click bind
<!-- layout -->
<template>
<router-link to="/">
<div class="mw-grid debug">
test
<img v-bind:class="{ triggerActive: move }" @click="move = !move" class="debug center" src="http://i.imgur.com/JQaaf8q.jpg" alt="">
</div>
@ohiosveryown
ohiosveryown / states.md
Last active January 30, 2018 14:26 — forked from alishalisha/states.md
Checking state on product design patterns

Checking the State of Your States

If applicable, make sure your design component accounts for all these states. This is basically copied from the Nine States of Design Medium article. 😛

  • Initial state: What happens before your component does anything? Maybe it’s the first time a user sees it. Maybe it’s not activated yet. Essentially, the component exists but hasn’t started.
  • Loading state: Have you accounted for when a user will be waiting for something to happen? What does that look like?
  • Empty/Zero state: Your component has initialized, but it’s empty. No data. No Items. Now may be a good time to get the user to act (“Do this thing!”), or to reward them (“Good job, everything is taken care of”).
  • One state: You have some data. On an input, this may be after the first keystroke. In a list, it might be when you have one item (or one left).
  • Some data state: This is usually what you
@ohiosveryown
ohiosveryown / README.md
Created November 12, 2017 19:07 — forked from hofmannsven/README.md
My simply Git Cheatsheet
@ohiosveryown
ohiosveryown / array.vue
Last active November 5, 2018 16:27
Object Array for Vue
<template>
<main>
<h1>{{ object.first }} {{ object.last }}</h1>
<p>{{ object.age }}</p>
</main>
</template>
<script>
@ohiosveryown
ohiosveryown / arrow-function-shorthand.js
Created April 26, 2018 19:31
Arrow Function Shorthand
const trigger = document.querySelector('button')
trigger.addEventListener('click', () => {
document.querySelector('h1').classList.add('blue')
})
trigger.addEventListener('mouseenter', () => {
document.querySelector('h1').classList.add('blue')
})
@ohiosveryown
ohiosveryown / random.js
Created November 5, 2018 16:20
Single Random Entry from Array
const h1 = document.querySelector('h1')
const pages = [
'<a target="_blank" href="http://google.com">Google</a>',
'<a target="_blank" href="http://apple.com">Apple</a>',
'<a target="_blank" href="http://nike.com">Nike</a>',
'<a target="_blank" href="http://adidas.com">Adidas</a>',
]
const page = pages[~~(Math.random() * pages.length)]
// const page = pages[pages.length * Math.random() | 0]