├── public ├── robots.txt ├── favicon.ico ├── logo192.png ├── logo512.png ├── manifest.json └── index.html ├── src ├── components │ ├── layout │ │ ├── spinner.gif │ │ ├── Alert.js │ │ ├── Spinner.js │ │ └── Navbar.js │ ├── pages │ │ └── About.js │ ├── repos │ │ ├── RepoItem.js │ │ └── Repos.js │ └── users │ │ ├── Users.js │ │ ├── UserItem.js │ │ ├── Search.js │ │ └── User.js ├── setupTests.js ├── reportWebVitals.js ├── index.js ├── App.js └── App.css ├── .gitignore ├── package.json └── README.md /public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shahriar220/GithubUserFinder/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shahriar220/GithubUserFinder/HEAD/public/logo192.png -------------------------------------------------------------------------------- /public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shahriar220/GithubUserFinder/HEAD/public/logo512.png -------------------------------------------------------------------------------- /src/components/layout/spinner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shahriar220/GithubUserFinder/HEAD/src/components/layout/spinner.gif -------------------------------------------------------------------------------- /src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /src/components/layout/Alert.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | const Alert = ({alert}) => { 4 | return ( 5 | alert!==null&&( 6 |
7 | {alert.msg} 8 |
9 | ) 10 | ) 11 | } 12 | export default Alert -------------------------------------------------------------------------------- /src/components/pages/About.js: -------------------------------------------------------------------------------- 1 | import React,{Fragment} from 'react' 2 | 3 | const About = () => { 4 | return ( 5 | 6 |

About this page

7 |

App to search github user

8 |

Version 1.0.0

9 |
10 | ) 11 | } 12 | export default About -------------------------------------------------------------------------------- /src/components/layout/Spinner.js: -------------------------------------------------------------------------------- 1 | import React,{Fragment} from 'react' 2 | import spinner from './spinner.gif' 3 | const Spinner = () => 4 | Loading... 8 | 9 | export default Spinner -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /src/components/repos/RepoItem.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import PropTypes from 'prop-types' 3 | const RepoItem = ({repo}) => { 4 | return ( 5 |
6 |

7 | {repo.name} 8 |

9 |
10 | ) 11 | } 12 | RepoItem.propTypes={ 13 | repo:PropTypes.object.isRequired 14 | } 15 | export default RepoItem 16 | -------------------------------------------------------------------------------- /src/components/repos/Repos.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import RepoItem from './RepoItem' 3 | import PropTypes from 'prop-types' 4 | const Repos = ({ repos }) => { 5 | return repos.map(repo => < RepoItem repo = { repo } 6 | key = { repo.id } 7 | />) 8 | } 9 | Repos.propTypes = { 10 | repos: PropTypes.array.isRequired, 11 | } 12 | export default Repos -------------------------------------------------------------------------------- /src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = onPerfEntry => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | import reportWebVitals from './reportWebVitals'; 5 | 6 | ReactDOM.render( 7 | 8 | 9 | , 10 | document.getElementById('root') 11 | ); 12 | 13 | // If you want to start measuring performance in your app, pass a function 14 | // to log results (for example: reportWebVitals(console.log)) 15 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals 16 | reportWebVitals(); 17 | -------------------------------------------------------------------------------- /public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /src/components/users/Users.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import UserItem from './UserItem' 3 | import Spinner from '../layout/Spinner' 4 | import PropTypes from 'prop-types' 5 | 6 | const Users =({users,loading})=> { 7 | if(loading){ 8 | return 9 | } 10 | else{ 11 | return ( 12 |
13 | {users.map(user=>( 14 | 15 | ))} 16 |
17 | ) 18 | } 19 | } 20 | 21 | Users.propTypes={ 22 | users:PropTypes.array.isRequired, 23 | loading:PropTypes.bool.isRequired 24 | } 25 | 26 | const userStyle={ 27 | display:'grid', 28 | gridTemplateColumns:'repeat(3,1fr)', 29 | gridGap:'1 rem' 30 | }; 31 | export default Users 32 | -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | Github FINDER 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/components/users/UserItem.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import PropTypes from 'prop-types' 3 | import {Link} from 'react-router-dom' 4 | const UserItem=({user:{login,avatar_url,html_url}})=>{ 5 | 6 | return ( 7 |
8 | 13 | 14 |

{login}

15 | 16 |
17 | 18 | More 19 |
20 |
21 | ) 22 | } 23 | UserItem.propTypes={ 24 | user:PropTypes.object.isRequired, 25 | } 26 | 27 | export default UserItem 28 | -------------------------------------------------------------------------------- /src/components/layout/Navbar.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import PropTypes from 'prop-types' 3 | import { Link } from 'react-router-dom' 4 | 5 | 6 | const Navbar =({icon,title})=> { 7 | 8 | return ( 9 | 23 | ) 24 | } 25 | 26 | Navbar.defaultProps={ 27 | title:'Github Finder', 28 | icon:'fab fa-github' 29 | }; 30 | Navbar.propTypes={ 31 | title:PropTypes.string.isRequired, 32 | icon:PropTypes.string.isRequired 33 | } 34 | 35 | export default Navbar 36 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "gitfinder", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@testing-library/jest-dom": "^5.11.6", 7 | "@testing-library/react": "^11.1.2", 8 | "@testing-library/user-event": "^12.2.2", 9 | "axios": "^0.21.0", 10 | "react": "^17.0.1", 11 | "react-dom": "^17.0.1", 12 | "react-router-dom": "^5.2.0", 13 | "react-scripts": "4.0.0", 14 | "web-vitals": "^0.2.4" 15 | }, 16 | "scripts": { 17 | "start": "react-scripts start", 18 | "build": "react-scripts build", 19 | "test": "react-scripts test", 20 | "eject": "react-scripts eject" 21 | }, 22 | "eslintConfig": { 23 | "extends": [ 24 | "react-app", 25 | "react-app/jest" 26 | ] 27 | }, 28 | "browserslist": { 29 | "production": [ 30 | ">0.2%", 31 | "not dead", 32 | "not op_mini all" 33 | ], 34 | "development": [ 35 | "last 1 chrome version", 36 | "last 1 firefox version", 37 | "last 1 safari version" 38 | ] 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/components/users/Search.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import PropTypes from 'prop-types' 3 | 4 | class Search extends Component { 5 | state={ 6 | text:'' 7 | }; 8 | static propTypes={ 9 | searchUsers:PropTypes.func.isRequired, 10 | clearUsers:PropTypes.func.isRequired, 11 | showClear:PropTypes.bool.isRequired, 12 | setAlert:PropTypes.func.isRequired, 13 | } 14 | onSubmit=e=>{ 15 | e.preventDefault() 16 | if(this.state.text===''){ 17 | this.props.setAlert('Please Enter something','light') 18 | }else{ 19 | this.props.searchUsers(this.state.text) 20 | this.setState({text:''}) 21 | } 22 | } 23 | 24 | onChange=e=>{ 25 | this.setState({[e.target.name]:e.target.value}) 26 | }; 27 | 28 | render() { 29 | const {showClear,clearUsers}=this.props 30 | 31 | return ( 32 |
33 |
35 | 41 | 42 | 46 |
47 | {showClear &&} 56 | 57 |
58 | ) 59 | } 60 | } 61 | 62 | export default Search 63 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Getting Started with Create React App 2 | 3 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). 4 | 5 | ## Available Scripts 6 | 7 | In the project directory, you can run: 8 | 9 | ### `npm start` 10 | 11 | Runs the app in the development mode.\ 12 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser. 13 | 14 | The page will reload if you make edits.\ 15 | You will also see any lint errors in the console. 16 | 17 | ### `npm test` 18 | 19 | Launches the test runner in the interactive watch mode.\ 20 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. 21 | 22 | ### `npm run build` 23 | 24 | Builds the app for production to the `build` folder.\ 25 | It correctly bundles React in production mode and optimizes the build for the best performance. 26 | 27 | The build is minified and the filenames include the hashes.\ 28 | Your app is ready to be deployed! 29 | 30 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. 31 | 32 | ### `npm run eject` 33 | 34 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!** 35 | 36 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. 37 | 38 | Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. 39 | 40 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. 41 | 42 | ## Learn More 43 | 44 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). 45 | 46 | To learn React, check out the [React documentation](https://reactjs.org/). 47 | 48 | ### Code Splitting 49 | 50 | This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting) 51 | 52 | ### Analyzing the Bundle Size 53 | 54 | This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size) 55 | 56 | ### Making a Progressive Web App 57 | 58 | This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app) 59 | 60 | ### Advanced Configuration 61 | 62 | This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration) 63 | 64 | ### Deployment 65 | 66 | This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment) 67 | 68 | ### `npm run build` fails to minify 69 | 70 | This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify) 71 | -------------------------------------------------------------------------------- /src/App.js: -------------------------------------------------------------------------------- 1 | import React, { Fragment } from 'react' 2 | import {BrowserRouter as Router,Switch,Route} from 'react-router-dom' 3 | import Navbar from './components/layout/Navbar' 4 | import Users from './components/users/Users' 5 | import axios from 'axios' 6 | import Search from './components/users/Search' 7 | import Alert from './components/layout/Alert' 8 | import About from './components/pages/About' 9 | import User from './components/users/User' 10 | import './App.css'; 11 | 12 | class App extends React.Component{ 13 | 14 | state={ 15 | users:[], 16 | user:{}, 17 | repos:[], 18 | loading:false, 19 | alert:null 20 | }; 21 | // async componentDidMount(){ 22 | 23 | // this.setState({loading:true}) 24 | 25 | // const res=await axios.get(`https://api.github.com/users?client_id=${process.env.REACT_APP_GITHUB_CLIENT_ID}&client_secret=$ 26 | // {process.env.REACT_APP_GITHUB_CLIENT_SECRET}`); 27 | // this.setState({users:res.data,loading:false}) 28 | // } 29 | 30 | searchUsers = async text=>{ 31 | this.setState({loading:true}) 32 | const res=await axios.get( 33 | `https://api.github.com/search/users?q=${text}&client_id=${process.env.REACT_APP_GITHUB_CLIENT_ID}&client_secret=$ 34 | {process.env.REACT_APP_GITHUB_CLIENT_SECRET}`); 35 | this.setState({users:res.data.items,loading:false}) 36 | } 37 | getUser=async (username)=>{ 38 | this.setState({loading:true}) 39 | const res=await axios.get( 40 | `https://api.github.com/users/${username}?client_id=${process.env.REACT_APP_GITHUB_CLIENT_ID}&client_secret=$ 41 | {process.env.REACT_APP_GITHUB_CLIENT_SECRET}`); 42 | this.setState({user:res.data,loading:false}) 43 | } 44 | getUserRepos=async (username)=>{ 45 | this.setState({loading:true}) 46 | const res=await axios.get( 47 | `https://api.github.com/users/${username}/repos?per_page=5&&sort=created:asc&client_id=${process.env.REACT_APP_GITHUB_CLIENT_ID}&client_secret=$ 48 | {process.env.REACT_APP_GITHUB_CLIENT_SECRET}`); 49 | this.setState({repos:res.data,loading:false}) 50 | } 51 | 52 | 53 | clearUsers=()=>{ 54 | this.setState({users:[],loading:false}) 55 | } 56 | setAlert=(msg,type)=>{ 57 | this.setState({alert:{msg,alert}}) 58 | setTimeout(()=>this.setState({alert:null}),3000) 59 | } 60 | 61 | render(){ 62 | const {users,user,repos,loading}=this.state 63 | 64 | return ( 65 | 66 |
67 | 68 | 69 |
70 | 71 | 72 | ( 73 | 74 | 0?true:false } 79 | 80 | setAlert={this.setAlert} 81 | /> 82 | 83 | 86 | 87 | 88 | )} 89 | /> 90 | 91 | ( 92 | 98 | )}> 99 | 100 | 101 | 102 |
103 |
104 |
105 | ) 106 | } 107 | } 108 | 109 | export default App; 110 | -------------------------------------------------------------------------------- /src/components/users/User.js: -------------------------------------------------------------------------------- 1 | import React, { Fragment,Component } from 'react' 2 | import Spinner from '../layout/Spinner' 3 | import Repos from '../repos/Repos' 4 | import PropTypes from 'prop-types' 5 | import {Link} from 'react-router-dom' 6 | 7 | class User extends Component { 8 | componentDidMount(){ 9 | this.props.getUser(this.props.match.params.login) 10 | this.props.getUserRepos(this.props.match.params.login) 11 | } 12 | static propTypes={ 13 | loading:PropTypes.bool, 14 | user:PropTypes.object.isRequired, 15 | repos:PropTypes.array.isRequired, 16 | getUser:PropTypes.func.isRequired, 17 | getUserRepos:PropTypes.func.isRequired, 18 | } 19 | 20 | render() { 21 | const { 22 | name, 23 | avatar_url, 24 | location, 25 | bio, 26 | company, 27 | blog, 28 | login, 29 | html_url, 30 | followers, 31 | following, 32 | public_repos, 33 | public_gists, 34 | hireable 35 | }=this.props.user 36 | 37 | const {loading,repos}=this.props 38 | 39 | if(loading) return 40 | 41 | return ( 42 | 43 | 44 | Back to Search 45 | 46 | Hireable:{' '} 47 | {hireable?( 48 | ):( 49 | )} 50 | 51 |
52 | 53 |
54 | 58 |

{name}

59 |

Location: {location}

60 |
61 | 62 |
63 | {bio&&( 64 |

Bio

65 |

{bio}

66 |
)} 67 | 69 | Visit Profile 70 | 71 |
    72 |
  • 73 | {login&& 74 | Username: 75 | {login} } 76 |
  • 77 |
  • 78 | {company&& 79 | Company:{company}} 80 |
  • 81 |
  • 82 | {blog&& 83 | Website:{blog}} 84 |
  • 85 |
86 | 87 |
88 |
89 |
90 |
Follower: {followers}
91 |
Following: {following}
92 |
Public Repos: {public_repos}
93 |
Public Gists: {public_gists}
94 |
95 | 96 |
97 | ) 98 | } 99 | } 100 | 101 | export default User 102 | -------------------------------------------------------------------------------- /src/App.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css?family=Roboto'); 2 | 3 | /* Global Styles */ 4 | 5 | :root { 6 | --primary-color: #dc3545; 7 | --dark-color: #333333; 8 | --light-color: #f4f4f4; 9 | --danger-color: #dc3545; 10 | --success-color: #28a745; 11 | } 12 | 13 | * { 14 | box-sizing: border-box; 15 | margin: 0; 16 | padding: 0; 17 | } 18 | 19 | body { 20 | font-family: 'Roboto', sans-serif; 21 | font-size: 1rem; 22 | line-height: 1.6; 23 | background-color: #fff; 24 | color: #333; 25 | } 26 | 27 | a { 28 | color: var(--primary-color); 29 | text-decoration: none; 30 | } 31 | 32 | a:hover { 33 | color: #666; 34 | } 35 | 36 | ul { 37 | list-style: none; 38 | } 39 | 40 | img { 41 | width: 100%; 42 | } 43 | 44 | 45 | /* Utilities */ 46 | 47 | .container { 48 | max-width: 1100px; 49 | margin: auto; 50 | overflow: hidden; 51 | padding: 0 2rem; 52 | } 53 | 54 | 55 | /* Text Styles*/ 56 | 57 | .x-large { 58 | font-size: 4rem; 59 | line-height: 1.2; 60 | margin-bottom: 1rem; 61 | } 62 | 63 | .large { 64 | font-size: 3rem; 65 | line-height: 1.2; 66 | margin-bottom: 1rem; 67 | } 68 | 69 | .lead { 70 | font-size: 1.5rem; 71 | margin-bottom: 1rem; 72 | } 73 | 74 | .text-center { 75 | text-align: center; 76 | } 77 | 78 | .text-primary { 79 | color: var(--primary-color); 80 | } 81 | 82 | .text-dark { 83 | color: var(--dark-color); 84 | } 85 | 86 | .text-success { 87 | color: var(--success-color); 88 | } 89 | 90 | .text-danger { 91 | color: var(--danger-color); 92 | } 93 | 94 | .text-center { 95 | text-align: center; 96 | } 97 | 98 | .text-right { 99 | text-align: right; 100 | } 101 | 102 | .text-left { 103 | text-align: left; 104 | } 105 | 106 | 107 | /* Center All */ 108 | 109 | .all-center { 110 | display: flex; 111 | flex-direction: column; 112 | width: 100%; 113 | margin: auto; 114 | justify-content: center; 115 | align-items: center; 116 | text-align: center; 117 | } 118 | 119 | 120 | /* Cards */ 121 | 122 | .card { 123 | padding: 1rem; 124 | border: #ccc 1px dotted; 125 | margin: 0.7rem 0; 126 | } 127 | 128 | 129 | /* List */ 130 | 131 | .list { 132 | margin: 0.5rem 0; 133 | } 134 | 135 | .list li { 136 | padding-bottom: 0.3rem; 137 | } 138 | 139 | 140 | /* Padding */ 141 | 142 | .p { 143 | padding: 0.5rem; 144 | } 145 | 146 | .p-1 { 147 | padding: 1rem; 148 | } 149 | 150 | .p-2 { 151 | padding: 2rem; 152 | } 153 | 154 | .p-3 { 155 | padding: 3rem; 156 | } 157 | 158 | .py { 159 | padding: 0.5rem 0; 160 | } 161 | 162 | .py-1 { 163 | padding: 1rem 0; 164 | } 165 | 166 | .py-2 { 167 | padding: 2rem 0; 168 | } 169 | 170 | .py-3 { 171 | padding: 3rem 0; 172 | } 173 | 174 | 175 | /* Margin */ 176 | 177 | .m { 178 | margin: 0.5rem; 179 | } 180 | 181 | .m-1 { 182 | margin: 1rem; 183 | } 184 | 185 | .m-2 { 186 | margin: 2rem; 187 | } 188 | 189 | .m-3 { 190 | margin: 3rem; 191 | } 192 | 193 | .my { 194 | margin: 0.5rem 0; 195 | } 196 | 197 | .my-1 { 198 | margin: 1rem 0; 199 | } 200 | 201 | .my-2 { 202 | margin: 2rem 0; 203 | } 204 | 205 | .my-3 { 206 | margin: 3rem 0; 207 | } 208 | 209 | 210 | /* Grid */ 211 | 212 | .grid-2 { 213 | display: grid; 214 | grid-template-columns: repeat(2, 1fr); 215 | grid-gap: 1rem; 216 | } 217 | 218 | .grid-3 { 219 | display: grid; 220 | grid-template-columns: repeat(3, 1fr); 221 | grid-gap: 1rem; 222 | } 223 | 224 | .grid-4 { 225 | display: grid; 226 | grid-template-columns: repeat(4, 1fr); 227 | grid-gap: 1rem; 228 | } 229 | 230 | .btn { 231 | display: inline-block; 232 | background: var(--light-color); 233 | color: #333; 234 | padding: 0.4rem 1.3rem; 235 | font-size: 1rem; 236 | border: none; 237 | cursor: pointer; 238 | margin-right: 0.5rem; 239 | transition: opacity 0.2s ease-in; 240 | outline: none; 241 | } 242 | 243 | .btn-link { 244 | background: none; 245 | padding: 0; 246 | margin: 0; 247 | } 248 | 249 | .btn-block { 250 | display: block; 251 | width: 100%; 252 | } 253 | 254 | .btn-sm { 255 | font-size: 0.8rem; 256 | padding: 0.3rem 1rem; 257 | margin-right: 0.2rem; 258 | } 259 | 260 | .badge { 261 | display: inline-block; 262 | font-size: 0.8rem; 263 | padding: 0.2rem 0.7rem; 264 | text-align: center; 265 | margin: 0.3rem; 266 | background: var(--light-color); 267 | color: #333; 268 | border-radius: 5px; 269 | } 270 | 271 | .alert { 272 | padding: 0.7rem; 273 | margin: 1rem 0; 274 | opacity: 0.9; 275 | background: var(--light-color); 276 | color: #333; 277 | } 278 | 279 | .btn-primary, 280 | .bg-primary, 281 | .badge-primary, 282 | .alert-primary { 283 | background: var(--primary-color); 284 | color: #fff; 285 | } 286 | 287 | .btn-light, 288 | .bg-light, 289 | .badge-light, 290 | .alert-light { 291 | background: var(--light-color); 292 | color: #333; 293 | } 294 | 295 | .btn-dark, 296 | .bg-dark, 297 | .badge-dark, 298 | .alert-dark { 299 | background: var(--dark-color); 300 | color: #fff; 301 | } 302 | 303 | .btn-danger, 304 | .bg-danger, 305 | .badge-danger, 306 | .alert-danger { 307 | background: var(--danger-color); 308 | color: #fff; 309 | } 310 | 311 | .btn-success, 312 | .bg-success, 313 | .badge-success, 314 | .alert-success { 315 | background: var(--success-color); 316 | color: #fff; 317 | } 318 | 319 | .btn-white, 320 | .bg-white, 321 | .badge-white, 322 | .alert-white { 323 | background: #fff; 324 | color: #333; 325 | border: #ccc solid 1px; 326 | } 327 | 328 | .btn:hover { 329 | opacity: 0.8; 330 | } 331 | 332 | .bg-light, 333 | .badge-light { 334 | border: #ccc solid 1px; 335 | } 336 | 337 | .round-img { 338 | border-radius: 50%; 339 | } 340 | 341 | 342 | /* Forms */ 343 | 344 | input { 345 | margin: 1.2rem 0; 346 | } 347 | 348 | .form-text { 349 | display: block; 350 | margin-top: 0.3rem; 351 | color: #888; 352 | } 353 | 354 | input[type='text'], 355 | input[type='email'], 356 | input[type='password'], 357 | input[type='date'], 358 | select, 359 | textarea { 360 | display: block; 361 | width: 100%; 362 | padding: 0.4rem; 363 | font-size: 1.2rem; 364 | border: 1px solid #ccc; 365 | } 366 | 367 | input[type='submit'], 368 | button { 369 | font: inherit; 370 | } 371 | 372 | table th, 373 | table td { 374 | padding: 1rem; 375 | text-align: left; 376 | } 377 | 378 | table th { 379 | background: var(--light-color); 380 | } 381 | 382 | 383 | /* Navbar */ 384 | 385 | .navbar { 386 | display: flex; 387 | justify-content: space-between; 388 | align-items: center; 389 | padding: 0.7rem 2rem; 390 | z-index: 1; 391 | width: 100%; 392 | opacity: 0.9; 393 | margin-bottom: 1rem; 394 | } 395 | 396 | .navbar ul { 397 | display: flex; 398 | } 399 | 400 | .navbar a { 401 | color: #fff; 402 | padding: 0.45rem; 403 | margin: 0 0.25rem; 404 | } 405 | 406 | .navbar a:hover { 407 | color: var(--light-color); 408 | } 409 | 410 | .navbar .welcome span { 411 | margin-right: 0.6rem; 412 | } 413 | 414 | 415 | /* Mobile Styles */ 416 | 417 | @media (max-width: 700px) { 418 | .hide-sm { 419 | display: none; 420 | } 421 | .grid-2, 422 | .grid-3, 423 | .grid-4 { 424 | grid-template-columns: 1fr; 425 | } 426 | /* Text Styles */ 427 | .x-large { 428 | font-size: 3rem; 429 | } 430 | .large { 431 | font-size: 2rem; 432 | } 433 | .lead { 434 | font-size: 1rem; 435 | } 436 | /* Navbar */ 437 | .navbar { 438 | display: block; 439 | text-align: center; 440 | } 441 | .navbar ul { 442 | text-align: center; 443 | justify-content: center; 444 | } 445 | } --------------------------------------------------------------------------------