Merge branch 'main' of git.sr.ht:~svlad_cjelli/onTheSpectrum

This commit is contained in:
Giac
2025-12-09 08:20:45 -06:00
16 changed files with 315 additions and 184 deletions

View File

@@ -3,7 +3,7 @@
</script> </script>
<div class="chart-display"> <div class="chart-display">
{#if chart} {#if chart.x != ''}
<div class="axis"> <div class="axis">
<div class="axis-label">X-Axis (Horizontal)</div> <div class="axis-label">X-Axis (Horizontal)</div>
<div>{chart.x[0]}{chart.x[1]}</div> <div>{chart.x[0]}{chart.x[1]}</div>
@@ -13,6 +13,6 @@
<div>{chart.y[0]}{chart.y[1]}</div> <div>{chart.y[0]}{chart.y[1]}</div>
</div> </div>
{:else} {:else}
<div class="empty-state">Click Generate!</div> <p class="empty-state">Click Generate!</p>
{/if} {/if}
</div> </div>

View File

@@ -1,11 +1,11 @@
<script> <script>
export let roll; export let diceRoll;
</script> </script>
<div class="dice-display"> <div class="dice-display">
{#if roll} {#if diceRoll.x != 0}
<div class="dice-emoji">🎲 🎲</div> <div class="dice-emoji">🎲 🎲</div>
<div class="dice-result">X: {roll.x} | Y: {roll.y}</div> <div class="dice-result">X: {diceRoll.x} | Y: {diceRoll.y}</div>
{:else} {:else}
<div class="empty-state">Click Roll!</div> <div class="empty-state">Click Roll!</div>
{/if} {/if}
@@ -24,3 +24,4 @@
text-align: center; text-align: center;
} }
</style> </style>

View File

@@ -3,13 +3,16 @@
export let currentTheme; export let currentTheme;
</script> </script>
<fieldset>
<legend>Theme Selector</legend>
<div class="button-row"> <div class="button-row">
{#each themeNames as theme} {#each themes as theme}
<button <button
on:click={() => currentTheme = theme} on:click={() => currentTheme = theme}
class:active={currentTheme === theme} class:active={currentTheme === theme}
> >
{themeDisplayNames[theme]} {theme.charAt(0).toUpperCase() + theme.slice(1)}
</button> </button>
{/each} {/each}
</div> </div>

View File

@@ -1,4 +1,4 @@
export const xAxes = [ const xAxes = [
{ values: ["Traditional", "Experimental"], adult: false }, { values: ["Traditional", "Experimental"], adult: false },
{ values: ["Budget", "Luxury"], adult: false }, { values: ["Budget", "Luxury"], adult: false },
{ values: ["Old", "New"], adult: false }, { values: ["Old", "New"], adult: false },
@@ -13,3 +13,5 @@ export const xAxes = [
// Add more X axes here... // Add more X axes here...
// Format: { values: ["Left extreme", "Right extreme"], adult: true/false } // Format: { values: ["Left extreme", "Right extreme"], adult: true/false }
]; ];
export default xAxes;

View File

@@ -1,4 +1,4 @@
export const yAxes = [ const yAxes = [
{ values: ["Thin", "Thick"], adult: false }, { values: ["Thin", "Thick"], adult: false },
{ values: ["Planned", "Spontaneous"], adult: false }, { values: ["Planned", "Spontaneous"], adult: false },
{ values: ["Calm", "Upbeat"], adult: false }, { values: ["Calm", "Upbeat"], adult: false },
@@ -13,3 +13,5 @@ export const yAxes = [
// Add more Y axes here... // Add more Y axes here...
// Format: { values: ["Bottom extreme", "Top extreme"], adult: true/false } // Format: { values: ["Bottom extreme", "Top extreme"], adult: true/false }
]; ];
export default yAxes;

View File

@@ -1 +1,3 @@
// place files you want to import through the `$lib` alias in this folder. // place files you want to import through the `$lib` alias in this folder.
export { default as xAxes } from './data/xAxes.js'
export { default as yAxes } from './data/yAxes.js'

View File

@@ -0,0 +1,52 @@
/* Cyberpunk Theme */
:global{
body:has(.theme-cyberpunk){
background: #0a0e27;
}
.theme-cyberpunk {
font-family: 'Courier New', monospace;
background: #0a0e27;
color: #00ffff;
.dice-display {
background: rgba(0, 255, 255, 0.05);
border: 1px solid #00ffff;
}
.window{
background: rgba(10, 14, 39, 0.95);
border: 2px solid #00ffff;
box-shadow: 0 0 20px #ff00ff;
}
.title-bar {
background: linear-gradient(90deg, #ff00ff, #00ffff);
color: #000;
padding: 12px;
font-weight: bold;
text-transform: uppercase;
}
fieldset {
border: 1px solid #ff00ff;
}
legend {
color: #ff00ff;
text-transform: uppercase;
}
button {
background: transparent;
border: 2px solid #ff00ff;
color: #ff00ff;
font-family: 'Courier New', monospace;
text-transform: uppercase;
padding: 10px 25px;
&:hover {
background: #ff00ff;
color: #000;
}
}
.chart-display {
background: rgba(0, 255, 255, 0.05);
border: 1px solid #00ffff;
}
}
}

View File

@@ -0,0 +1,52 @@
/* Vaporwave Theme */
:global(.theme-vaporwave) {
font-family: 'Arial', sans-serif;
background: linear-gradient(180deg, #ff6ad5 0%, #c774e8 50%, #ad8cff 100%);
color: #fff;
}
:global(.theme-vaporwave .window) {
background: rgba(255, 106, 213, 0.3);
backdrop-filter: blur(10px);
border: 3px solid #00f0ff;
box-shadow: 0 8px 32px rgba(0, 240, 255, 0.4);
}
:global(.theme-vaporwave .title-bar) {
background: linear-gradient(90deg, #ff6ad5, #00f0ff);
color: #fff;
padding: 15px;
text-align: center;
text-transform: uppercase;
letter-spacing: 4px;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}
:global(.theme-vaporwave fieldset) {
border: 2px solid #00f0ff;
background: rgba(255, 255, 255, 0.1);
}
:global(.theme-vaporwave legend) {
color: #00f0ff;
text-transform: uppercase;
}
:global(.theme-vaporwave button) {
background: linear-gradient(135deg, #ff6ad5, #c774e8);
border: 2px solid #00f0ff;
color: #fff;
text-transform: uppercase;
padding: 12px 30px;
}
:global(.theme-vaporwave .chart-display ){
background: rgba(255, 255, 255, 0.15);
border: 2px solid #ff6ad5;
}
:global{
.theme-vaporwave .dice-display {
background: rgba(255, 255, 255, 0.15);
border: 2px solid #ff6ad5;
}
}

View File

@@ -10,14 +10,14 @@
box-shadow: 2px 2px 0 rgba(0,0,0,0.5); box-shadow: 2px 2px 0 rgba(0,0,0,0.5);
} }
.theme-win95 .title-bar { .title-bar {
background: linear-gradient(to right, #000080, #1084d0); background: linear-gradient(to right, #000080, #1084d0);
color: white; color: white;
padding: 8px; padding: 8px;
font-weight: bold; font-weight: bold;
} }
.theme-win95 fieldset { fieldset {
border: 2px groove #c0c0c0; border: 2px groove #c0c0c0;
} }

View File

@@ -1,6 +1,8 @@
<script lang="ts"> <script lang="ts">
import favicon from '$lib/assets/favicon.svg'; import favicon from '$lib/assets/favicon.svg';
import ThemeSelector from '$components/themeSelector.svelte';
let currentTheme = $state('win95');
let { children } = $props(); let { children } = $props();
</script> </script>
@@ -8,26 +10,50 @@
<link rel="icon" href={favicon} /> <link rel="icon" href={favicon} />
</svelte:head> </svelte:head>
<nav> <!-- <svelte:body class="theme-{currentTheme}" /> -->
<h1>On the Spectrum</h1>
<nav class="title-bar theme-{currentTheme}">
<h1><a href="/">On the Spectrum</a></h1>
<ul> <ul>
<li><a href="/">Home</a></li>
<li><a href="play">Play</a></li> <li><a href="play">Play</a></li>
<li><a href="rules">Rules</a></li> <li><a href="rules">Rules</a></li>
<li><a href="submit">Submit</a></li> <li><a href="submit">Submit</a></li>
</ul> </ul>
<ThemeSelector bind:currentTheme />
</nav> </nav>
<section> <section class="theme-{currentTheme}">
{@render children()} {@render children()}
</section> </section>
<style> <style>
@import '$lib/styles/cyberpunk.css';
@import '$lib/styles/nightmare.css';
@import '$lib/styles/nintendo.css';
@import '$lib/styles/typewriter.css';
@import '$lib/styles/vaporwave.css';
@import '$lib/styles/win95.css';
:global(body) {
margin: 0;
height: 100vh;
}
nav { nav {
display: inline-flex; display: inline-flex;
width: 100vw;
a {
text-decoration: none;
font-weight: 600;
&:visited {
color: inherit;
}
&:hover {
color: oklch(0.6 0.186 25);
}
}
ul { ul {
list-style: none; list-style: none;
padding: none;
display: inline-flex; display: inline-flex;
gap: 1rem; gap: 1rem;
align-items: end; align-items: end;

View File

@@ -1,9 +1,4 @@
<script lang="ts"> <script lang="ts">
import { goto } from '$app/navigation';
function navigate(page: string) {
goto(`/${page}`);
}
</script> </script>
<div class="home-container"> <div class="home-container">
@@ -12,14 +7,14 @@
<p class="subtitle">Well...are ya?</p> <p class="subtitle">Well...are ya?</p>
<div class="tabs"> <div class="tabs">
<button class="tab-button" on:click={() => navigate('play')}> <a href="/play" class="tab-button">
<span class="tab-icon">🎮</span> <span class="tab-icon">🎮</span>
<span>Play</span> <span>Play</span>
</button> </a>
<button class="tab-button" on:click={() => navigate('rules')}> <a href="/rules" class="tab-button">
<span class="tab-icon">📖</span> <span class="tab-icon">📖</span>
<span>Rules</span> <span>Rules</span>
</button> </a>
</div> </div>
</div> </div>
</div> </div>
@@ -70,6 +65,7 @@
} }
.tab-button { .tab-button {
text-decoration: none;
background: white; background: white;
border: none; border: none;
border-radius: 15px; border-radius: 15px;
@@ -109,3 +105,4 @@
} }
} }
</style> </style>

View File

@@ -1,21 +1,15 @@
<script> <script>
import { goto } from '$app/navigation'; import { xAxes, yAxes } from '$lib';
import { xAxes } from '$lib/data/xAxes.js'; import ChartDisplay from '$components/chartDisplay.svelte';
import { yAxes } from '$lib/data/yAxes.js'; import DiceRoller from '$components/diceRoller.svelte';
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';
let adultMode = $state(false);
let currentTheme = 'win95'; let currentChart = $state({ x: [''], y: [''] });
let adultMode = false; let diceRoll = $state({ x: 0, y: 0 });
let currentChart = null;
let diceRoll = null;
function generateChart() { function generateChart() {
const availableXAxes = adultMode ? xAxes : xAxes.filter(axis => !axis.adult); const availableXAxes = adultMode ? xAxes : xAxes.filter((axis) => !axis.adult);
const availableYAxes = adultMode ? yAxes : yAxes.filter(axis => !axis.adult); const availableYAxes = adultMode ? yAxes : yAxes.filter((axis) => !axis.adult);
const randomX = availableXAxes[Math.floor(Math.random() * availableXAxes.length)]; const randomX = availableXAxes[Math.floor(Math.random() * availableXAxes.length)];
const randomY = availableYAxes[Math.floor(Math.random() * availableYAxes.length)]; const randomY = availableYAxes[Math.floor(Math.random() * availableYAxes.length)];
@@ -32,10 +26,6 @@
y: Math.floor(Math.random() * 10) + 1 y: Math.floor(Math.random() * 10) + 1
}; };
} }
function goHome() {
goto('/');
}
</script> </script>
<div class="container theme-{currentTheme}"> <div class="container theme-{currentTheme}">

View File

@@ -1,5 +1,6 @@
import adapter from '@sveltejs/adapter-auto'; import adapter from '@sveltejs/adapter-auto';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'; import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
import path from 'path'
/** @type {import('@sveltejs/kit').Config} */ /** @type {import('@sveltejs/kit').Config} */
const config = { const config = {
@@ -11,7 +12,10 @@ const config = {
// adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list. // adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list.
// If your environment is not supported, or you settled on a specific environment, switch out the adapter. // If your environment is not supported, or you settled on a specific environment, switch out the adapter.
// See https://svelte.dev/docs/kit/adapters for more information about adapters. // See https://svelte.dev/docs/kit/adapters for more information about adapters.
adapter: adapter() adapter: adapter(),
alias: {
$components: path.resolve('./src/lib/components'),
}
} }
}; };