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

@@ -1,18 +1,18 @@
<script> <script>
export let chart; export let chart;
</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>
</div> </div>
<div class="axis"> <div class="axis">
<div class="axis-label">Y-Axis (Vertical)</div> <div class="axis-label">Y-Axis (Vertical)</div>
<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,14 +1,14 @@
<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}
</div> </div>
<style> <style>
@@ -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,16 +10,16 @@
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;
} }
.theme-win95 button { .theme-win95 button {
background: #c0c0c0; background: #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,111 +1,108 @@
<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">
<div class="home-content"> <div class="home-content">
<h1 class="title">On the Spectrum!</h1> <h1 class="title">On the Spectrum!</h1>
<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>
<style> <style>
.home-container { .home-container {
min-height: 100vh; min-height: 100vh;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
padding: 20px; padding: 20px;
} }
.home-content { .home-content {
text-align: center; text-align: center;
max-width: 600px; max-width: 600px;
width: 100%; width: 100%;
} }
.title { .title {
font-size: 3.5rem; font-size: 3.5rem;
font-weight: bold; font-weight: bold;
color: white; color: white;
margin-bottom: 1rem; margin-bottom: 1rem;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3); text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
line-height: 1.2; line-height: 1.2;
} }
@media (max-width: 768px) { @media (max-width: 768px) {
.title { .title {
font-size: 2.5rem; font-size: 2.5rem;
} }
} }
.subtitle { .subtitle {
font-size: 1.5rem; font-size: 1.5rem;
color: rgba(255, 255, 255, 0.9); color: rgba(255, 255, 255, 0.9);
margin-bottom: 3rem; margin-bottom: 3rem;
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2); text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
} }
.tabs { .tabs {
display: flex; display: flex;
gap: 20px; gap: 20px;
justify-content: center; justify-content: center;
flex-wrap: wrap; flex-wrap: wrap;
} }
.tab-button { .tab-button {
background: white; text-decoration: none;
border: none; background: white;
border-radius: 15px; border: none;
padding: 30px 50px; border-radius: 15px;
font-size: 1.5rem; padding: 30px 50px;
font-weight: bold; font-size: 1.5rem;
cursor: pointer; font-weight: bold;
transition: all 0.3s ease; cursor: pointer;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); transition: all 0.3s ease;
display: flex; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
flex-direction: column; display: flex;
align-items: center; flex-direction: column;
gap: 10px; align-items: center;
min-width: 200px; gap: 10px;
} min-width: 200px;
}
.tab-button:hover { .tab-button:hover {
transform: translateY(-5px); transform: translateY(-5px);
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3); box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white; color: white;
} }
.tab-icon { .tab-icon {
font-size: 3rem; font-size: 3rem;
} }
@media (max-width: 768px) { @media (max-width: 768px) {
.tab-button { .tab-button {
padding: 20px 40px; padding: 20px 40px;
font-size: 1.2rem; font-size: 1.2rem;
min-width: 150px; min-width: 150px;
} }
.tab-icon { .tab-icon {
font-size: 2rem; font-size: 2rem;
} }
} }
</style> </style>

View File

@@ -1,41 +1,31 @@
<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 currentChart = $state({ x: [''], y: [''] });
let diceRoll = $state({ x: 0, y: 0 });
let currentTheme = 'win95'; function generateChart() {
let adultMode = false; const availableXAxes = adultMode ? xAxes : xAxes.filter((axis) => !axis.adult);
let currentChart = null; const availableYAxes = adultMode ? yAxes : yAxes.filter((axis) => !axis.adult);
let diceRoll = null;
function generateChart() { const randomX = availableXAxes[Math.floor(Math.random() * availableXAxes.length)];
const availableXAxes = adultMode ? xAxes : xAxes.filter(axis => !axis.adult); const randomY = availableYAxes[Math.floor(Math.random() * availableYAxes.length)];
const availableYAxes = adultMode ? yAxes : yAxes.filter(axis => !axis.adult);
const randomX = availableXAxes[Math.floor(Math.random() * availableXAxes.length)]; currentChart = {
const randomY = availableYAxes[Math.floor(Math.random() * availableYAxes.length)]; x: randomX.values,
y: randomY.values
};
}
currentChart = { function rollDice() {
x: randomX.values, diceRoll = {
y: randomY.values x: Math.floor(Math.random() * 10) + 1,
}; y: Math.floor(Math.random() * 10) + 1
} };
}
function rollDice() {
diceRoll = {
x: 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,18 +1,22 @@
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 = {
// Consult https://svelte.dev/docs/kit/integrations // Consult https://svelte.dev/docs/kit/integrations
// for more information about preprocessors // for more information about preprocessors
preprocess: vitePreprocess(), preprocess: vitePreprocess(),
kit: { kit: {
// 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'),
}
}
}; };
export default config; export default config;