Skip to content

Instantly share code, notes, and snippets.

View rhythnic's full-sized avatar

Nick Baroni rhythnic

View GitHub Profile
@rhythnic
rhythnic / animated-text-factory.js
Created September 6, 2018 19:02
Factory for creating custom elements for text-animation.
// ***************************************
// AnimatedTextFactory
// Factory gives you a custom element that accepts a text property.
// Each character of the text is wrapped in an element and appended as a child.
// You can achieve cool effects by combining css animation with props
// set on the child nodes.
//
// Usage
// <template>
// <text-stagger-animation-delay text="The ants go marching one by one.">
@rhythnic
rhythnic / vuelidate-messages.js
Last active June 4, 2020 08:52
Display Vuelidate Validation (Error) Messages
const isFn = x => typeof x === 'function'
const plural = (words, count) => {
words = words.split('|').map(x => x.trim())
return count > 1 ? words[2].replace('{n}', count) : words[count]
}
// Given a Vuelidate validations object, find the validator keys
export function extractValidatorKeys (validations, validators = []) {
const keys = Object.keys(validations)
@rhythnic
rhythnic / vuex-reusable-functions.js
Last active October 21, 2022 07:41
Reusable Vuex Functions
// *******************************************************************
// ATTENTION
// This gist is now an npm module
// The API of some functions is altered slightly.
// All future work will happen in the repo.
//
// https://gitlab.com/rhythnic/vuex-intern
// *******************************************************************
// *******************************************************************