updated some stuff to work on my PC.

deleteed the emoji from the rules.
moved the titlebar and stuff out from the pages to the layout so it gets
applied everywere. will need to work on the title changing but that
should be easy.
This commit is contained in:
2025-12-09 11:41:29 -06:00
parent 0b9ec24d75
commit a146104658
7 changed files with 390 additions and 407 deletions

View File

@@ -1,9 +1,10 @@
<script> <script>
export let chart; export let chart;
console.log(chart, chart.x != [''], chart.x);
</script> </script>
<div class="chart-display"> <div class="chart-display">
{#if chart && chart.x && chart.y} {#if chart.x.length > 1}
<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>
@@ -16,3 +17,4 @@
<div class="empty-state">Click Generate!</div> <div class="empty-state">Click Generate!</div>
{/if} {/if}
</div> </div>

View File

@@ -5,10 +5,7 @@
<div class="button-row"> <div class="button-row">
{#each themeNames as theme} {#each themeNames as theme}
<button <button on:click={() => (currentTheme = theme)} class:active={currentTheme === theme}>
on:click={() => currentTheme = theme}
class:active={currentTheme === theme}
>
{themeDisplayNames[theme]} {themeDisplayNames[theme]}
</button> </button>
{/each} {/each}
@@ -17,9 +14,12 @@
<style> <style>
.button-row { .button-row {
display: flex; display: flex;
gap: 10px; gap: 1rem;
justify-content: center; justify-content: center;
flex-wrap: wrap; flex-wrap: wrap;
margin-top: 10px; button {
max-width: 33%;
}
} }
</style> </style>

View File

@@ -1,7 +1,6 @@
/* Base styles that apply to all themes */ /* Base styles that apply to all themes */
.container { .container {
padding: 20px; padding: 2rem;
min-height: 100vh;
} }
.window { .window {
@@ -17,6 +16,9 @@
display: flex; display: flex;
align-items: center; align-items: center;
gap: 15px; gap: 15px;
span{
margin: 0 auto;
}
} }
.home-button { .home-button {
@@ -81,6 +83,5 @@ button {
.empty-state { .empty-state {
font-style: italic; font-style: italic;
text-align: center; text-align: center;
padding: 20px;
opacity: 0.7; opacity: 0.7;
} }

View File

@@ -8,13 +8,23 @@
setContext('theme', theme); setContext('theme', theme);
let currentTheme; let currentTheme;
theme.subscribe(value => { theme.subscribe((value) => {
currentTheme = value; currentTheme = value;
}); });
</script> </script>
<div class="app-container theme-{currentTheme}"> <div class="app-container theme-{currentTheme}">
<div class="wrapper">
<div class="container">
<div class="window">
<div class="title-bar">
<a href="/" class="back-button">←Back</a>
<span>A Sludge & Friends game</span>
</div>
<slot /> <slot />
</div>
</div>
</div>
</div> </div>
<style> <style>
@@ -22,8 +32,33 @@
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
.back-button {
padding: 5px 15px;
cursor: pointer;
border-radius: 4px;
text-decoration: none;
color: inherit;
font-weight: bold;
transition: all 0.2s;
}
.wrapper {
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
padding: 20px;
}
.container {
width: 100%;
max-width: 700px;
}
.window {
width: 100%;
}
.app-container { .app-container {
min-height: 100vh; min-height: 100vh;
} }
</style> </style>

View File

@@ -1,6 +1,6 @@
<script> <script>
import { getContext } from 'svelte'; import { getContext } from 'svelte';
import ThemeSelector from '$lib/components/ThemeSelector.svelte'; import ThemeSelector from '$components/themeSelector.svelte';
const themeStore = getContext('theme'); const themeStore = getContext('theme');
let currentTheme = $themeStore; let currentTheme = $themeStore;
@@ -8,23 +8,18 @@
$: themeStore.set(currentTheme); $: themeStore.set(currentTheme);
</script> </script>
<div class="home-wrapper"> <div class="home-content">
<div class="home-container">
<div class="home-window">
<div class="home-title-bar">
<span>A Sludge & Friends game</span>
</div>
<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">
<a href="/play" class="tab-button"> <a href="/play" class="tab-button">
<span class="tab-icon">Play</span> <span class="tab-icon">🎮</span>
<span>Play</span>
</a> </a>
<a href="/rules" class="tab-button"> <a href="/rules" class="tab-button">
<span class="tab-icon">Rules</span> <span class="tab-icon">📖</span>
<span>Rules</span>
</a> </a>
</div> </div>
@@ -34,29 +29,9 @@
<ThemeSelector bind:currentTheme /> <ThemeSelector bind:currentTheme />
</fieldset> </fieldset>
</div> </div>
</div>
</div>
</div>
</div> </div>
<style> <style>
.home-wrapper {
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
padding: 20px;
}
.home-container {
width: 100%;
max-width: 700px;
}
.home-window {
width: 100%;
}
.home-content { .home-content {
padding: 40px; padding: 40px;
text-align: center; text-align: center;

View File

@@ -1,25 +1,15 @@
<script> <script>
import { getContext } from 'svelte'; 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 '$components/ChartDisplay.svelte';
import DiceRoller from '$components/DiceRoller.svelte';
import ThemeSelector from '$components/ThemeSelector.svelte';
import Toggle from '$components/Toggle.svelte';
const theme = getContext('theme'); let adultMode = $state(false);
let currentTheme; let currentChart = $state({ x: [''], y: [''] });
theme.subscribe(value => { let diceRoll = $state({ x: 0, y: 0 });
currentTheme = value;
});
let adultMode = false;
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)];
@@ -40,37 +30,55 @@
<div class="container"> <div class="container">
<div class="window"> <div class="window">
<div class="title-bar">
<a href="/" class="home-button">← Home</a>
<span>On the Spectrum - Party Game</span>
</div>
<div class="window-body">
<!-- <fieldset>
<legend>Adult Mode (18+)</legend>
<Toggle bind:checked={adultMode} />
</fieldset> -->
<fieldset> <fieldset>
<legend>Chart Generator</legend> <legend>Chart Generator</legend>
<ChartDisplay chart={currentChart} /> <ChartDisplay chart={currentChart} />
<div class="button-row"> <div class="button-row">
<button on:click={generateChart}>Generate</button> <button onclick={generateChart}>Generate</button>
</div> </div>
</fieldset> </fieldset>
<fieldset> <fieldset>
<legend>Position Roller</legend> <legend>Position Roller</legend>
<DiceRoller roll={diceRoll} /> <DiceRoller {diceRoll} />
<div class="button-row"> <div class="button-row">
<button on:click={rollDice}>Roll Dice</button> <button onclick={rollDice}>Roll Dice</button>
</div> </div>
</fieldset> </fieldset>
<fieldset>
<legend>Theme Selector</legend>
<ThemeSelector bind:currentTheme={$theme} />
</fieldset>
</div>
</div> </div>
</div> </div>
<style>
.window {
max-width: 60rem;
margin: 0 auto;
padding: 1.5rem;
display: flex;
flex-direction: column;
gap: 1rem;
}
fieldset {
padding: 1.25rem;
margin: 0;
}
legend {
font-weight: bold;
padding: 0 0.5rem;
}
.button-row {
display: flex;
gap: 10px;
justify-content: center;
margin-top: 10px;
}
button {
padding: 0.5rem 1.75rem;
cursor: pointer;
font-weight: bold;
}
</style>

View File

@@ -1,6 +1,6 @@
<script> <script>
import { getContext } from 'svelte'; import { getContext } from 'svelte';
import ThemeSelector from '$lib/components/ThemeSelector.svelte'; import ThemeSelector from '$components/themeSelector.svelte';
const themeStore = getContext('theme'); const themeStore = getContext('theme');
let currentTheme = $themeStore; let currentTheme = $themeStore;
@@ -8,15 +8,7 @@
$: themeStore.set(currentTheme); $: themeStore.set(currentTheme);
</script> </script>
<div class="rules-wrapper"> <div class="window-body">
<div class="rules-container">
<div class="window">
<div class="title-bar">
<a href="/" class="back-button">← Back</a>
<span>Rules</span>
</div>
<div class="window-body">
<fieldset> <fieldset>
<legend>Theme Selector</legend> <legend>Theme Selector</legend>
<ThemeSelector bind:currentTheme /> <ThemeSelector bind:currentTheme />
@@ -28,8 +20,15 @@
<section> <section>
<h2>Basic Gameplay</h2> <h2>Basic Gameplay</h2>
<ol> <ol>
<li><strong>Generate:</strong> Click "Generate" to create a random 2D spectrum with X and Y axes</li> <li>
<li><strong>Play:</strong>Have the clue-giver roll 2d10 with one d10 being X and the other d10 being Y (The axes run 1-10 with 5 being the centerline on each). Try to select a phrase-person-vibe that fits the X,Y coordinates you just rolled and inform the other players.</li> <strong>Generate:</strong> Click "Generate" to create a random 2D spectrum with X and Y axes
</li>
<li>
<strong>Play:</strong>Have the clue-giver roll 2d10 with one d10 being X and the other d10
being Y (The axes run 1-10 with 5 being the centerline on each). Try to select a
phrase-person-vibe that fits the X,Y coordinates you just rolled and inform the other
players.
</li>
<li><strong>Repeat:</strong> Generate a new spectrum and keep playing!</li> <li><strong>Repeat:</strong> Generate a new spectrum and keep playing!</li>
</ol> </ol>
</section> </section>
@@ -75,54 +74,30 @@
<section> <section>
<h2>FAQ</h2> <h2>FAQ</h2>
<p><strong>Can I play solo?</strong><br> <p>
While designed for groups, you can use it for self-reflection or to prep for game night!</p> <strong>Can I play solo?</strong><br />
While designed for groups, you can use it for self-reflection or to prep for game night!
</p>
<p><strong>How many spectrums are there?</strong><br> <p>
Hundreds! The X and Y axes are randomly combined, creating thousands of possible spectrums.</p> <strong>How many spectrums are there?</strong><br />
Hundreds! The X and Y axes are randomly combined, creating thousands of possible spectrums.
</p>
<p><strong>What if I'm perfectly neutral?</strong><br> <p>
Mark yourself at 5 or 6 on that axis. True neutrality is rare and interesting!</p> <strong>What if I'm perfectly neutral?</strong><br />
Mark yourself at 5 or 6 on that axis. True neutrality is rare and interesting!
</p>
<p><strong>Can we make our own rules?</strong><br> <p>
Absolutely! These are guidelines. House rules are encouraged!</p> <strong>Can we make our own rules?</strong><br />
Absolutely! These are guidelines. House rules are encouraged!
</p>
</section> </section>
</div> </div>
</div>
</div>
</div>
</div> </div>
<style> <style>
.rules-wrapper {
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
padding: 40px 20px;
}
.rules-container {
width: 100%;
max-width: 900px;
}
.title-bar {
display: flex;
align-items: center;
gap: 15px;
}
.back-button {
padding: 5px 15px;
cursor: pointer;
border-radius: 4px;
text-decoration: none;
color: inherit;
font-weight: bold;
transition: all 0.2s;
}
.rules-content { .rules-content {
padding: 20px 0; padding: 20px 0;
} }
@@ -139,12 +114,6 @@
margin-bottom: 15px; margin-bottom: 15px;
} }
h3 {
font-size: 1.3rem;
margin-top: 20px;
margin-bottom: 10px;
}
section { section {
margin-bottom: 30px; margin-bottom: 30px;
} }
@@ -154,7 +123,8 @@
margin-bottom: 10px; margin-bottom: 10px;
} }
ol, ul { ol,
ul {
line-height: 1.8; line-height: 1.8;
padding-left: 25px; padding-left: 25px;
} }
@@ -167,15 +137,7 @@
font-weight: bold; font-weight: bold;
} }
em {
font-style: italic;
}
@media (max-width: 768px) { @media (max-width: 768px) {
.rules-wrapper {
padding: 20px;
}
h1 { h1 {
font-size: 2rem; font-size: 2rem;
} }