This file contains 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 { motion, useInView, useScroll, useTransform } from "framer-motion"; | |
import { useElementViewportPosition } from "hooks/use-element-viewport-position"; | |
import { useRef, useEffect, useState } from "react"; | |
export const ScrollReveal = ({ offset = 0, once = true, children }) => { | |
const [initiallyVisible, setInitiallyVisible] = useState(false); | |
const [ended, setEnded] = useState(false); | |
const ref = useRef(null); | |
const isInView = useInView(ref); | |
const { position } = useElementViewportPosition(ref, offset); |
This file contains 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
export interface HttpService { | |
get<T = any>(url: string, options?: HttpOptions): Promise<T>; | |
post<T = any>(url: string, data?: {}, options?: HttpOptions): Promise<T>; | |
patch<T = any>(url: string, data?: {}, options?: HttpOptions): Promise<T>; | |
put<T = any>(url: string, data?: {}, options?: HttpOptions): Promise<T>; | |
delete<T = any>(url: string, options?: HttpOptions): Promise<T>; | |
} | |
export interface HttpOptions { | |
params?: HttpParams; |
This file contains 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 from 'react'; | |
import styled from 'styled-components' | |
import { FieldsBuilder } from '@tinacms/form-builder' | |
const Condition = ({ input, field, form }) => { | |
const nestedFields = field.fields(input.value); | |
const conditionalFields = nestedFields.map(f => { | |
const fieldPath = field.name.split('.').slice(0, -1) | |
const name = fieldPath.concat(f.name).join('.') |
This file contains 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 from "react" | |
import styled, { css } from "styled-components" | |
import { DragDropContext, Droppable, Draggable } from "react-beautiful-dnd" | |
import { AddIcon, DragIcon, ReorderIcon, TrashIcon } from "@tinacms/icons" | |
import { | |
padding, | |
color, | |
radius, | |
font, | |
IconButton, |
This file contains 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
<template lang="html"> | |
<div> | |
<form @submit="handleSubmit"> | |
<input | |
v-model="contactForm.name" | |
name="name" | |
type="text" | |
> | |
<input | |
v-model="contactForm.email" |
This file contains 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 postmark = require("postmark"); // require mail service, postmark in this case | |
const client = new postmark.Client("XXXXXXXXXXXXXXXXXXXXXXXXXXXX"); // your postmark api key | |
const headers = { | |
"Access-Control-Allow-Origin" : "*", // better change this for production | |
"Access-Control-Allow-Methods": "POST", | |
"Access-Control-Allow-Headers": "Content-Type" | |
}; |
This file contains 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 Headroom from '../lib/headroom'; | |
export default function init(app) { | |
const headroom = new Headroom({ | |
nodes: document.queryAll('[data-headroom]'), | |
}).init(); | |
const header = headroom.find('page-header'); | |
if (header) { | |
header.onToggle((instance) => { |
This file contains 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 View from './view'; | |
import Model from './model'; | |
import Controller from './controller'; | |
export default class Tooltip { | |
constructor(options) { | |
this.model = new Model(); | |
this.controller = new Controller(this.model); | |
this.view = new View(this.controller, options); | |
} |
This file contains 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 Controller from '../shared/controller'; | |
export default class ClipboardController extends Controller { | |
copy = () => { | |
this.model.isCopied = true; | |
if (this.onCopy && typeof this.onCopy === 'function') { | |
this.onCopy(); | |
} | |
} |
This file contains 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 View from './view'; | |
import Model from './model'; | |
import Controller from './controller'; | |
export default class Clipboard { | |
constructor(options) { | |
this.model = new Model(); | |
this.controller = new Controller(this.model); | |
this.view = new View(this.controller, options); | |
} |
NewerOlder