Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
70dcf9542d | ||
|
|
dfd2166284 | ||
|
|
232c543990 | ||
|
|
b4e14c1416 | ||
|
|
17eb9dfd64 | ||
|
|
50e5538ce8 | ||
|
|
6cd1ff4e04 | ||
|
|
7134654c9c | ||
|
|
998f3c3ba4 | ||
|
|
7da743d15a |
No files matched your search
@@ -0,0 +1,93 @@
|
||||
Copyright (c) 2023 Vercel, in collaboration with basement.studio
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
https://scripts.sil.org/OFL
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||
Binary file not shown.
Binary file not shown.
+41
@@ -0,0 +1,41 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Studio Vitali</title>
|
||||
<link rel="stylesheet" href="styles.css">
|
||||
<script src="main.js" defer></script>
|
||||
</head>
|
||||
<body>
|
||||
<canvas id="canvas" aria-hidden="true"></canvas>
|
||||
<header class="frame frame-block-start">
|
||||
<h1>Studio Vitali GmbH</h1>
|
||||
<a href="https://informatik.studiovitali.ch">Informatik</a>
|
||||
<a href="https://kunst.studiovitali.ch">Kunstwissenschaft</a>
|
||||
</header>
|
||||
<address class="frame frame-inline-end">
|
||||
<a href="mailto:[email protected]" title="E-Mail">[email protected]</a>
|
||||
<a href="tel:+41445201596" title="Telefon">+41 44 520 15 96</a>
|
||||
</address>
|
||||
<footer class="frame frame-block-end">
|
||||
<div class="legal">
|
||||
<!-- <a href="https://zefix.ch/de/search/entity/list/firm/1651152" title="Zefix">CHE-215.230.900</a> -->
|
||||
<a href="#impressum" title="Impressum">Impressum</a>
|
||||
<a href="#datenschutz" title="Datenschutz">Datenschutz</a>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<input id="hue" type="range" min="0" max="360" value="220" aria-label="Hue">
|
||||
<input id="lightness" type="range" min="0" max="100" value="50" aria-label="Lightness">
|
||||
<input id="weight" type="range" min="100" max="900" step="1" value="500" aria-label="Font weight">
|
||||
</div>
|
||||
</footer>
|
||||
<address class="frame frame-inline-start">
|
||||
<a href="https://maps.app.goo.gl/sgo7hm1Xa4DBFRAYA" title="Google Maps">
|
||||
<span>Lindenhofstrasse 17 — CH-8001 Zürich</span>
|
||||
</a>
|
||||
</address>
|
||||
<main>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,139 @@
|
||||
const root = document.documentElement;
|
||||
const canvas = document.querySelector("#canvas");
|
||||
const context = canvas.getContext("2d");
|
||||
const hue = document.querySelector("#hue");
|
||||
const lightness = document.querySelector("#lightness");
|
||||
const weight = document.querySelector("#weight");
|
||||
|
||||
const updateTokens = () => {
|
||||
root.style.setProperty("--color-hue", hue.value);
|
||||
root.style.setProperty("--color-lightness", `${lightness.value}%`);
|
||||
root.style.setProperty("--font-weight", weight.value);
|
||||
};
|
||||
|
||||
hue.addEventListener("input", updateTokens);
|
||||
lightness.addEventListener("input", updateTokens);
|
||||
weight.addEventListener("input", updateTokens);
|
||||
updateTokens();
|
||||
|
||||
let scale = window.devicePixelRatio || 1;
|
||||
|
||||
function resizeCanvas() {
|
||||
const previousScale = scale;
|
||||
const previous = document.createElement("canvas");
|
||||
const hadSize = canvas.dataset.sized === "true";
|
||||
|
||||
if (hadSize) {
|
||||
previous.width = canvas.width;
|
||||
previous.height = canvas.height;
|
||||
previous.getContext("2d").drawImage(canvas, 0, 0);
|
||||
}
|
||||
|
||||
scale = window.devicePixelRatio || 1;
|
||||
canvas.width = Math.round(window.innerWidth * scale);
|
||||
canvas.height = Math.round(window.innerHeight * scale);
|
||||
canvas.style.width = `${window.innerWidth}px`;
|
||||
canvas.style.height = `${window.innerHeight}px`;
|
||||
canvas.dataset.sized = "true";
|
||||
|
||||
context.setTransform(scale, 0, 0, scale, 0, 0);
|
||||
context.lineCap = "round";
|
||||
context.lineJoin = "round";
|
||||
|
||||
if (hadSize) {
|
||||
context.drawImage(
|
||||
previous,
|
||||
0,
|
||||
0,
|
||||
previous.width / previousScale,
|
||||
previous.height / previousScale,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const ink = () => getComputedStyle(document.body).color;
|
||||
const brushSize = () => Number(weight.value) / 100;
|
||||
|
||||
let drawing = false;
|
||||
let lastPoint = null;
|
||||
|
||||
canvas.addEventListener("pointerdown", (event) => {
|
||||
if (event.button !== 0) return;
|
||||
|
||||
drawing = true;
|
||||
lastPoint = { x: event.clientX, y: event.clientY };
|
||||
canvas.setPointerCapture(event.pointerId);
|
||||
|
||||
context.fillStyle = ink();
|
||||
context.beginPath();
|
||||
context.arc(
|
||||
lastPoint.x,
|
||||
lastPoint.y,
|
||||
brushSize() / 2,
|
||||
0,
|
||||
Math.PI * 2,
|
||||
);
|
||||
context.fill();
|
||||
});
|
||||
|
||||
canvas.addEventListener("pointermove", (event) => {
|
||||
if (!drawing || !lastPoint) return;
|
||||
|
||||
const nextPoint = { x: event.clientX, y: event.clientY };
|
||||
|
||||
context.strokeStyle = ink();
|
||||
context.lineWidth = brushSize();
|
||||
context.beginPath();
|
||||
context.moveTo(lastPoint.x, lastPoint.y);
|
||||
context.lineTo(nextPoint.x, nextPoint.y);
|
||||
context.stroke();
|
||||
|
||||
lastPoint = nextPoint;
|
||||
});
|
||||
|
||||
const STORAGE_KEY = "studio-vitali-canvas";
|
||||
|
||||
const saveDrawing = () => {
|
||||
try {
|
||||
localStorage.setItem(STORAGE_KEY, canvas.toDataURL());
|
||||
} catch {
|
||||
}
|
||||
};
|
||||
|
||||
const restoreDrawing = () => {
|
||||
let saved = null;
|
||||
|
||||
try {
|
||||
saved = localStorage.getItem(STORAGE_KEY);
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!saved) return;
|
||||
|
||||
const image = new Image();
|
||||
image.addEventListener("load", () => {
|
||||
context.drawImage(image, 0, 0, window.innerWidth, window.innerHeight);
|
||||
});
|
||||
image.src = saved;
|
||||
};
|
||||
|
||||
const stopDrawing = (event) => {
|
||||
if (!drawing) return;
|
||||
|
||||
drawing = false;
|
||||
lastPoint = null;
|
||||
|
||||
if (canvas.hasPointerCapture(event.pointerId)) {
|
||||
canvas.releasePointerCapture(event.pointerId);
|
||||
}
|
||||
|
||||
saveDrawing();
|
||||
};
|
||||
|
||||
canvas.addEventListener("pointerup", stopDrawing);
|
||||
canvas.addEventListener("pointercancel", stopDrawing);
|
||||
window.addEventListener("resize", resizeCanvas);
|
||||
|
||||
resizeCanvas();
|
||||
restoreDrawing();
|
||||
+209
@@ -0,0 +1,209 @@
|
||||
@font-face {
|
||||
font-family: "Geist";
|
||||
src: url("assets/fonts/geist-variable.woff2") format("woff2");
|
||||
font-weight: 100 900;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "Geist";
|
||||
src: url("assets/fonts/geist-italic-variable.woff2") format("woff2");
|
||||
font-weight: 100 900;
|
||||
font-style: italic;
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
:root {
|
||||
--font-sans: "Geist", system-ui, sans-serif;
|
||||
--color-paper: #ffffff;
|
||||
--color-hue: 220;
|
||||
--color-saturation: 85%;
|
||||
--color-lightness: 50%;
|
||||
--color-ink: hsl(var(--color-hue) var(--color-saturation) var(--color-lightness));
|
||||
--font-weight: 500;
|
||||
--gutter: clamp(0.4rem, 1vw, 0.8rem);
|
||||
|
||||
--control-size: 1rem;
|
||||
--control-border: solid 0.2rem var(--color-ink);
|
||||
}
|
||||
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
html {
|
||||
margin: 0;
|
||||
padding: var(--gutter);
|
||||
background-color: var(--color-paper);
|
||||
}
|
||||
|
||||
body {
|
||||
min-height: 100%;
|
||||
color: var(--color-ink);
|
||||
font-family: var(--font-sans);
|
||||
font-size: clamp(1rem, 2vw, 2rem);
|
||||
font-weight: var(--font-weight);
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
h1,
|
||||
h2,
|
||||
p,
|
||||
a {
|
||||
margin: 0;
|
||||
color: var(--color-ink);
|
||||
font-size: inherit;
|
||||
font-weight: inherit;
|
||||
text-box: trim-both cap alphabetic;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
address {
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
#canvas {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
cursor: crosshair;
|
||||
touch-action: none;
|
||||
}
|
||||
|
||||
.frame {
|
||||
position: fixed;
|
||||
display: flex;
|
||||
gap: 1.2rem;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.legal {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 1.2rem;
|
||||
}
|
||||
|
||||
.controls {
|
||||
display: flex;
|
||||
align-self: center;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
rotate: 180deg;
|
||||
}
|
||||
|
||||
.controls input[type="range"] {
|
||||
appearance: none;
|
||||
width: clamp(5rem, 12vw, 8rem);
|
||||
height: var(--control-size);
|
||||
padding: 0;
|
||||
border: 0;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#hue {
|
||||
--hue-preview: 50%;
|
||||
--range-track: linear-gradient(
|
||||
to right,
|
||||
hsl(0 var(--color-saturation) var(--hue-preview)),
|
||||
hsl(60 var(--color-saturation) var(--hue-preview)),
|
||||
hsl(120 var(--color-saturation) var(--hue-preview)),
|
||||
hsl(180 var(--color-saturation) var(--hue-preview)),
|
||||
hsl(240 var(--color-saturation) var(--hue-preview)),
|
||||
hsl(300 var(--color-saturation) var(--hue-preview)),
|
||||
hsl(360 var(--color-saturation) var(--hue-preview))
|
||||
);
|
||||
--range-thumb: hsl(
|
||||
var(--color-hue) var(--color-saturation) var(--hue-preview)
|
||||
);
|
||||
}
|
||||
|
||||
#lightness {
|
||||
--lightness-preview: calc(10% + var(--color-lightness) * 0.8);
|
||||
--range-track: linear-gradient(
|
||||
to right,
|
||||
hsl(var(--color-hue) var(--color-saturation) 10%) 0%,
|
||||
hsl(var(--color-hue) var(--color-saturation) var(--lightness-preview))
|
||||
var(--color-lightness),
|
||||
hsl(var(--color-hue) var(--color-saturation) 90%) 100%
|
||||
);
|
||||
--range-thumb: hsl(
|
||||
var(--color-hue) var(--color-saturation) var(--lightness-preview)
|
||||
);
|
||||
}
|
||||
|
||||
#weight {
|
||||
--range-track: linear-gradient(to right in oklab, #d9d9d9, #111111);
|
||||
--range-thumb: color-mix(
|
||||
in oklab,
|
||||
#d9d9d9 calc((900 - var(--font-weight)) / 8 * 1%),
|
||||
#111111
|
||||
);
|
||||
}
|
||||
|
||||
.controls input[type="range"]::-webkit-slider-runnable-track {
|
||||
height: 0.6rem;
|
||||
border-radius: 0.2rem;
|
||||
background: var(--range-track, #888888);
|
||||
}
|
||||
|
||||
.controls input[type="range"]::-webkit-slider-thumb {
|
||||
appearance: none;
|
||||
width: var(--control-size);
|
||||
height: var(--control-size);
|
||||
margin-top: -0.2rem;
|
||||
border: var(--control-border);
|
||||
border-color: var(--range-thumb, var(--color-ink));
|
||||
border-radius: 0.2rem;
|
||||
background: var(--color-paper);
|
||||
}
|
||||
|
||||
.controls input[type="range"]::-moz-range-track {
|
||||
height: 0.6rem;
|
||||
border-radius: 0.2rem;
|
||||
background: var(--range-track, #888888);
|
||||
}
|
||||
|
||||
.controls input[type="range"]::-moz-range-thumb {
|
||||
width: var(--control-size);
|
||||
height: var(--control-size);
|
||||
border: var(--control-border);
|
||||
border-color: var(--range-thumb, var(--color-ink));
|
||||
border-radius: 0.2rem;
|
||||
background: var(--color-paper);
|
||||
}
|
||||
|
||||
.controls input[type="range"]:focus-visible {
|
||||
outline: 0.1rem solid var(--color-ink);
|
||||
outline-offset: 0.1rem;
|
||||
}
|
||||
|
||||
.frame-block-start {
|
||||
inset: var(--gutter) auto auto var(--gutter);
|
||||
}
|
||||
|
||||
.frame-inline-end {
|
||||
inset: var(--gutter) var(--gutter) auto auto;
|
||||
writing-mode: vertical-rl;
|
||||
}
|
||||
|
||||
.frame-block-end {
|
||||
inset: auto var(--gutter) var(--gutter) var(--gutter);
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding-inline-end: 2.5rem;
|
||||
rotate: 180deg;
|
||||
}
|
||||
|
||||
.frame-inline-start {
|
||||
inset: auto auto var(--gutter) var(--gutter);
|
||||
writing-mode: sideways-lr;
|
||||
white-space: nowrap;
|
||||
}
|
||||
Reference in new issue
Block a user