Skip to content

Instantly share code, notes, and snippets.

View nicubarbaros's full-sized avatar
🧔‍♂️

Nicu Barbaros nicubarbaros

🧔‍♂️
View GitHub Profile
.placement-container {
display: grid;
width: 100vw;
height: 100vh;
place-items: center;
}
.grid-container {
display: grid;
@nicubarbaros
nicubarbaros / z.scss
Created October 3, 2022 11:45
z-index mixin
@function z($name) {
@if index($z-indexes, $name) {
@return (length($z-indexes) - index($z-indexes, $name)) + 1;
} @else {
@warn 'There is no item "#{$name}" in this list; choose one of: #{$z-indexes}';
@return null;
}
}
$z-indexes: (
"outdated-browser",
@nicubarbaros
nicubarbaros / easing.js
Created June 24, 2022 18:27 — forked from gre/easing.js
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
// no easing, no acceleration
linear: t => t,
// accelerating from zero velocity
easeInQuad: t => t*t,
// decelerating to zero velocity
@nicubarbaros
nicubarbaros / sassas.md
Created June 15, 2022 20:46 — forked from AdamMarsden/sassas.md
Sass Architecture Structure

Sass Architecture Structure

sass/
|
|– base/
|   |– _reset.scss       # Reset/normalize
|   |– _typography.scss  # Typography rules
|   ...                  # Etc…
|
import React from "react";
import "../styles/home.scss";
import Home from "../containers/Home";
const Index = () => {
return (
<>
<Home />
</>
);
import { useEffect, useRef } from "react";
import LocomotiveScroll, {
LocomotiveScrollOptions,
Scroll,
} from "locomotive-scroll";
import "locomotive-scroll/src/locomotive-scroll.scss";
type UseLocomotiveScrollHook = [React.RefObject<Scroll>];
type Props = {
@nicubarbaros
nicubarbaros / mixins.scss
Created November 1, 2021 19:07
A personal list of mixins I am using
$breakpoints: (
'phone': 400px,
'phone-wide': 480px,
'phablet': 560px,
'tablet-small': 640px,
'tablet': 768px,
'tablet-wide': 1024px,
'desktop': 1248px,
'desktop-wide': 1440px,
'desktop-large': 1680px
@nicubarbaros
nicubarbaros / SplitText3.min.js
Created May 20, 2021 19:38
SplitText from GSAP - not commercial use
/* eslint-disable */
!(function(D, u) {
"object" == typeof exports && "undefined" != typeof module
? u(exports)
: "function" == typeof define && define.amd
? define(["exports"], u)
: u(((D = D || self).window = D.window || {}));
})(this, function(e) {
"use strict";
var v = "";
// create a bookmark and use this code as the URL, you can now toggle the css on/off
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3
javascript: (function() {
var domStyle = document.createElement("style");
domStyle.append(
'* { color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }\
* * { background-color: rgba(0,255,0,.2) !important; }\
* * * { background-color: rgba(0,0,255,.2) !important; }\
* * * * { background-color: rgba(255,0,255,.2) !important; }\
* * * * * { background-color: rgba(0,255,255,.2) !important; }\
@nicubarbaros
nicubarbaros / mentions.js
Created April 17, 2018 21:13
Draft Js Mentions
import { convertFromRaw, convertToRaw, ContentState } from 'draft-js';
const getIndicesOf = (searchStr, str, caseSensitive) => {
let tempStr = str;
let tempSearchStr = searchStr;
const searchStrLen = tempSearchStr.length;
if (searchStrLen === 0) {
return [];
}
let startIndex = 0;