Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…dchickens into hanya/timelinestyle
  • Loading branch information
azaleacolburn committed Nov 5, 2024
2 parents 6bf3fb0 + 783123e commit d43785c
Show file tree
Hide file tree
Showing 13 changed files with 122 additions and 70 deletions.
7 changes: 7 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
22 changes: 22 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Format

on:
push:
pull_request:

jobs:
format:
runs-on: ubuntu-latest
name: Format Files
steps:
- uses: actions/checkout@v3
- uses: oven-sh/setup-bun@v2
- run: bun install
- name: Prettier
run: bun run format ./src
env:
GITHUB_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
- uses: stefanzweifel/git-auto-commit-action@v4
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
with:
commit_message: 'style: format files'
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# inflatedchickens

## usage

```bash
# install dependencies
bun i
Expand Down
Binary file modified bun.lockb
Binary file not shown.
10 changes: 5 additions & 5 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
plugins: {
tailwindcss: {},
autoprefixer: {}
}
};
20 changes: 10 additions & 10 deletions src/app.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="flamingChicken.png" />
<meta name="viewport" content="width=device-width" />
%sveltekit.head%
</head>
<body data-sveltekit-preload-data="hover">
<div style="display: contents">%sveltekit.body%</div>
</body>
<head>
<meta charset="utf-8" />
<link rel="icon" href="flamingChicken.png" />
<meta name="viewport" content="width=device-width" />
%sveltekit.head%
</head>
<body data-sveltekit-preload-data="hover">
<div style="display: contents">%sveltekit.body%</div>
</body>
</html>
22 changes: 19 additions & 3 deletions src/lib/components/Action.svelte
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
<script lang="ts">
import type { ActionData } from '$lib/types';
let { action = $bindable(), deleteself }: { action: ActionData; deleteself: () => void } = $props()
let { action = $bindable(), deleteself }: { action: ActionData; deleteself: () => void } =
$props();
let actionBorderColor = $derived(action.result === 'success' ? 'border-cresc_green' : 'border-fail_red');
let actionBorderColor = $derived(
action.result === 'success' ? 'border-cresc_green' : 'border-fail_red'
);
let actionBackgroundColor = $derived(
action.result === 'success' ? 'bg-cresc_green' : 'bg-fail_red'
);
</script>

<button class="{actionBorderColor} w-full p-1 rounded border-2 text-text_yellow" onclick={deleteself}>
<!-- <button -->
<!-- class="{actionBorderColor} w-full p-1 rounded border-2 text-text_yellow" -->
<!-- onclick={deleteself} -->
<!-- > -->
<!-- {action.type} -->
<!-- </button> -->

<button
class="{actionBackgroundColor} w-full p-1 rounded border-2 border-outline_gray text-text_white"
onclick={deleteself}
>
{action.type}
</button>
10 changes: 7 additions & 3 deletions src/lib/components/Timeline.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@
import type { ActionData } from '$lib/types';
import Action from './Action.svelte';
let { actions = $bindable() }: { actions: ActionData[] } = $props()
let { actions = $bindable() }: { actions: ActionData[] } = $props();
// let latestActions: ActionData[] = $derived(actions.toReversed().slice(0, 5));
</script>

<h1 class="text-text_red">Timeline</h1>
<div class="flex flex-col items-center h-full bg-btn_grey border-solid border-2 border-text_red p-2 rounded gap-2 w-full overflow-auto">
<div
class="flex flex-col items-center h-full bg-btn_grey border-solid border-2 border-text_red p-2 rounded gap-2 w-full overflow-auto"
>
{#each actions as _, i}
<Action
bind:action={actions[i]}
deleteself={() => {
actions.splice(i, 1);
actions.splice(actions.indexOf(actions[i]), 1);
}}
/>
{/each}
Expand Down
24 changes: 12 additions & 12 deletions src/lib/types.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
export enum actionType {
IntakeTote = 'Intake Tote',
EjectTote = 'Eject Tote',
IntakeBalloon = 'Intake Balloon',
ScoreLow = 'Score Low',
ScoreExternalTote = 'Score External Tote',
ScoreInternalTote = 'Score Internal Tote',
ScoreAnotherRobotsTote = 'Score Another Robots Tote'
IntakeTote = 'Intake Tote',
EjectTote = 'Eject Tote',
IntakeBalloon = 'Intake Balloon',
ScoreLow = 'Score Low',
ScoreExternalTote = 'Score External Tote',
ScoreInternalTote = 'Score Internal Tote',
ScoreAnotherRobotsTote = 'Score Another Robots Tote'
}

export enum actionResult {
success = 'success',
fail = 'fail'
success = 'success',
fail = 'fail'
}

export type ActionData = {
type: actionType;
result: actionResult;
}
type: actionType;
result: actionResult;
};
9 changes: 5 additions & 4 deletions src/routes/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<script>
let { children } = $props();
import "../app.css";
import '../app.css';
</script>

{@render children()}

<style lang="postcss">
:global(body) {
@apply bg-bg_gray;
@apply bg-bg_gray;
@apply font-mono;
touch-action: manipulation;
}
</style>

{@render children()}
12 changes: 5 additions & 7 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<div class="flex flex-col items-center justify-evenly h-dvh">
<h1 class="text-center text-text_red text-5xl font-bold">
hiiii :3
</h1>
<a class="text-center text-text_yellow text-2xl rounded bg-btn_grey px-4 py-2 font-bold border-solid border-2 border-text_red" href="/scout">
scout
</a>
<div class="flex flex-col items-center justify-evenly h-dvh text-text_white">
<h1 class="text-center text-5xl font-bold">hiiii :3</h1>
<a class="text-center text-2xl rounded bg-btn_grey px-4 py-2 font-bold" href="/scout">
scout
</a>
</div>
17 changes: 10 additions & 7 deletions src/routes/scout/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,20 @@
function addAction() {
//everything here is for testing, as there is no system for this yet
latestActions.push({ type: actionType.ScoreAnotherRobotsTote, result: actionResult.success });
latestActions.push({ type: actionType.EjectTote, result: actionResult.fail });
latestActions.push({ type: actionType.IntakeTote, result: actionResult.success });
actions.push({ type: actionType.ScoreAnotherRobotsTote, result: actionResult.success });
actions.push({ type: actionType.EjectTote, result: actionResult.fail });
actions.push({ type: actionType.IntakeTote, result: actionResult.success });
}
let latestActions: ActionData[] = $state([]);
let actions: ActionData[] = $state([]);
</script>

<main class="flex flex-col items-center gap-2 p-2 justify-center h-screen">
<Timeline bind:actions={latestActions} />
<Timeline bind:actions />

<!--to be changed in the future-->
<button class="bg-btn_grey w-80 p-1 rounded border-2 border-text_red text-text_yellow" onclick={addAction}>Add Action</button>
<!--to be changed in the future-->
<button
class="bg-btn_grey w-80 p-1 rounded border-2 border-text_red text-text_yellow"
onclick={addAction}>Add Action</button
>
</main>
38 changes: 19 additions & 19 deletions tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
/** @type {import('tailwindcss').Config} */
export default {
content: ['./src/**/*.{html,js,svelte,ts}'],
theme: {
colors: {
"navbar_black": "#1c1c1c",
"outline_gray": "#ec4899",
"cresc_green": "#49A078",
"bg_gray": "#020617",
"slack_purple": "#4A154B",
"robot_blue": "#0083E6",
"robot_red": "#ED1C24",
"fail_red": "#FF6663",
"btn_grey": "#0f172a",
"text_red": "#FF4848",
"text_yellow": "#F6B14B",
},
extend: {},
},
plugins: [],
}
content: ['./src/**/*.{html,js,svelte,ts}'],
theme: {
colors: {
navbar_black: '#1c1c1c',
outline_gray: '#ec4899',
cresc_green: '#49A078',
bg_gray: '#020617',
slack_purple: '#4A154B',
robot_blue: '#0083E6',
robot_red: '#ED1C24',
fail_red: '#FF6663',
btn_grey: '#0f172a',
text_red: '#FF4848',
text_yellow: '#F6B14B'
},
extend: {}
},
plugins: []
};

0 comments on commit d43785c

Please sign in to comment.