mejorar CSP
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed

This commit is contained in:
Cat /dev/Nulo 2023-01-19 22:36:28 -03:00
parent 1690bffc78
commit 62726f7225
10 changed files with 165 additions and 143 deletions

View file

@ -1,11 +1,9 @@
<!doctype html> <!DOCTYPE html>
<meta charset=utf-8> <meta charset="utf-8" />
<meta name=viewport content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel=stylesheet href=https://nulo.in/drip.css> <link rel="stylesheet" href="https://nulo.in/drip.css" />
<link rel="stylesheet" href="https://nulo.in/center.css" />
<title>502 me caí :(</title> <title>502 me caí :(</title>
<style>
body { margin: auto; }
</style>
<h1>Me caí :( mala puerta de enlace</h1> <h1>Me caí :( mala puerta de enlace</h1>
<img src=se-cayó.jpg alt="Estx servidorx caídx al lado de unx que no"> <img src="se-cayó.jpg" alt="Estx servidorx caídx al lado de unx que no" />

View file

@ -1,92 +1,43 @@
<!doctype html> <!DOCTYPE html>
<meta charset=utf8> <meta charset="utf8" />
<meta name=viewport content='width=device-width, initial-scale=1.0'> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<style> <link rel="stylesheet" href="aaaaaaaaaaaaaaaaaaaaaaaaaaarainbow.html.css" />
body {
background: white;
color: #111;
font-family: sans-serif;
}
* {
margin: 0;
padding: 0;
}
html {
overflow: hidden;
}
#controls {
position: absolute;
}
</style>
<title>atr</title> <title>atr</title>
<div id=controls> <div id="controls">
<div class=coso> <div class="coso">
<label for=rect-width>rect width</label> <label for="rect-width">rect width</label>
<input name=rect-width id=rect-width type=range min=2 max=100> <input name="rect-width" id="rect-width" type="range" min="2" max="100" />
</div> </div>
<div class=coso> <div class="coso">
<label for=rect-height>rect height</label> <label for="rect-height">rect height</label>
<input name=rect-height id=rect-height type=range min=2 max=100> <input name="rect-height" id="rect-height" type="range" min="2" max="100" />
</div> </div>
<div class=coso> <div class="coso">
<label for=diff-x>diff x</label> <label for="diff-x">diff x</label>
<input name=diff-x id=diff-x type=range min=-100 max=100 step=0.1 value=10> <input
name="diff-x"
id="diff-x"
type="range"
min="-100"
max="100"
step="0.1"
value="10"
/>
</div> </div>
<div class=coso> <div class="coso">
<label for=diff-y>diff y</label> <label for="diff-y">diff y</label>
<input name=diff-y id=diff-y type=range min=-100 max=100 step=0.1 value=10> <input
name="diff-y"
id="diff-y"
type="range"
min="-100"
max="100"
step="0.1"
value="10"
/>
</div> </div>
</div> </div>
<canvas></canvas> <canvas></canvas>
<script> <script src="aaaaaaaaaaaaaaaaaaaaaaaaaaarainbow.html.js"></script>
const canvas = document.querySelector("canvas")
const ctx = canvas.getContext("2d", {
alpha: false,
})
function resizeCanvas () {
canvas.width = window.innerWidth
canvas.height = window.innerHeight
}
window.addEventListener("resize", resizeCanvas)
resizeCanvas()
function setupInput(inputId, setFunc) {
const input = document.getElementById(inputId)
input.addEventListener('input', event => {
setFunc(parseFloat(event.target.value))
})
setFunc(parseFloat(input.value))
}
let rect = { width: 50, height: 100 }
let diff = { x: 1, y: 1 }
setupInput('rect-width', val => rect.width = val)
setupInput('rect-height', val => rect.height = val)
setupInput('diff-x', val => diff.x = val)
setupInput('diff-y', val => diff.y = val)
function draw (time) {
const i = time / 10
ctx.clearRect(0, 0, canvas.width, canvas.height)
const actualDiff = { x: diff.x / rect.width, y: diff.y / rect.height }
for (let x = 0; x < canvas.width; x += rect.width) {
for (let y = 0; y < canvas.height; y += rect.height) {
ctx.fillStyle = `hsl(${i + x/rect.width*actualDiff.x + y/rect.height*actualDiff.y}, 100%, 50%)`
ctx.fillRect(x, y, rect.width, rect.height)
}
}
window.requestAnimationFrame(draw)
}
window.requestAnimationFrame(draw)
</script>

View file

@ -0,0 +1,17 @@
body {
background: white;
color: #111;
font-family: sans-serif;
}
* {
margin: 0;
padding: 0;
}
html {
overflow: hidden;
}
#controls {
position: absolute;
}

View file

@ -0,0 +1,48 @@
const canvas = document.querySelector("canvas");
const ctx = canvas.getContext("2d", {
alpha: false,
});
function resizeCanvas() {
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
}
window.addEventListener("resize", resizeCanvas);
resizeCanvas();
function setupInput(inputId, setFunc) {
const input = document.getElementById(inputId);
input.addEventListener("input", (event) => {
setFunc(parseFloat(event.target.value));
});
setFunc(parseFloat(input.value));
}
let rect = { width: 50, height: 100 };
let diff = { x: 1, y: 1 };
setupInput("rect-width", (val) => (rect.width = val));
setupInput("rect-height", (val) => (rect.height = val));
setupInput("diff-x", (val) => (diff.x = val));
setupInput("diff-y", (val) => (diff.y = val));
function draw(time) {
const i = time / 10;
ctx.clearRect(0, 0, canvas.width, canvas.height);
const actualDiff = { x: diff.x / rect.width, y: diff.y / rect.height };
for (let x = 0; x < canvas.width; x += rect.width) {
for (let y = 0; y < canvas.height; y += rect.height) {
ctx.fillStyle = `hsl(${
i + (x / rect.width) * actualDiff.x + (y / rect.height) * actualDiff.y
}, 100%, 50%)`;
ctx.fillRect(x, y, rect.width, rect.height);
}
}
window.requestAnimationFrame(draw);
}
window.requestAnimationFrame(draw);

3
center.css Normal file
View file

@ -0,0 +1,3 @@
body {
margin: auto;
}

View file

@ -117,3 +117,8 @@ a {
text-align: right; text-align: right;
font-size: 0.8rem; font-size: 0.8rem;
} }
.main-title {
style=color: red;
margin-top: 0;
}

View file

@ -1,4 +1,4 @@
<h1 style=color:red;margin-top:0>nulo❥in</h1> <h1 class="main-title">nulo❥in</h1>
>What's bizarre? I mean, we're all pretty bizarre.<br>Some of us are just better at hiding it, that's all. >What's bizarre? I mean, we're all pretty bizarre.<br>Some of us are just better at hiding it, that's all.

View file

@ -1,56 +1,21 @@
<!doctype html> <!DOCTYPE html>
<meta charset=utf-8> <meta charset="utf-8" />
<meta name=viewport content='width=device-width, initial-scale=1.0'> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel=stylesheet href=https://nulo.in/drip.css> <link rel="stylesheet" href="https://nulo.in/drip.css" />
<link rel="stylesheet" href="timer.html.css" />
<title>Timer de guita</title> <title>Timer de guita</title>
<style>
body {
display: flex;
min-height: 100vh;
justify-content: center;
align-items: center;
padding: 0;
}
main {
text-align: center;
padding: 0 1em;
}
input {
width: 5em;
}
</style>
<main> <main>
<h1>Guita: <span id="guita" data-guita="0">$ 0.00</span></h1> <h1>Guita: <span id="guita" data-guita="0">$ 0.00</span></h1>
<div> <div>
<label for="por-hora">Guita por hora por persona:</label> <label for="por-hora">Guita por hora por persona:</label>
<input value="0" type="number" id="por-hora" /> <input value="0" type="number" id="por-hora" />
</div> </div>
<div> <div>
<label for="personas">Cantidad de personas:</label> <label for="personas">Cantidad de personas:</label>
<input value="1" type="number" id="personas" /> <input value="1" type="number" id="personas" />
</div> </div>
<button>Empezar</button> <button>Empezar</button>
</main> </main>
<script> <script src="timer.html.js"></script>
const guitaEl = document.querySelector('#guita')
const porHoraEl = document.querySelector('#por-hora')
const personasEl = document.querySelector('#personas')
const buttonEl = document.querySelector('button')
let interval = null
buttonEl.addEventListener('click', event => {
if (interval) {
clearInterval(interval)
buttonEl.textContent = 'Empezar'
} else {
interval = setInterval(() => {
guitaEl.dataset.guita = parseFloat(guitaEl.dataset.guita) + (porHoraEl.value / 60 / 60) * personasEl.value
guitaEl.textContent = `$ ${parseFloat(guitaEl.dataset.guita).toFixed(2)}`
}, 1000)
buttonEl.textContent = 'Parar'
}
})
</script>

14
timer.html.css Normal file
View file

@ -0,0 +1,14 @@
body {
display: flex;
min-height: 100vh;
justify-content: center;
align-items: center;
padding: 0;
}
main {
text-align: center;
padding: 0 1em;
}
input {
width: 5em;
}

21
timer.html.js Normal file
View file

@ -0,0 +1,21 @@
const guitaEl = document.querySelector("#guita");
const porHoraEl = document.querySelector("#por-hora");
const personasEl = document.querySelector("#personas");
const buttonEl = document.querySelector("button");
let interval = null;
buttonEl.addEventListener("click", (event) => {
if (interval) {
clearInterval(interval);
buttonEl.textContent = "Empezar";
} else {
interval = setInterval(() => {
guitaEl.dataset.guita =
parseFloat(guitaEl.dataset.guita) +
(porHoraEl.value / 60 / 60) * personasEl.value;
guitaEl.textContent = `$ ${parseFloat(guitaEl.dataset.guita).toFixed(2)}`;
}, 1000);
buttonEl.textContent = "Parar";
}
});