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, { useState } from "react"; | |
import posed from "react-pose"; | |
import "./App.css"; | |
const Box = posed.div({ | |
regular: { width: '10vw', height: '10vh', flip: true }, | |
fullscreen: { width: "100vw", height: '100vh', flip: true } | |
}); |
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, { useState } from "react"; | |
import posed from "react-pose"; | |
import "./App.css"; | |
export default function App() { | |
const [fullscreen, setFullscreen] = useState(false); | |
const toggle = () => setFullscreen(!fullscreen); | |
const pose = fullscreen ? 'fullscreen' : 'regular'; |
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
document.addEventListener("mousemove", event => { | |
const height = event.clientY / window.innerHeight; | |
const width = event.clientX / window.innerWidth; | |
updatePositions(height, width); | |
}); | |
window.addEventListener("deviceorientation", event => { | |
const height = -event.beta / 90; | |
const width = event.gamma / 180; |
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
MAX_TRANSLATE = 6; | |
const elements = [ | |
"background", "clouds", "back-mountain", "front-mountain", | |
"hills-4", "hills-3", "hills-2", "hills-1", "birds" | |
].map(klass => document.querySelector(`.${klass}`)); | |
function updatePositions(height, width) { | |
const maxVHTranslation = -height * MAX_TRANSLATE; |
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
<svg width="120" height="120" class="ring two"> | |
<circle class="path" cx="60" cy="60" | |
r="58" stroke="rgb(176, 168, 142)" | |
stroke-width="2" fill="none" /> | |
</svg> |
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
.ring.two { | |
stroke-dasharray: calc(2 * 3.1415 * 58); | |
stroke-dashoffset: calc(2 * 3.1415 * 58); | |
stroke-dashoffset: -calc(2 * 3.1415 * 58); | |
transform: rotate(-90deg); | |
transition: stroke-dashoffset linear 0.5s; | |
} | |
.button:hover .ring.two { | |
stroke-dashoffset: 0; |
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
""" | |
A MapKeyValue is a name-value pair retrieved from a map. | |
The name is a string, and the value can be anything at all. | |
""" | |
MapKeyValue = namedtuple("MapKeyValue", "key value") | |
""" | |
A MapEntrySpec is a specification for an entry in a Map. | |
The key is a number, the name is a string exposed to the user, |
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 Html exposing (text) | |
type Result a | |
= Return a | |
| Raise Exception | |
type alias Exception = | |
String |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <complex.h> | |
#define MAX_X 384 | |
#define MAX_Y 216 | |
#define X_LOWER -2.5 |
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
#include <stdio.h> | |
#include <stdlib.h> | |
void get_color(int i, int j, char color[]) { | |
static char r = 0, g = 0, b = 0; | |
r++; g--; b++; | |
color[0] = r; | |
color[1] = g; | |
color[2] = b; |