This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { useState, useEffect } from "react"; | |
| export default function QuoteBox() { | |
| const API_URL = "http://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1"; | |
| const [quote, setQuote] = useState({}); | |
| const [isLoading, setLoading] = useState(false); | |
| async function queryAPI() { | |
| setLoading(true); | |
| const response = await fetch(API_URL); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // IntersectionObserver polyfill | |
| import 'intersection-observer' | |
| // ***************************** | |
| import React, { Component } from 'react' | |
| export default class ImageLazyLoader extends Component { | |
| state = { | |
| isLoaded: false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var mediaJSON = { "categories" : [ { "name" : "Movies", | |
| "videos" : [ | |
| { "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org", | |
| "sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ], | |
| "subtitle" : "By Blender Foundation", | |
| "thumb" : "images/BigBuckBunny.jpg", | |
| "title" : "Big Buck Bunny" | |
| }, | |
| { "description" : "The first Blender Open Movie from 2006", | |
| "sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //ROUTER | |
| //Silly small javascript router to help me learn how they worked in a very simple way | |
| (function (){ | |
| const appDiv = "app"; | |
| // Both set of different routes and template generation functions | |
| let routes = {}; | |
| let templates = {}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script src=//unpkg.com/vue></script> | |
| <script src=//unpkg.com/vuetrend></script> | |
| <div id="app"> | |
| <trend | |
| :data="[0, 2, 5, 9, 5, 10, 3, 5, 0, 0, 1, 8, 2, 9, 0]" | |
| :gradient="['#6fa8dc', '#42b983', '#2c3e50']" | |
| auto-draw | |
| smooth> | |
| </trend> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script src="https://www.gstatic.com/firebasejs/3.7.4/firebase.js"></script> | |
| <script src="https://unpkg.com/vue"></script> | |
| <script src="https://unpkg.com/vuex"></script> | |
| <script src="https://unpkg.com/vuexfire"></script> | |
| <div id="app"> | |
| <input v-model.trim="newTodoText" @keyup.enter="addTodo" placeholder="Add new todo"> | |
| <ul> | |
| <li v-for="todo in todos"> | |
| <input :value="todo.text" @input="updateTodoText(todo, $event.target.value)"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const buildSlideMarkup = (count) => { | |
| let slideMarkup = ''; | |
| for (var i = 1; i <= count; i++) { | |
| slideMarkup += '<slide><span class="label">' + i + '</span></slide>' | |
| } | |
| return slideMarkup; | |
| }; | |
| new Vue({ | |
| el: '#example', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| h1 { | |
| font-weight: 300; | |
| font-size: 1.8em; | |
| margin-top: 0; | |
| } | |
| a { | |
| color: #fff; | |
| } | |
| .draggable-header-view { | |
| background-color: #fff; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Created by matt on 3/8/17. | |
| */ | |
| import React, { PropTypes } from 'react'; | |
| import './button.scss'; | |
| function ripple (e) { | |
| const midX = e.offsetX; | |
| const midY = e.offsetY; | |
| const { width, height } = e.target.getBoundingClientRect(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var pdf = require('gulp-html-pdf'); | |
| var replace = require('gulp-replace'); | |
| var inlineimg = require('gulp-inline-image-html'); | |
| var cssfont64 = require('gulp-cssfont64'); | |
| gulp.task('pdf',['font64'], function () { | |
| return gulp.src('HTML/Pages/*.html') | |
| .pipe(replace(/<link\b.+href="(?!http)([^"]*)".*>/g, function(s, filename) { | |
| var filepath = path.relative(__dirname , path.resolve(__dirname + '/HTML/css', filename)) | |
| var style = fs.readFileSync(filepath, 'utf8'); |
NewerOlder