Skip to content

Instantly share code, notes, and snippets.

View PavelLaptev's full-sized avatar
📺
Long live the new flesh!

Pavel Laptev PavelLaptev

📺
Long live the new flesh!
View GitHub Profile
bg = new Layer backgroundColor: "#2d383e"
phoneScreen = new Layer
width: 750
height: 1334
clip: true
backgroundColor: "black"
(window.onresize = ->
phoneScreen.center()
#Text replacer
replacer = (place, oldString, newString) ->
string = place.text()
newText = string.replace(oldString, newString)
place.text(newText)
#Style replacer in text
replacer = (place, oldString, newString) ->
string = place.html()
newText = string.replace(oldString, newString)
optTest = (options) ->
text = options.text or "Работает"
name = options.name or "сучка"
console.log(text + " " + name)
optTest
text: "Но как же"
name: "работает"
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:"yourURL"]];
@PavelLaptev
PavelLaptev / print.clear() for FramerJS
Created July 31, 2017 09:52
Script allows you clearing print-console while you are coding
print.clear = () ->
console.clear()
try
consoleParent = document.getElementById("FramerContextRoot-PrintConsole")
consoleChild = consoleParent.children[0].children[1].children
arrForRemove = []
for i in [0...consoleChild.length]
if consoleChild[i].textContent.indexOf('»') isnt -1
gradientSVG = (params) ->
# PARAMETERS #
name = params.name || "Add SVG layer"
startColor = params.startColor || "rgb(255,255,0)"
endColor = params.endColor || "rgb(255,0,0)"
startOffset = params.startOffset || 0
endOffset = params.endOffset || 100
angle = params.angle || 0
# IMPLEMENT PARAMS #
getElementIndex = node => {
let index = 0;
while ((node = node.previousElementSibling)) {
index++;
}
return index;
};
import * as React from "react";
import { PropertyControls, ControlType } from "framer";
// Define type of properties
interface Props {
tintColor: any;
text: string;
}
export class BasicFramerXcomponent extends React.Component<Props> {
import * as React from "react";
import { PropertyControls, ControlType } from "framer";
// Define type of properties
interface Props {
tintColor: string;
enabled: boolean;
height: number;
width: number;
}
@PavelLaptev
PavelLaptev / Tabs.tsx
Last active September 13, 2018 08:52
import * as React from "react";
import * as ReactDOM from "react-dom";
import { PropertyControls, ControlType } from "framer";
import { fontStyles } from "../data/style/_fontStyles";
import styled from "styled-components";
// Define type of property
interface Props {
amount: number;
lineWidth: number;