From 3feb091fc16b8f823b3c64964afe8c0c790b4ae1 Mon Sep 17 00:00:00 2001
From: Dante Catalfamo
Date: Fri, 3 Jul 2020 15:32:37 -0400
Subject: Add deploy script
---
braille.js | 67 ----------------------------------------------------
deploy.sh | 4 ++++
index.html | 70 -------------------------------------------------------
lambda.js | 70 -------------------------------------------------------
public/braille.js | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++
public/index.html | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
public/lambda.js | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
7 files changed, 211 insertions(+), 207 deletions(-)
delete mode 100644 braille.js
create mode 100755 deploy.sh
delete mode 100644 index.html
delete mode 100644 lambda.js
create mode 100644 public/braille.js
create mode 100644 public/index.html
create mode 100644 public/lambda.js
diff --git a/braille.js b/braille.js
deleted file mode 100644
index fe81c6e..0000000
--- a/braille.js
+++ /dev/null
@@ -1,67 +0,0 @@
-"use strict";
-
-const OUTHEIGHT = 30;
-const OUTWIDTH = 2 * OUTHEIGHT;
-const HEIGHT = 3 * OUTHEIGHT;
-const WIDTH = 2 * OUTWIDTH;
-const BRAILLE = [
- "⠀", "⠁", "⠂", "⠃", "⠄", "⠅", "⠆", "⠇", "⠈", "⠉", "⠊", "⠋", "⠌", "⠍", "⠎", "⠏",
- "⠐", "⠑", "⠒", "⠓", "⠔", "⠕", "⠖", "⠗", "⠘", "⠙", "⠚", "⠛", "⠜", "⠝", "⠞", "⠟",
- "⠠", "⠡", "⠢", "⠣", "⠤", "⠥", "⠦", "⠧", "⠨", "⠩", "⠪", "⠫", "⠬", "⠭", "⠮", "⠯",
- "⠰", "⠱", "⠲", "⠳", "⠴", "⠵", "⠶", "⠷", "⠸", "⠹", "⠺", "⠻", "⠼", "⠽", "⠾", "⠿",
-];
-
-let board = new Array(HEIGHT);
-for (let i = 0; i < HEIGHT; i++) {
- board[i] = new Array(WIDTH);
-}
-
-function render(board) {
- const out = new Array(OUTHEIGHT);
- for (let i = 0; i < OUTHEIGHT; i++) {
- out[i] = new Array(OUTWIDTH);
- }
- for (let y = 0; y < HEIGHT; y += 3) {
- for (let x = 0; x < WIDTH; x += 2) {
- let outx = x/2;
- let outy = y/3;
- let tl = board[y][x] ? 1 : 0;
- let ml = board[y+1][x] ? 1 : 0;
- let bl = board[y+2][x] ? 1 : 0;
- let tr = board[y][x+1] ? 1 : 0;
- let mr = board[y+1][x+1] ? 1 : 0;
- let br = board[y+2][x+1] ? 1 : 0;
- let idx = tl*1 + ml*2 + bl*4 + tr*8 + mr*16 + br*32;
- let char = BRAILLE[idx];
- out[outy][outx] = char;
- }
- }
- return out.reduce((a, r) => a + r.reduce((a2, c) => a2 + c) + "\n", "");
-}
-
-function renderFunction(board, fun, frame) {
- for (let y = 0; y < HEIGHT; y++) {
- for (let x = 0; x < WIDTH; x++) {
- board[y][x] = fun(x, y, frame) ? true : null;
- }
- }
- return render(board);
-}
-
-function fun(x, y, frame) {
- const l = HEIGHT / 3;
- const m1 = Math.abs(y+frame) % l;
- const m2 = Math.abs(y-frame) % l;
- return x == m1 ||
- x == m2 ||
- x/2 == m1 + l/2 ||
- x/2 == m2 + l/2 ||
- x == m1 + 3*l ||
- x == m2 + 3*l;
-}
-
-const br = document.getElementById("braille");
-let frame = HEIGHT;
-const interval = setInterval(() => {
- br.innerHTML = renderFunction(board, fun, frame++);
-}, 50);
diff --git a/deploy.sh b/deploy.sh
new file mode 100755
index 0000000..50e8fc1
--- /dev/null
+++ b/deploy.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+cd "$(dirname "$0")"
+rsync -va --progress --delete --rsync-path="/usr/bin/openrsync" public/ blog@lambda.cx:/var/www/htdocs/lambda.cx/
diff --git a/index.html b/index.html
deleted file mode 100644
index ef3909f..0000000
--- a/index.html
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
- lambda.cx home
-
-
-
-
-
-
-
-
diff --git a/lambda.js b/lambda.js
deleted file mode 100644
index 85037c3..0000000
--- a/lambda.js
+++ /dev/null
@@ -1,70 +0,0 @@
-function coss(height, width, theta) {
- let amplitude = height/2;
- let period = width;
- let dx = Math.PI/width;
- let yVal = [];
- let x = theta;
-
- for(let i=0;iλ";
- } else if ((x < halfWidth) && (Math.abs(negy-y) < thick)) {
- out += "λ";
- } else {
- out += " ";
- }
- }
- out += "\n";
- }
- return out;
-}
-
-function putlam(el, height, width, min, max, period) {
- let amp = max-min;
- const f = function() {
- let percent = (Math.sin(((new Date).getTime()/period)) + 1) / 2;
- let thick = (amp * percent) + min;
- el.innerHTML = lamby(height, width, thick);
- };
- window.setInterval(f, 100);
-}
-
-let lamEl = document.querySelector('.lambda');
-putlam(lamEl, 45, 45, 0.3, 4.5, 450);
-
-
-`
-00
- 0
- 0
- 0 0
- 0 0
-0 00
-
-0
- 0
-0 0
-
-_
- \
- \
- /\
- / \
- / \
-/ \_
-`;
diff --git a/public/braille.js b/public/braille.js
new file mode 100644
index 0000000..fe81c6e
--- /dev/null
+++ b/public/braille.js
@@ -0,0 +1,67 @@
+"use strict";
+
+const OUTHEIGHT = 30;
+const OUTWIDTH = 2 * OUTHEIGHT;
+const HEIGHT = 3 * OUTHEIGHT;
+const WIDTH = 2 * OUTWIDTH;
+const BRAILLE = [
+ "⠀", "⠁", "⠂", "⠃", "⠄", "⠅", "⠆", "⠇", "⠈", "⠉", "⠊", "⠋", "⠌", "⠍", "⠎", "⠏",
+ "⠐", "⠑", "⠒", "⠓", "⠔", "⠕", "⠖", "⠗", "⠘", "⠙", "⠚", "⠛", "⠜", "⠝", "⠞", "⠟",
+ "⠠", "⠡", "⠢", "⠣", "⠤", "⠥", "⠦", "⠧", "⠨", "⠩", "⠪", "⠫", "⠬", "⠭", "⠮", "⠯",
+ "⠰", "⠱", "⠲", "⠳", "⠴", "⠵", "⠶", "⠷", "⠸", "⠹", "⠺", "⠻", "⠼", "⠽", "⠾", "⠿",
+];
+
+let board = new Array(HEIGHT);
+for (let i = 0; i < HEIGHT; i++) {
+ board[i] = new Array(WIDTH);
+}
+
+function render(board) {
+ const out = new Array(OUTHEIGHT);
+ for (let i = 0; i < OUTHEIGHT; i++) {
+ out[i] = new Array(OUTWIDTH);
+ }
+ for (let y = 0; y < HEIGHT; y += 3) {
+ for (let x = 0; x < WIDTH; x += 2) {
+ let outx = x/2;
+ let outy = y/3;
+ let tl = board[y][x] ? 1 : 0;
+ let ml = board[y+1][x] ? 1 : 0;
+ let bl = board[y+2][x] ? 1 : 0;
+ let tr = board[y][x+1] ? 1 : 0;
+ let mr = board[y+1][x+1] ? 1 : 0;
+ let br = board[y+2][x+1] ? 1 : 0;
+ let idx = tl*1 + ml*2 + bl*4 + tr*8 + mr*16 + br*32;
+ let char = BRAILLE[idx];
+ out[outy][outx] = char;
+ }
+ }
+ return out.reduce((a, r) => a + r.reduce((a2, c) => a2 + c) + "\n", "");
+}
+
+function renderFunction(board, fun, frame) {
+ for (let y = 0; y < HEIGHT; y++) {
+ for (let x = 0; x < WIDTH; x++) {
+ board[y][x] = fun(x, y, frame) ? true : null;
+ }
+ }
+ return render(board);
+}
+
+function fun(x, y, frame) {
+ const l = HEIGHT / 3;
+ const m1 = Math.abs(y+frame) % l;
+ const m2 = Math.abs(y-frame) % l;
+ return x == m1 ||
+ x == m2 ||
+ x/2 == m1 + l/2 ||
+ x/2 == m2 + l/2 ||
+ x == m1 + 3*l ||
+ x == m2 + 3*l;
+}
+
+const br = document.getElementById("braille");
+let frame = HEIGHT;
+const interval = setInterval(() => {
+ br.innerHTML = renderFunction(board, fun, frame++);
+}, 50);
diff --git a/public/index.html b/public/index.html
new file mode 100644
index 0000000..ef3909f
--- /dev/null
+++ b/public/index.html
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+ lambda.cx home
+
+
+
+
+
+
+
+
diff --git a/public/lambda.js b/public/lambda.js
new file mode 100644
index 0000000..85037c3
--- /dev/null
+++ b/public/lambda.js
@@ -0,0 +1,70 @@
+function coss(height, width, theta) {
+ let amplitude = height/2;
+ let period = width;
+ let dx = Math.PI/width;
+ let yVal = [];
+ let x = theta;
+
+ for(let i=0;iλ";
+ } else if ((x < halfWidth) && (Math.abs(negy-y) < thick)) {
+ out += "λ";
+ } else {
+ out += " ";
+ }
+ }
+ out += "\n";
+ }
+ return out;
+}
+
+function putlam(el, height, width, min, max, period) {
+ let amp = max-min;
+ const f = function() {
+ let percent = (Math.sin(((new Date).getTime()/period)) + 1) / 2;
+ let thick = (amp * percent) + min;
+ el.innerHTML = lamby(height, width, thick);
+ };
+ window.setInterval(f, 100);
+}
+
+let lamEl = document.querySelector('.lambda');
+putlam(lamEl, 45, 45, 0.3, 4.5, 450);
+
+
+`
+00
+ 0
+ 0
+ 0 0
+ 0 0
+0 00
+
+0
+ 0
+0 0
+
+_
+ \
+ \
+ /\
+ / \
+ / \
+/ \_
+`;
--
cgit v1.2.3