Skip to content

Commit

Permalink
Merge pull request #9 from loxygenK/feat/introduction
Browse files Browse the repository at this point in the history
✨ Add <Introduction /> page
  • Loading branch information
loxygenK authored Oct 13, 2021
2 parents afed284 + 2d95aa0 commit 6ca2353
Show file tree
Hide file tree
Showing 18 changed files with 282 additions and 4 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"react-dom": "^17.0.2",
"react-router-dom": "^5.3.0",
"react-transition-group": "^4.4.2",
"react-twemoji": "^0.3.0",
"ress": "^4.0.0",
"webpack-dev-middleware": "^5.2.1"
},
Expand Down
61 changes: 61 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions src/comps/shared/Emoji.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.emoji-default {
height: 1em;

img {
height: 100%;
}
}
15 changes: 15 additions & 0 deletions src/comps/shared/Emoji.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from "react";
import Twemoji from "react-twemoji";

import styles from "./Emoji.module.scss";

export type EmojiProps = React.HTMLAttributes<HTMLSpanElement> & {
emoji: string;
};
export const Emoji = ({ emoji, className, ...props }: EmojiProps) => (
<Twemoji noWrapper>
<span className={styles.emojiDefault + " " + className} {...props}>
{emoji}
</span>
</Twemoji>
);
29 changes: 29 additions & 0 deletions src/comps/shared/Heading.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
@use "~/styling/font.module.scss";
@use "~/styling/color.module.scss";

.heading {
display: grid;
grid-gap: 0.5rem;

grid-auto-flow: column;
grid-auto-columns: max-content;
align-items: end;

width: 100%;
margin-bottom: 1.25em;
padding-bottom: 0.25em;

border-bottom: 2px solid color.get-theme-color(text-color-accent-primary);

* {
line-height: 100%;
}
}

.sub-text {
@include font.use-set(monospace);
color: color.get-theme-color(text-color-secondary);

font-size: 0.85rem;
font-weight: normal;
}
18 changes: 18 additions & 0 deletions src/comps/shared/Heading.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from "react";
import { Emoji } from "./Emoji";

import styles from "./Heading.module.scss";

export type HeadingProps = {
children: string;
emoji: string;
sub: string;
};
export const Heading = ({ children, emoji, sub }: HeadingProps) => (
<h1 className={styles.heading}>
<Emoji emoji={emoji} />
<span>{children}</span>
{/* eslint-disable-next-line react/jsx-no-comment-textnodes */}
<span className={styles.subText}>// {sub}</span>
</h1>
);
11 changes: 11 additions & 0 deletions src/pages/about/About.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@use "~/styling/color.module.scss";
@use "~/styling/layout.module.scss";

.container {
display: grid;
grid-auto-flow: column;
grid-auto-columns: 1fr 2fr;
grid-gap: 1.5em;
width: 100%;
}

19 changes: 19 additions & 0 deletions src/pages/about/About.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from "react";
import { PageWrapper } from "~/comps/layout/PageWrapper";
import { Heading } from "~/comps/shared/Heading";

import styles from "./About.module.scss";
import { Avatar } from "./Avatar";
import { Introduction } from "./Introduction";

export const About = () => (
<PageWrapper>
<Heading sub="About" emoji="🙌">
自己紹介
</Heading>
<div className={styles.container}>
<Avatar />
<Introduction />
</div>
</PageWrapper>
);
18 changes: 18 additions & 0 deletions src/pages/about/Avatar.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@use "~/styling/color.module.scss";

.avatar {
img {
margin-bottom: -15px;
width: 100%;

animation: 5s ease-in-out alternate infinite shake;
}

overflow: hidden;
border-bottom: 2px solid color.get-theme-color(text-color-accent-primary);
}

@keyframes shake {
from { transform: rotate(-2deg); }
to { transform: rotate(2deg); }
}
16 changes: 16 additions & 0 deletions src/pages/about/Avatar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React from "react";
import styles from "./Avatar.module.scss";

export const Avatar = () => (
<div>
<div className={styles.avatar}>
<img src="/static/loxygen_k.png" />
</div>
<span>
Icon by:
<a href="https://twitter.com/unios103i" target="_blank" rel="noreferrer">
@unios103i
</a>
</span>
</div>
);
34 changes: 34 additions & 0 deletions src/pages/about/Introduction.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
@use "~/styling/color.module.scss";
@use "~/styling/font.module.scss";

.wrapper {
display: flex;
flex-direction: column;
gap: 0.5em;
}

.name, .affiriation {
display: flex;
flex-direction: column;
}

.primary {
@include font.use-set("heading");

font-size: 3em;
font-weight: 600;
line-height: 110%;
}

.element {
display: flex;
flex-direction: column;
}

.aka {
color: color.get-theme-color(text-color-secondary)
}

.location {
font-size: 1.25em;
}
23 changes: 23 additions & 0 deletions src/pages/about/Introduction.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import React from "react";

import styles from "./Introduction.module.scss";

export const Introduction = () => (
<div className={styles.wrapper}>
<div className={styles.name}>
<span className={styles.primary}>フライさん</span>
<span className={styles.aka}>Flisan / loxygen.K</span>
</div>
<div className={styles.affiriation}>
<div className={styles.element}>
<span className={styles.location}>茨城工業高等専門学校</span>
<span>3 年 情報系</span>
</div>
<div className={styles.element}>
<span className={styles.location}>茨城工業高等専門学校</span>
<span>3 年 情報系</span>
</div>
</div>
フライさんです.
</div>
);
2 changes: 2 additions & 0 deletions src/pages/router/routing.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { RouteProps } from "react-router-dom";
import { Splash } from "~/pages/splash/Splash";
import { Main } from "~/pages/main/Main";
import { About } from "../about/About";

export const routingTable: RouteProps[] = [
{ path: "/", component: Splash, exact: true },
{ path: "/me", component: Main, exact: true },
{ path: "/about", component: About, exact: true },
];
11 changes: 10 additions & 1 deletion src/styling/base.module.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@use "./font.module.scss";
@use "./color.module.scss";

body {
@include font.use-set(base);
Expand All @@ -11,6 +12,14 @@ body {
}

a {
color: unset;
color: color.get-theme-color(text-color-accent-secondary);
text-decoration: none;

&:hover {
text-decoration: underline;
}
}

h1, h2, h3, h4, h5, h6 {
@include font.use-set(heading);
}
10 changes: 8 additions & 2 deletions src/styling/font.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=M+PLUS+1p:wght@400;500&display=swap');
@import url('https://fonts.googleapis.com/css2?family=M+PLUS+Rounded+1c:wght@300;400&display=swap');

$__set-base: "IBM Plex Sans", "M PLUS Rounded 1c";
$__set-heading: "IBM Plex Sans", "M PLUS 1p";
$__set-monospace: IBM Plex Mono;
$font-set: (
"base": "IBM Plex Sans",
"monospace": "IBM Plex Mono",
"base": $__set-base,
"heading": $__set-heading,
"monospace": $__set-monospace,
);

@mixin use-set($name) {
Expand Down
9 changes: 9 additions & 0 deletions src/typedef.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,12 @@ declare module "*.svg" {
) => React.ReactElement;
export default component;
}

declare module "react-twemoji" {
const Twemoji: (props: {
children: React.ReactNode;
noWrapper?: boolean;
tag?: string;
}) => React.ReactElement;
export default Twemoji;
}
Binary file added static/loxygen_k.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const configuration: Configuration = {
new CopyWebpackPlugin({
patterns: [
{
from: path.resolve(__dirname, "asset/static"),
from: path.resolve(__dirname, "static"),
to: path.resolve(__dirname, "dist/static/"),
noErrorOnMissing: true,
},
Expand Down

0 comments on commit 6ca2353

Please # to comment.