Skip to content

Instantly share code, notes, and snippets.

View PanagiotisGeorgiadis's full-sized avatar

Panagiotis Georgiadis PanagiotisGeorgiadis

View GitHub Profile
@PanagiotisGeorgiadis
PanagiotisGeorgiadis / Test.elm
Created August 2, 2019 15:32
Testing Elm concurrency with a kind of extreme example.
module Main exposing (main)
import Html exposing (Html, br, div, input, text)
import Html.Attributes exposing (defaultValue, type_, value)
import Html.Events exposing (onInput)
-- Elm 0.18 implementation
-- Example can be found on https://ellie-app.com/sbw95cJgz2a1
-- MODEL
@PanagiotisGeorgiadis
PanagiotisGeorgiadis / scrolling.js
Created June 27, 2019 08:33
Smooth scroll animation using the Ease In Quint function.
const scrollToElement = (id) => {
let duration = 1000;
let element = document.getElementById(id);
if (!element)
return;
let targetPosition = element.offsetTop;
let startPosition = window.pageYOffset;
let distance = targetPosition - startPosition;
let startTime = null;