Responsive CSS fixes.

This commit is contained in:
Mike Cao 2020-08-17 16:46:13 -07:00
parent ebad54ab82
commit bab70279dd
10 changed files with 57 additions and 29 deletions

View File

@ -8,7 +8,7 @@
git clone https://github.com/mikecao/umami.git git clone https://github.com/mikecao/umami.git
``` ```
### Go into your repo folder ### Go into the repo folder
``` ```
cd umami cd umami
@ -53,7 +53,7 @@ postgresql://username:mypassword@localhost:5432/mydb
mysql://username:mypassword@localhost:3306/mydb mysql://username:mypassword@localhost:3306/mydb
``` ```
The `HASH_SALT` is used to generate unique session values for your installation. The `HASH_SALT` is used to generate unique values for your installation.
### Generate database client ### Generate database client

View File

@ -25,3 +25,9 @@
display: none; display: none;
} }
} }
@media only screen and (max-width: 576px) {
.buttons {
display: none;
}
}

View File

@ -48,7 +48,13 @@ export default function UserButton() {
<Icon icon={<Chevron />} size="small" /> <Icon icon={<Chevron />} size="small" />
</div> </div>
{showMenu && ( {showMenu && (
<Menu options={menuOptions} onSelect={handleSelect} float="bottom" align="right" /> <Menu
className={styles.menu}
options={menuOptions}
onSelect={handleSelect}
float="bottom"
align="right"
/>
)} )}
</div> </div>
); );

View File

@ -11,3 +11,7 @@
.username:hover { .username:hover {
background: var(--gray50); background: var(--gray50);
} }
.menu {
z-index: 100;
}

View File

@ -2,7 +2,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
font-size: var(--font-size-small); font-size: var(--font-size-small);
padding: 40px 0; min-height: 100px;
} }
.footer button { .footer button {

View File

@ -13,14 +13,14 @@ export default function Header() {
return ( return (
<header className="container"> <header className="container">
<div className={classNames(styles.header, 'row align-items-center')}> <div className={classNames(styles.header, 'row align-items-center')}>
<div className="col"> <div className="col-12 col-md-6">
<div className={styles.title}> <div className={styles.title}>
<Icon icon={<Logo />} size="large" className={styles.logo} /> <Icon icon={<Logo />} size="large" className={styles.logo} />
{user ? <Link href="/">umami</Link> : 'umami'} {user ? <Link href="/">umami</Link> : 'umami'}
</div> </div>
</div> </div>
{user && ( {user && (
<div className="col"> <div className="col-12 col-md-6">
<div className={styles.nav}> <div className={styles.nav}>
<Link href="/dashboard">Dashboard</Link> <Link href="/dashboard">Dashboard</Link>
<Link href="/settings">Settings</Link> <Link href="/settings">Settings</Link>

View File

@ -1,16 +1,16 @@
.header { .header {
display: flex; display: flex;
height: 80px; min-height: 100px;
}
.header > div {
flex: 1;
} }
.title { .title {
font-size: var(--font-size-large); font-size: var(--font-size-large);
} }
.logo {
margin-right: 12px;
}
.nav { .nav {
list-style: none; list-style: none;
display: flex; display: flex;
@ -24,6 +24,13 @@
margin-left: 40px; margin-left: 40px;
} }
.logo { @media only screen and (max-width: 768px) {
margin-right: 12px; .title {
text-align: center;
}
.nav {
display: flex;
justify-content: space-evenly;
}
} }

View File

@ -14,16 +14,18 @@ export default function MenuLayout({
children, children,
}) { }) {
return ( return (
<div className={classNames(styles.container, className)}> <div className={classNames(styles.container, className, 'row')}>
<Menu <Menu
options={menu} options={menu}
selectedOption={selectedOption} selectedOption={selectedOption}
className={classNames(styles.menu, menuClassName)} className={classNames(styles.menu, menuClassName, 'col-12 col-lg-3')}
selectedClassName={styles.selected} selectedClassName={styles.selected}
optionClassName={classNames(styles.option, optionClassName)} optionClassName={classNames(styles.option, optionClassName)}
onSelect={onMenuSelect} onSelect={onMenuSelect}
/> />
<div className={classNames(styles.content, contentClassName)}>{children}</div> <div className={classNames(styles.content, contentClassName, 'col-12 col-lg-9')}>
{children}
</div>
</div> </div>
); );
} }

View File

@ -1,31 +1,27 @@
.container { .container {
display: flex; display: flex;
flex: 1; flex: 1;
position: relative;
} }
.container .menu { .container .menu {
display: flex;
flex-direction: column;
padding: 30px 0;
border: 0; border: 0;
} }
.menu { .container .content {
display: flex;
flex-direction: column;
padding-top: 30px;
}
.content {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
border-left: 1px solid var(--gray300); border-left: 1px solid var(--gray300);
padding-left: 30px; padding-left: 30px;
flex: 1;
} }
.option { .option {
font-size: var(--font-size-normal); font-size: var(--font-size-normal);
padding: 8px 16px; padding: 8px 16px;
cursor: pointer; cursor: pointer;
min-width: 160px;
margin-right: 30px; margin-right: 30px;
border-radius: 4px; border-radius: 4px;
} }
@ -37,3 +33,11 @@
.selected { .selected {
font-weight: 600; font-weight: 600;
} }
@media only screen and (max-width: 992px) {
.container .content {
border-top: 1px solid var(--gray300);
border-left: 0;
padding-left: 0;
}
}

View File

@ -1,7 +1,7 @@
{ {
"name": "umami", "name": "umami",
"version": "0.2.0", "version": "0.3.0",
"description": "Delicious web stats", "description": "A simple, fast, website analytics alternative to Google Analytics. ",
"author": "Mike Cao <mike@mikecao.com>", "author": "Mike Cao <mike@mikecao.com>",
"license": "MIT", "license": "MIT",
"homepage": "https://github.com/mikecao/umami", "homepage": "https://github.com/mikecao/umami",
@ -10,10 +10,9 @@
"url": "https://github.com/mikecao/umami.git" "url": "https://github.com/mikecao/umami.git"
}, },
"scripts": { "scripts": {
"dev": "next dev -p 8000", "dev": "next dev",
"build": "next build", "build": "next build",
"start": "next start", "start": "next start",
"build-cli": "rollup -c rollup.cli.config.js",
"build-tracker": "rollup -c rollup.tracker.config.js", "build-tracker": "rollup -c rollup.tracker.config.js",
"build-mysql-schema": "dotenv prisma introspect -- --schema=./prisma/schema.mysql.prisma", "build-mysql-schema": "dotenv prisma introspect -- --schema=./prisma/schema.mysql.prisma",
"build-mysql-client": "dotenv prisma generate -- --schema=./prisma/schema.mysql.prisma", "build-mysql-client": "dotenv prisma generate -- --schema=./prisma/schema.mysql.prisma",