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

@@ -18,7 +18,7 @@ git clone git@git.sr.ht:~svlad_cjelli/onTheSpectrum
cd onTheSpectrum
# bun install all dependencies
bun i
bun i
# bun run with bun backend
bun --bun run dev --open

View File

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

View File

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

View File

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

View File

@@ -1,15 +1,17 @@
export const xAxes = [
const xAxes = [
{ values: ["Traditional", "Experimental"], adult: false },
{ values: ["Budget", "Luxury"], adult: false },
{ values: ["Old", "New"], adult: false },
{ values: ["Simple", "Complex"], adult: false },
{ values: ["Minimal", "Maximal"], adult: false },
// Adult axes
{ values: ["Beer", "Cocktails"], adult: true },
{ values: ["Swipe-happy", "Selective"], adult: true },
{ values: ["Casual", "Serious"], adult: true },
// Add more X axes here...
// Format: { values: ["Left extreme", "Right extreme"], adult: true/false }
];
];
export default xAxes;

View File

@@ -1,15 +1,17 @@
export const yAxes = [
const yAxes = [
{ values: ["Thin", "Thick"], adult: false },
{ values: ["Planned", "Spontaneous"], adult: false },
{ values: ["Calm", "Upbeat"], adult: false },
{ values: ["Indoor", "Outdoor"], adult: false },
{ values: ["Solo", "Group"], adult: false },
// Adult axes
{ values: ["Occasional", "Frequent"], adult: true },
{ values: ["Hookups", "Relationships"], adult: true },
{ values: ["Private", "Public"], adult: true },
// Add more Y axes here...
// 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.
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);
}
.theme-win95 .title-bar {
background: linear-gradient(to right, #000080, #1084d0);
color: white;
padding: 8px;
font-weight: bold;
}
.title-bar {
background: linear-gradient(to right, #000080, #1084d0);
color: white;
padding: 8px;
font-weight: bold;
}
.theme-win95 fieldset {
border: 2px groove #c0c0c0;
}
fieldset {
border: 2px groove #c0c0c0;
}
.theme-win95 button {
background: #c0c0c0;

View File

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

View File

@@ -1,111 +1,108 @@
<script lang="ts">
import { goto } from '$app/navigation';
function navigate(page: string) {
goto(`/${page}`);
}
</script>
<div class="home-container">
<div class="home-content">
<h1 class="title">On the Spectrum!</h1>
<p class="subtitle">Well...are ya?</p>
<div class="tabs">
<button class="tab-button" on:click={() => navigate('play')}>
<span class="tab-icon">🎮</span>
<span>Play</span>
</button>
<button class="tab-button" on:click={() => navigate('rules')}>
<span class="tab-icon">📖</span>
<span>Rules</span>
</button>
</div>
</div>
<div class="home-content">
<h1 class="title">On the Spectrum!</h1>
<p class="subtitle">Well...are ya?</p>
<div class="tabs">
<a href="/play" class="tab-button">
<span class="tab-icon">🎮</span>
<span>Play</span>
</a>
<a href="/rules" class="tab-button">
<span class="tab-icon">📖</span>
<span>Rules</span>
</a>
</div>
</div>
</div>
<style>
.home-container {
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
padding: 20px;
}
.home-container {
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
padding: 20px;
}
.home-content {
text-align: center;
max-width: 600px;
width: 100%;
}
.home-content {
text-align: center;
max-width: 600px;
width: 100%;
}
.title {
font-size: 3.5rem;
font-weight: bold;
color: white;
margin-bottom: 1rem;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
line-height: 1.2;
}
.title {
font-size: 3.5rem;
font-weight: bold;
color: white;
margin-bottom: 1rem;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
line-height: 1.2;
}
@media (max-width: 768px) {
.title {
font-size: 2.5rem;
}
}
@media (max-width: 768px) {
.title {
font-size: 2.5rem;
}
}
.subtitle {
font-size: 1.5rem;
color: rgba(255, 255, 255, 0.9);
margin-bottom: 3rem;
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}
.subtitle {
font-size: 1.5rem;
color: rgba(255, 255, 255, 0.9);
margin-bottom: 3rem;
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}
.tabs {
display: flex;
gap: 20px;
justify-content: center;
flex-wrap: wrap;
}
.tabs {
display: flex;
gap: 20px;
justify-content: center;
flex-wrap: wrap;
}
.tab-button {
background: white;
border: none;
border-radius: 15px;
padding: 30px 50px;
font-size: 1.5rem;
font-weight: bold;
cursor: pointer;
transition: all 0.3s ease;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
display: flex;
flex-direction: column;
align-items: center;
gap: 10px;
min-width: 200px;
}
.tab-button {
text-decoration: none;
background: white;
border: none;
border-radius: 15px;
padding: 30px 50px;
font-size: 1.5rem;
font-weight: bold;
cursor: pointer;
transition: all 0.3s ease;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
display: flex;
flex-direction: column;
align-items: center;
gap: 10px;
min-width: 200px;
}
.tab-button:hover {
transform: translateY(-5px);
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
}
.tab-button:hover {
transform: translateY(-5px);
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
}
.tab-icon {
font-size: 3rem;
}
.tab-icon {
font-size: 3rem;
}
@media (max-width: 768px) {
.tab-button {
padding: 20px 40px;
font-size: 1.2rem;
min-width: 150px;
}
@media (max-width: 768px) {
.tab-button {
padding: 20px 40px;
font-size: 1.2rem;
min-width: 150px;
}
.tab-icon {
font-size: 2rem;
}
}
</style>
.tab-icon {
font-size: 2rem;
}
}
</style>

View File

@@ -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}">

View File

@@ -1,18 +1,22 @@
import adapter from '@sveltejs/adapter-auto';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
import path from 'path'
/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://svelte.dev/docs/kit/integrations
// for more information about preprocessors
preprocess: vitePreprocess(),
// Consult https://svelte.dev/docs/kit/integrations
// for more information about preprocessors
preprocess: vitePreprocess(),
kit: {
// 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.
// See https://svelte.dev/docs/kit/adapters for more information about adapters.
adapter: adapter()
}
kit: {
// 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.
// See https://svelte.dev/docs/kit/adapters for more information about adapters.
adapter: adapter(),
alias: {
$components: path.resolve('./src/lib/components'),
}
}
};
export default config;
export default config;

View File

@@ -6,4 +6,4 @@ export default defineConfig({
server: {
port: 4321
}
});
});