Merge branch 'main' of git.sr.ht:~svlad_cjelli/onTheSpectrum
This commit is contained in:
@@ -1,41 +1,31 @@
|
||||
<script>
|
||||
import { goto } from '$app/navigation';
|
||||
import { xAxes } from '$lib/data/xAxes.js';
|
||||
import { yAxes } from '$lib/data/yAxes.js';
|
||||
import ChartDisplay from '$lib/components/chartDisplay.svelte';
|
||||
import DiceRoller from '$lib/components/diceRoller.svelte';
|
||||
import ThemeSelector from '$lib/components/themeSelector.svelte';
|
||||
import Toggle from '$lib/components/toggle.svelte';
|
||||
import { xAxes, yAxes } from '$lib';
|
||||
import ChartDisplay from '$components/chartDisplay.svelte';
|
||||
import DiceRoller from '$components/diceRoller.svelte';
|
||||
|
||||
let adultMode = $state(false);
|
||||
let currentChart = $state({ x: [''], y: [''] });
|
||||
let diceRoll = $state({ x: 0, y: 0 });
|
||||
|
||||
let currentTheme = 'win95';
|
||||
let adultMode = false;
|
||||
let currentChart = null;
|
||||
let diceRoll = null;
|
||||
function generateChart() {
|
||||
const availableXAxes = adultMode ? xAxes : xAxes.filter((axis) => !axis.adult);
|
||||
const availableYAxes = adultMode ? yAxes : yAxes.filter((axis) => !axis.adult);
|
||||
|
||||
function generateChart() {
|
||||
const availableXAxes = adultMode ? xAxes : xAxes.filter(axis => !axis.adult);
|
||||
const availableYAxes = adultMode ? yAxes : yAxes.filter(axis => !axis.adult);
|
||||
|
||||
const randomX = availableXAxes[Math.floor(Math.random() * availableXAxes.length)];
|
||||
const randomY = availableYAxes[Math.floor(Math.random() * availableYAxes.length)];
|
||||
|
||||
currentChart = {
|
||||
x: randomX.values,
|
||||
y: randomY.values
|
||||
};
|
||||
}
|
||||
const randomX = availableXAxes[Math.floor(Math.random() * availableXAxes.length)];
|
||||
const randomY = availableYAxes[Math.floor(Math.random() * availableYAxes.length)];
|
||||
|
||||
function rollDice() {
|
||||
diceRoll = {
|
||||
x: Math.floor(Math.random() * 10) + 1,
|
||||
y: Math.floor(Math.random() * 10) + 1
|
||||
};
|
||||
}
|
||||
currentChart = {
|
||||
x: randomX.values,
|
||||
y: randomY.values
|
||||
};
|
||||
}
|
||||
|
||||
function goHome() {
|
||||
goto('/');
|
||||
}
|
||||
function rollDice() {
|
||||
diceRoll = {
|
||||
x: Math.floor(Math.random() * 10) + 1,
|
||||
y: Math.floor(Math.random() * 10) + 1
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="container theme-{currentTheme}">
|
||||
|
||||
Reference in New Issue
Block a user