Skip to content

Commit

Permalink
run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
Kractero committed Oct 2, 2023
1 parent 0105774 commit a084046
Show file tree
Hide file tree
Showing 12 changed files with 107 additions and 115 deletions.
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: {}
}
};
74 changes: 28 additions & 46 deletions src/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,51 +5,33 @@
@tailwind utilities;

@layer base {
:root {
--color-primary: 255 255 255;
--color-secondary: 229 231 235;
--color-tertiary: 203 213 225;
--text-primary: 30 41 59;
--text-content: 71 85 105;
--card-text-primary: 15 23 42;
--card-text-secondary: 51 65 85;
--labels: 0 0 0;
--buttons: 255 255 255;
--herobuttons: 15 23 42;
--herobuttons-hover: 51 65 85;
}
:root {
--color-primary: 255 255 255;
--color-secondary: 229 231 235;
--color-tertiary: 203 213 225;
--text-primary: 30 41 59;
--text-content: 71 85 105;
--card-text-primary: 15 23 42;
--card-text-secondary: 51 65 85;
--labels: 0 0 0;
--buttons: 255 255 255;
--herobuttons: 15 23 42;
--herobuttons-hover: 51 65 85;
}

@media (prefers-color-scheme: dark) {
:root {
--color-primary: 30 41 59;
--color-secondary: 226 232 240;
--color-tertiary: 148 163 184;
--text-primary: 255 255 255;
--text-content: 214 211 209;
--card-text-primary: 15 23 42;
--card-text-secondary: 51 65 85;
--labels: 0 0 0;
--buttons: 0 0 0;
--herobuttons: 14 165 223;
--herobuttons-hover: 56 189 248;
}
}
@media (prefers-color-scheme: dark) {
:root {
--color-primary: 30 41 59;
--color-secondary: 226 232 240;
--color-tertiary: 148 163 184;
--text-primary: 255 255 255;
--text-content: 214 211 209;
--card-text-primary: 15 23 42;
--card-text-secondary: 51 65 85;
--labels: 0 0 0;
--buttons: 0 0 0;
--herobuttons: 14 165 223;
--herobuttons-hover: 56 189 248;
}
}
}

.clienthide {
opacity: 0;
transform: translateX(-100%);
transition: all 1s;
}

@media (prefers-reduced-motion) {
.clienthide {
transition: none;
}
}

.show {
opacity: 1;
transform: translateX(0);
transition: all 1s;
}
26 changes: 13 additions & 13 deletions src/app.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
<meta name="viewport" content="width=device-width" />
%sveltekit.head%
</head>

<head>
<meta charset="utf-8" />
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
<meta name="viewport" content="width=device-width" />
%sveltekit.head%
</head>

<body class="flex flex-col items-center min-h-screen text-textprimary bg-background font-notosans p-2 mb-16"
data-sveltekit-preload-data="hover">
<div style="display: contents">%sveltekit.body%</div>
</body>

</html>
<body
class="flex flex-col items-center min-h-screen text-textprimary bg-background font-notosans p-2 mb-16"
data-sveltekit-preload-data="hover"
>
<div style="display: contents">%sveltekit.body%</div>
</body>
</html>
24 changes: 14 additions & 10 deletions src/component/Tool.svelte
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
<script>
export let slug = "";
export let tool = "";
export let description = "";
export let slug = '';
export let tool = '';
export let description = '';
</script>
<a href={`/tools/${slug}`} class="text-cardprimarytext mt-16 rounded-sm bg-content w-60 p-4 flex flex-col items-start">
<div class="flex items-center text-xl font-semi-bold">
<img alt={tool} src={`${tool}.png`} />
{tool}
</div>
<p class="text-cardsecondarytext text-sm">{description}</p>
</a>

<a
href={`/tools/${slug}`}
class="text-cardprimarytext mt-16 rounded-sm bg-content w-60 p-4 flex flex-col items-start border border-black transition duration-200 hover:shadow-lg hover:scale-105"
>
<div class="flex items-center text-xl font-semi-bold">
<img alt={tool} src={`${tool}.png`} />
{tool}
</div>
<p class="text-cardsecondarytext text-sm">{description}</p>
</a>
8 changes: 4 additions & 4 deletions src/globals.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { XMLParser } from "fast-xml-parser";
import { XMLParser } from 'fast-xml-parser';

export const parser = new XMLParser({ignoreAttributes : false});
export const parser = new XMLParser({ ignoreAttributes: false });

export function sleep(ms: number) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
return new Promise((resolve) => setTimeout(resolve, ms));
}
20 changes: 13 additions & 7 deletions src/lib/htmlContent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ export const htmlContent = (content: string, style?: string, sortFunction?: stri
<html>
<head>
<style>
${style ? style :
`
${
style
? style
: `
td.createcol p {
padding-left: 10em;
}
Expand Down Expand Up @@ -36,14 +38,17 @@ export const htmlContent = (content: string, style?: string, sortFunction?: stri
tr:hover {
background-color: lightgrey;
}
`}
`
}
</style>
</head>
<body>
<table>
${content}
${sortFunction ? "" :
`
${
sortFunction
? ''
: `
<tr>
<td>
<p>
Expand All @@ -56,7 +61,8 @@ export const htmlContent = (content: string, style?: string, sortFunction?: stri
</p>
</td>
</tr>
`}
`
}
</table>
<script>
document.querySelectorAll("td").forEach(function(el) {
Expand All @@ -66,7 +72,7 @@ export const htmlContent = (content: string, style?: string, sortFunction?: stri
row.parentNode.removeChild(row);
});
});
${sortFunction || ""}
${sortFunction || ''}
</script>
</body>
</html>
Expand Down
4 changes: 2 additions & 2 deletions src/lib/sortFunctionString.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ sortableColumns.forEach(col => {
col.setAttribute('data-order', newOrder);
});
});
`
`;
export let style = `
body {
font-size: 14px;
Expand Down Expand Up @@ -71,4 +71,4 @@ a {
a:hover {
text-decoration: underline;
}
`
`;
6 changes: 3 additions & 3 deletions src/lib/txtIterator.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export async function nsIterator(puppets: string, mode: string, main?: string) {
let puppetsList = puppets.split('\n');
let buildString = '';
let containerise_nation = '';
let containerise_container = '';
let containerise_nation = '';
let containerise_container = '';
for (let i = 0; i < puppetsList.length; i++) {
let nation = puppetsList[i];
if (nation.includes(',')) {
Expand All @@ -19,5 +19,5 @@ export async function nsIterator(puppets: string, mode: string, main?: string) {
}</p></td><td><p><a target="_blank" href="https://www.nationstates.net/nation=${nation_formatted}/page=upload_flag/test=1/User_agent=${main}">Link to Nation</a></p></td></tr>`;
}
}
return mode === 'Container Rules' ? [containerise_nation, containerise_container]: buildString;
return mode === 'Container Rules' ? [containerise_nation, containerise_container] : buildString;
}
2 changes: 1 addition & 1 deletion src/routes/+layout.server.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const prerender = true;
export const prerender = true;
2 changes: 1 addition & 1 deletion src/routes/+layout.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const prerender = true;
export const prerender = true;
2 changes: 1 addition & 1 deletion src/routes/navigation.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
});
});
});
</script>
</script>
44 changes: 22 additions & 22 deletions tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
/** @type {import('tailwindcss').Config} */
export default {
content: ['./src/**/*.{html,js,svelte,ts}'],
theme: {
extend: {
colors: {
background: 'rgb(var(--color-primary) / <alpha-value>)',
content: 'rgb(var(--color-secondary) / <alpha-value>)',
tertiary: 'rgb(var(--color-tertiary) / <alpha-value>)',
textprimary: 'rgb(var(--text-primary) / <alpha-value>)',
textcontent: 'rgb(var(--text-content) / <alpha-value>)',
cardprimarytext: 'rgb(var(--card-text-primary) / <alpha-value>)',
cardsecondarytext: 'rgb(var(--card-text-secondary) / <alpha-value>)',
label: 'rgb(var(--labels) / <alpha-value>)',
herobuttons: 'rgb(var(--herobuttons) / <alpha-value>)',
herobuttonshover: 'rgb(var(--herobuttons-hover) / <alpha-value>)',
buttons: 'rgb(var(--buttons) / <alpha-value>)'
},
fontFamily: {
notosans: ['Noto Sans', 'sans-serif']
}
},
},
}
content: ['./src/**/*.{html,js,svelte,ts}'],
theme: {
extend: {
colors: {
background: 'rgb(var(--color-primary) / <alpha-value>)',
content: 'rgb(var(--color-secondary) / <alpha-value>)',
tertiary: 'rgb(var(--color-tertiary) / <alpha-value>)',
textprimary: 'rgb(var(--text-primary) / <alpha-value>)',
textcontent: 'rgb(var(--text-content) / <alpha-value>)',
cardprimarytext: 'rgb(var(--card-text-primary) / <alpha-value>)',
cardsecondarytext: 'rgb(var(--card-text-secondary) / <alpha-value>)',
label: 'rgb(var(--labels) / <alpha-value>)',
herobuttons: 'rgb(var(--herobuttons) / <alpha-value>)',
herobuttonshover: 'rgb(var(--herobuttons-hover) / <alpha-value>)',
buttons: 'rgb(var(--buttons) / <alpha-value>)'
},
fontFamily: {
notosans: ['Noto Sans', 'sans-serif']
}
}
}
};

0 comments on commit a084046

Please sign in to comment.