Skip to content

Instantly share code, notes, and snippets.

View letscode.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
canvas{
border: 1px solid #000;
View noise.glsl
//
// Description : Array and textureless GLSL 2D/3D/4D simplex
// noise functions.
// Author : Ian McEwan, Ashima Arts.
// Maintainer : ijm
// Lastmod : 20110822 (ijm)
// License : Copyright (C) 2011 Ashima Arts. All rights reserved.
// Distributed under the MIT License. See LICENSE file.
// https://github.com/ashima/webgl-noise
//
@akella
akella / sw.js
Created Jan 22, 2021
sw boilerplate
View sw.js
// navigator.serviceWorker.register('sw.js');
var CACHE = "cache-name";
self.addEventListener("install", function (evt) {
console.log("Установка");
evt.waitUntil(precache());
});
View ProfiledContourGeometry.js
// from https://discourse.threejs.org/t/profiledcontourgeometry/2330
// Author: Prisoner849
function ProfiledContourGeometry(profileShape, contour, contourClosed, openEnded) {
contourClosed = contourClosed !== undefined ? contourClosed : true;
openEnded = openEnded !== undefined ? openEnded : false;
openEnded = contourClosed === true ? false : openEnded;
let profileGeometry = new THREE.ShapeBufferGeometry(profileShape);
@akella
akella / fwdays._final.js
Last active Sep 23, 2020
fwdays_final.js
View fwdays._final.js
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>canvas{border: 1px solid red}</style>
</head>
<body>
<h1>Hello fwdayds!!!! ;-)</h1>
View fwdays1.js
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>canvas{border: 1px solid red}</style>
</head>
<body>
<h1>Hello fwdayds!!!! ;-)</h1>
View color.js
let colors = ["#fe4a48","#2ab7ca","#fed766","#e6e6ea","#f4f4f8"]
View perlin.js
/*
* A speed-improved perlin and simplex noise algorithms for 2D.
*
* Based on example code by Stefan Gustavson (stegu@itn.liu.se).
* Optimisations by Peter Eastman (peastman@drizzle.stanford.edu).
* Better rank ordering method by Stefan Gustavson in 2012.
* Converted to Javascript by Joseph Gentle.
*
* Version 2012-03-09
*
View gist:8323102f3c9963b01bb6d7b41c17eb82
did:3:bafyreibmpz77bkvq7qavacrivzrq36glz57fd5g3rs4qb2acj3k3qwznnq
View sprite.glsl
void main() {
vec2 uv1 = vUv;
float uTime = vColor*time*10.;
vec2 offset = vec2(
floor(mod(uTime, 5.)),
4. - mod(floor(uTime / 5.), 5.)
);
uv1 = uv1 / 5.;
uv1 += offset/5.;