Skip to content

Commit 7411000

Browse files
committed
start work on new challenge: fem-password-generator
1 parent f54b18e commit 7411000

File tree

19 files changed

+386
-0
lines changed

19 files changed

+386
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module.exports = {
2+
env: { browser: true, es2020: true },
3+
extends: [
4+
'eslint:recommended',
5+
'plugin:@typescript-eslint/recommended',
6+
'plugin:react-hooks/recommended',
7+
],
8+
parser: '@typescript-eslint/parser',
9+
parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
10+
plugins: ['react-refresh'],
11+
rules: {
12+
'react-refresh/only-export-components': 'warn',
13+
},
14+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Vite + React + TS</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.tsx"></script>
12+
</body>
13+
</html>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"name": "fem-password-generator-app",
3+
"private": true,
4+
"version": "0.0.0",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite",
8+
"build": "tsc && vite build",
9+
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
10+
"preview": "vite preview"
11+
},
12+
"dependencies": {
13+
"react": "^18.2.0",
14+
"react-dom": "^18.2.0",
15+
"react-icons": "^4.10.1"
16+
},
17+
"devDependencies": {
18+
"@types/react": "^18.0.37",
19+
"@types/react-dom": "^18.0.11",
20+
"@typescript-eslint/eslint-plugin": "^5.59.0",
21+
"@typescript-eslint/parser": "^5.59.0",
22+
"@vitejs/plugin-react": "^4.0.0",
23+
"eslint": "^8.38.0",
24+
"eslint-plugin-react-hooks": "^4.6.0",
25+
"eslint-plugin-react-refresh": "^0.3.4",
26+
"sass": "^1.63.6",
27+
"typescript": "^5.0.2",
28+
"vite": "^4.3.9"
29+
}
30+
}
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { useState } from 'react'
2+
3+
import {InputCard, OutputCard} from "./Card";
4+
5+
6+
function App() {
7+
return (
8+
<>
9+
<OutputCard password="2d29h09" />
10+
<InputCard password="2d29h09" />
11+
</>
12+
)
13+
}
14+
15+
export default App
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { FaRegCopy } from 'react-icons/fa';
2+
3+
function OutputCard({ password }) {
4+
return (
5+
<div className="output-card">
6+
<div className="output-card__input"
7+
suppressContentEditableWarning
8+
contentEditable
9+
>{password}</div>
10+
<button className="btn btn--primary">
11+
<FaRegCopy />
12+
</button>
13+
</div>
14+
)
15+
}
16+
17+
function InputCard({ password }) {
18+
return (
19+
<div className="input-card">
20+
<div class="flex-col">
21+
<div className="flex justify-between">
22+
<span class="card__text">character length</span>
23+
<span class="card__special">0</span>
24+
</div>
25+
26+
<input type="range" id="volume" name="volume"
27+
min="0" max="11" />
28+
</div>
29+
</div>
30+
)
31+
}
32+
33+
export { InputCard, OutputCard};
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import React from 'react'
2+
import ReactDOM from 'react-dom/client'
3+
import App from './App.tsx'
4+
5+
import "./scss/main.scss";
6+
7+
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
8+
<React.StrictMode>
9+
<App />
10+
</React.StrictMode>,
11+
)
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
// https://piccalil.li/blog/a-modern-css-reset
2+
3+
/* Box sizing rules */
4+
*,
5+
*::before,
6+
*::after {
7+
box-sizing: border-box;
8+
}
9+
10+
/* Remove default margin */
11+
body,
12+
h1,
13+
h2,
14+
h3,
15+
h4,
16+
p,
17+
figure,
18+
blockquote,
19+
dl,
20+
dd {
21+
margin: 0;
22+
}
23+
24+
/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
25+
ul[role='list'],
26+
ol[role='list'] {
27+
list-style: none;
28+
}
29+
30+
/* Set core root defaults */
31+
html:focus-within {
32+
scroll-behavior: smooth;
33+
}
34+
35+
/* Set core body defaults */
36+
body {
37+
min-height: 100vh;
38+
text-rendering: optimizeSpeed;
39+
line-height: 1.5;
40+
}
41+
42+
/* A elements that don't have a class get default styles */
43+
a:not([class]) {
44+
text-decoration-skip-ink: auto;
45+
}
46+
47+
/* Make images easier to work with */
48+
img,
49+
picture {
50+
max-width: 100%;
51+
display: block;
52+
}
53+
54+
/* Inherit fonts for inputs and buttons */
55+
input,
56+
button,
57+
textarea,
58+
select {
59+
font: inherit;
60+
}
61+
62+
/* Remove all animations, transitions and smooth scroll for people that prefer not to see them */
63+
@media (prefers-reduced-motion: reduce) {
64+
html:focus-within {
65+
scroll-behavior: auto;
66+
}
67+
68+
*,
69+
*::before,
70+
*::after {
71+
animation-duration: 0.01ms !important;
72+
animation-iteration-count: 1 !important;
73+
transition-duration: 0.01ms !important;
74+
scroll-behavior: auto !important;
75+
}
76+
}

0 commit comments

Comments
 (0)