Skip to content

Instantly share code, notes, and snippets.

Avatar

Nick Stewart nickstewart95

View GitHub Profile
View main.js
(function(){
// Vertical Timeline - by CodyHouse.co
function VerticalTimeline( element ) {
this.element = element;
this.blocks = this.element.getElementsByClassName("cd-timeline__block");
this.images = this.element.getElementsByClassName("cd-timeline__img");
this.contents = this.element.getElementsByClassName("cd-timeline__content");
this.offset = 0.8;
this.hideBlocks();
};
View gulpfile.js
var gulp = require('gulp');
var sass = require('gulp-sass');
var livereload = require('gulp-livereload');
var inlineCss = require('gulp-inline-css');
var replace = require('gulp-replace');
var fs = require('fs');
sass.compiler = require('node-sass');
gulp.task('sass', function () {
View Loader.php
<?php
namespace Sample;
use \Illuminate\Database\Capsule\Manager as Capsule;
class Loader {
public function init() {
$this->initEloquent();
$this->initActions();
$this->initFilters();
View sample.php
<?php
/**
* Plugin Name: Sample Plugin
* Description: A sample plugin
* Version: 1.0
*/
require_once __DIR__ . '/vendor/autoload.php';
$plugin = new \Sample\Loader(__DIR__, plugin_dir_url(__FILE__));
View composer.json
{
"autoload": {
"psr-4": {
"Sample\\": "src/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"illuminate/database": "^7.14.1"
View links.css
View animation.css
animation: navigation-base 1s 1;
@keyframes navigation-base {
0% {
width: 0px;
height: 0px;
box-shadow: 0px;
}
40% {
width: 100%;
View callCategory.php
protected function setupCategories() {
$categories = Category::where('taxonomy', 'category')->get();
foreach($categories as $category) {
$data = $category->createObject();
array_push($this->dataObject, $data);
}
}
View category.php
class Category extends \Corcel\Model\Taxonomy {
public function getIdAttribute() {
return $this->term_id;
}
public function getTitleAttribute() {
return $this->name;
}
public function createObject() {
View createObject.php
public function createObject() {
$object = [
'_id' => $this->id,
'_type' => 'employee',
'name' => $this->name,
'slug' => $this->slug,
];
return $object;
}
You can’t perform that action at this time.