Skip to content

Commit 9e03420

Browse files
committed
mostly finished welcome page
1 parent c892272 commit 9e03420

File tree

5 files changed

+130
-41
lines changed

5 files changed

+130
-41
lines changed

assets/global.css

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,25 @@
1818
--ease-out-func: cubic-bezier(0, 0.55, 0.45, 1);
1919
}
2020

21+
/* Dark Theme */
22+
23+
@media (prefers-color-scheme: dark) {
24+
:root {
25+
--light-color: #503016;
26+
--light-hover: #724623;
27+
--dark-color: #F9EBBB;
28+
--dark-hover: #FFF;
29+
--light-color-inverse: #F9EBBB;
30+
--light-hover-inverse: #FFF;
31+
--dark-color-inverse: #503016;
32+
--dark-hover-inverse: #724623;
33+
--list-bg-color: #F9EBBB10;
34+
--list-bg-alt-color: #F9EBBB10;
35+
--link-color: #3296D3;
36+
--link-hover: #7bc7f5;
37+
}
38+
}
39+
2140
/* General Rules */
2241

2342
* {
@@ -39,11 +58,22 @@
3958
}
4059

4160
html {
61+
display: flex;
62+
margin: 3rem;
63+
justify-content: center;
4264
background-color: var(--light-color);
4365
color: var(--dark-color);
4466
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
4567
}
4668

69+
body {
70+
display: flex;
71+
flex-direction: column;
72+
align-items: center;
73+
max-width: 64rem;
74+
margin: 0;
75+
}
76+
4777
.disabled, button:disabled {
4878
opacity: 0.25;
4979
pointer-events: none;
@@ -405,31 +435,4 @@ input[type="number"] {
405435
display: none;
406436
pointer-events: none;
407437
user-select: none;
408-
}
409-
410-
/* Dark Theme */
411-
412-
@media (prefers-color-scheme: dark) {
413-
:root {
414-
--light-color: #503016;
415-
--light-hover: #724623;
416-
--dark-color: #F9EBBB;
417-
--dark-hover: #FFF;
418-
--light-color-inverse: #F9EBBB;
419-
--light-hover-inverse: #FFF;
420-
--dark-color-inverse: #503016;
421-
--dark-hover-inverse: #724623;
422-
--list-bg-color: #F9EBBB10;
423-
--list-bg-alt-color: #F9EBBB10;
424-
--link-color: #3296D3;
425-
--link-hover: #7bc7f5;
426-
}
427-
428-
#logo-dark {
429-
display: none;
430-
}
431-
432-
#logo-light {
433-
display: initial;
434-
}
435438
}

components/Header.module.css

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
header {
2+
display: flex;
3+
}
4+
5+
.largeHeader {
6+
flex-direction: column;
7+
align-items: center;
8+
}
9+
10+
.smallHeader {
11+
gap: 1rem;
12+
flex-direction: row;
13+
align-items: center;
14+
}
15+
16+
.smallHeader > .logo {
17+
width: 8rem;
18+
}
19+
20+
.smallHeader .version {
21+
text-align: left;
22+
}
23+
24+
.logo {
25+
position: relative;
26+
display: flex;
27+
justify-content: center;
28+
align-items: center;
29+
width: 10rem;
30+
height: auto;
31+
aspect-ratio: 1 / 1;
32+
}
33+
34+
.logo > * {
35+
position: absolute;
36+
width: 100%;
37+
height: 100%;
38+
object-fit: contain;
39+
}
40+
41+
.title {
42+
margin: 0;
43+
}
44+
45+
.version {
46+
text-align: center;
47+
margin: 0.5rem 0;
48+
}
49+
50+
.extlinks {
51+
display: flex;
52+
justify-content: center;
53+
gap: 2rem;
54+
width: 100%;
55+
}

components/Header.tsx

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { Show } from "solid-js";
2+
3+
import style from './Header.module.css';
4+
5+
interface HeaderProps {
6+
style: string
7+
}
8+
9+
const Header = (props: HeaderProps) => {
10+
const headerStyle = () => props.style;
11+
12+
return (
13+
<header class={headerStyle() === "large" ? style.largeHeader : style.smallHeader}>
14+
<picture class={style.logo}>
15+
<source srcset="/light_256x.png" media="(prefers-color-scheme: dark)" />
16+
<img src="/dark_256x.png" />
17+
</picture>
18+
<div>
19+
<h1 class={style.title}>Auto Clear Cache</h1>
20+
<h3 class={style.version}>Version {browser.runtime.getManifest().version}</h3>
21+
<Show when={headerStyle() === "large"}>
22+
<nav class={style.extlinks}>
23+
<a href="https://github.com/JackDotJS/auto-clear-cache">GitHub</a>
24+
<a href="https://jackdotjs.github.io/">My Website</a>
25+
</nav>
26+
</Show>
27+
</div>
28+
</header>
29+
);
30+
};
31+
32+
export default Header;
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.welcome {
2+
text-align: center;
3+
font-size: 4rem;
4+
}

entrypoints/welcome/PageWelcome.tsx

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,20 @@
1-
const PageWelcome = () => {
1+
import { Component } from "solid-js";
2+
import Header from '~/components/Header';
3+
4+
import style from './PageWelcome.module.css';
5+
6+
const PageWelcome: Component = () => {
27
return (
38
<>
4-
<header>
5-
<img id="logo-light" src="../../icon/light_256x.png" />
6-
<img id="logo-dark" src="../../icon/dark_256x.png" />
7-
<h1>Auto Clear Cache</h1>
8-
<footer>
9-
<span id="ext-version">Version ...</span>
10-
<div id="links">
11-
<a href="https://github.com/JackDotJS/auto-clear-cache">GitHub</a>
12-
<a href="https://jackdotjs.github.io/">My Website</a>
13-
</div>
14-
</footer>
15-
</header>
9+
<Header style="small"/>
1610
<main>
17-
<h1>Welcome!</h1>
11+
<h1 class={style.welcome}>Welcome!</h1>
1812
<p>Thanks for installing my web extension! I've spent countless hours developing this, so I hope it works well for you. Before you leave, there's a few things you should know:</p>
1913
<h2>This extension does nothing until you explicitly tell it to.</h2>
2014
<p>Throughout the development this extension, I've made a rule to avoid touching any browser data until the user (that's you!) gives explicit permission to. I don't want to be responsible for any unintentional data loss, so you should take a minute to go through the options page and make sure everything is set up to your heart's content.</p>
2115
<h2>Despite my best efforts, some things may break</h2>
2216
<p>I'm never gonna claim to be a good developer, but I do try my best to make things work. If you find a bug, I strongly encourage you to write a bug report on this project's GitHub repository.</p>
17+
{/* TODO: github and website links here */}
2318
</main>
2419
</>
2520
);

0 commit comments

Comments
 (0)