Skip to content

Instantly share code, notes, and snippets.

@artrayd
artrayd / index.html
Created January 10, 2015 15:43
Lollipop boot SVG animation
<svg viewBox="362 362 300 300" width="300" height="300">
<path id="motionPath" fill="none" stroke="none" stroke-miterlimit="10" d="M516.9,506.4c16.2-17.6,46.4-37.3,84-32.7c59.4,7.1,49.4,60.1-3,67.8
c-15.6,2.3-58.2-3.3-90-24.3c-31.8-20.9-53-57.1-57.1-72.3c-13.9-51.2,30.7-81.4,60.9-29.8c18.9,32.4,14.4,64.6,3.8,89.2
c-3.4,6.7-6.6,12.8-8.9,18.3c-9.1,21.8-13.9,54.9,3.6,86c29.2,52.3,74.4,22.9,61.5-28.5c-3.8-15.4-25.2-52.6-56.7-74
c-31.4-21.5-72.9-27.3-88.6-25.4c-52.7,6.7-63.7,59.3-4.4,67.6C466.1,554.4,503.6,524.9,516.9,506.4z"/>
<!-- RED -->
@artrayd
artrayd / App.vue
Last active July 29, 2019 05:00 — forked from tomhodgins/sketch.html
Draw <svg> inside the browser with finger or mouse. Adopted for vuejs. Demo: https://artrayd.com/freehand-svg/
<template>
<div id="app">
<FreehandDrawSVG
v-bind:title="drawProps.title"
v-bind:colors="drawProps.colors"
v-bind:bgColors="drawProps.bgColors"
v-bind:lineColor = "drawProps.lineColor"
v-bind:bgColor = "drawProps.bgColor"
v-on:changeLineColor = "changeLineColor"
{
"letters": [
{
"name": "Alpha",
"alt": "Greek Alpha Letter",
"path": "assets/letters/lett-alpha.svg"
},
{
"name": "Beta",
"alt": "Greek Gamma Letter",
@artrayd
artrayd / alphabet-1.vue
Last active July 2, 2020 08:56
Importing array from local JSON file to Vue
// Importing array from local JSON file
import json from "@/assets/letters/greek-alphabet.json";
export default {
name: "Alphabet",
data: function() {
return {
letters: json.letters, // passing array data into Vue
};
},
<template>
<ul class="alphabet">
<li v-for="letter in letters" :key="letter.name">
<img :src="letterIcon(letter.path)" />
<span>{{ letter.name }}</span>
<div class="tooltip">{{ letter.alt }}</div>
</li>
</ul>
</template>
@artrayd
artrayd / alphabet-3.vue
Last active July 2, 2020 08:57
Require image src path for v-loop
methods: {
letterIcon: function(path) {
return require("@/" + path);
},
},
<img :src="letterIcon(letter.path)" />
// inside html template
<span>{{ lettersAmount }} letters</span>
// inside script
computed: {
lettersAmount: function() {
return this.letters.length;
},
},
@artrayd
artrayd / index.js
Created September 23, 2020 21:05 — forked from wdmtech/index.js
Facebook SDK (Graph/REST API) integration as a Vue.js mixin
export let facebookSDK = {
mounted () {
let _this = this
this.$nextTick(() => {
window.fbAsyncInit = function () {
FB.init({
appId: 'XXX',
xfbml: true,
version: 'v2.6'
})
@artrayd
artrayd / gist:fc1a108b479e746bcbc57a78bbc6e651
Last active January 15, 2022 08:44
Empty VueJS Component
<template>
<div></div>
</template>
<script>
export default {
name: "Love",
};
</script>