Skip to content

Instantly share code, notes, and snippets.

View opejovic's full-sized avatar
:octocat:
Work in progress

Ognjen opejovic

:octocat:
Work in progress
View GitHub Profile
@opejovic
opejovic / shine-animation.scss
Created April 24, 2020 22:19
Shimmer / shine placeholder animation css.
.shine {
background: #f6f7f8;
background-image: linear-gradient(
to right,
#f6f7f8 0%,
#edeef1 20%,
#f6f7f8 40%,
#f6f7f8 100%
);
background-repeat: no-repeat;
.animated-placeholder-two {
background: linear-gradient(90deg, #eef2f6, #eef4fa, #ffffff, #eef4fa, #eef2f6);
background-size: 600% 600%;
-webkit-animation: left-to-right 2.5s ease-out infinite;
-moz-animation: left-to-right 2.5s ease-out infinite;
animation: left-to-right 2.5s ease-out infinite;
}
@-webkit-keyframes left-to-right {
.animated-placeholder {
background: linear-gradient(-90deg, #eef2f6, #ffffff, #bcbfc3);
background-size: 400% 400%;
-webkit-animation: left-to-right 3s ease infinite;
-moz-animation: left-to-right 3s ease infinite;
animation: left-to-right 3s ease infinite;
}
@-webkit-keyframes left-to-right {
@opejovic
opejovic / CSVParser.php
Last active December 28, 2019 19:33
CSVParser - parses data from csv files. The transformed data that it returns is stored in MySQL.
<?php
namespace App\Helpers;
use App\Models\Practice;
use Illuminate\Support\Facades\Storage;
class CsvParser
{
private $file;
<?php
namespace App\Utilities;
use Carbon\Carbon;
use App\ApiRequest;
use Illuminate\Pagination\LengthAwarePaginator;
trait PreparesApiActivityData
{
<template>
<div class="small">
<div v-if="datacollection !== null">
<!-- Stat cards -->
<div class="row justify-content-center">
<div class="col-md-2 m-1">
<div
class="statcard statcard-primary statcard-shadow px-2 py-1"
>
<h5 class="statcard-number">
@opejovic
opejovic / Paginator.vue
Created November 27, 2019 20:44
TailwindCSS and Vue paginator with Laravel backend
<template>
<div class="flex items-center" v-if="paginationExists()">
<!-- previous -->
<div class="cursor-pointer" @click="prev()">
<svg class="w-4 h-4 text-gray-600 fill-current" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/>
</svg>
</div>
<!-- pages -->
.google-like-btn {
border-radius: 4px;
border: 0;
font-weight: 500;
font-size: 14px;
letter-spacing: 0.25px;
line-height: 36px;
padding: 0px 24px;
display: inline-block;
cursor: pointer;
.custom-pretty-btn {
background-color: transparent;
border: 0;
font-weight: 500;
font-size: 13px;
padding: 7px 14px;
color: rgb(94, 41, 153);
display: inline-block;
text-transform: uppercase;
letter-spacing: 1px;
@opejovic
opejovic / Form.js
Last active June 23, 2019 18:15
Vue-Forms: Form.js
class Form {
/**
* Create a new Form instance.
*
* @param {object} data
*/
constructor(data) {
this.originalData = data;
for (let field in data) {