Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/selective rwd #26

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions imports/api/utils/layout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export const setLayout = (provider, layout) => {
provider.state.cookies.set('layout', layout);
provider.setState({
layout: layout,
});
}

export const getLayout = (cookies) => {
let layout = cookies.get('layout');
if (layout === undefined)
layout = 'new';
return layout;
}
3 changes: 3 additions & 0 deletions imports/stylesheets/_footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@
.site-footer__status {
flex-direction: column;
text-align: center;
> ul {
text-align: center;
}
> ul:first-of-type {
margin-bottom: 5px;
}
Expand Down
2 changes: 2 additions & 0 deletions imports/stylesheets/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ main {
@media screen and (max-width: 980px) {
.site-header {
height: 91px;
display: flex;
justify-content: center;
h1 {
padding-top: 10px;
}
Expand Down
261 changes: 156 additions & 105 deletions imports/stylesheets/_search-result.scss
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,33 @@
}
}

.layout-select {
display: none;
width: clamp(290px, 90%, 420px);
margin: 20px auto -10px;

button {
flex: 0 0 50%;
padding: 10px;
text-align: center;
border: #ddd 1px solid;
color: #888;
&:first-child {
border-right: #ddd 1px solid;
border-radius: 5px 0 0 5px;
}
&:last-child {
border-radius: 0 5px 5px 0;
border-left: none;
}
&.active {
background-color: $color--dark-main;
color: #fff;
border-color: $color--fade-dark-main;
}
}
}

.dic-block {
margin-bottom: 50px;
&__header {
Expand Down Expand Up @@ -247,131 +274,155 @@
}

@media screen and (max-width: 980px) {
.search-result {
&__dic-list {
display: none;
}
&__brief {
margin-top: 30px;
}
.layout-select {
display: flex;
justify-content: center;
}
// for collapsing
.search-result--list {
.dic-block {
margin-bottom: 5px;
}
.dic-block__header {
display: flex;
justify-content: space-between;
align-items: center;
border: #ddd 1px solid;
padding: 5px 10px;
border-radius: 5px;
}
.dic-block__header.active {
background: $color--fade-main;
h2, h3 {
color: #fff;
body:not(.fixed-width) {
.search-result {
&__dic-list {
display: none;
}
&__brief {
margin-top: 20px;
}
}
.dic-block__header.active + .dic-block__content {
max-height: 10000px;
}
.dic-block__content {
max-height: 0;
overflow: hidden;
transition: max-height .3s ease-in;
}
}
.brief-table {
display: block;
&__narrow-title {
color: $color--fade-main;
display: block;
flex: 0 0 190px;
text-align: right;
margin-right: 5px;
}
&__detail {
a {
position: absolute;
background-color: $color--dark-main;
color: #fff;
// for collapsing
.search-result--list {
.dic-block {
margin-bottom: 5px;
}
.dic-block__header {
display: flex;
justify-content: space-between;
align-items: center;
border: #ddd 1px solid;
padding: 5px 10px;
border-radius: 5px;
right: 0;
top: 50%;
transform: translate(0, -50%);
}
.dic-block__header.active {
background: $color--fade-main;
h2, h3 {
color: #fff;
}
}
.dic-block__header.active + .dic-block__content {
max-height: 10000px;
}
.dic-block__content {
max-height: 0;
overflow: hidden;
transition: max-height .3s ease-in;
}
}
thead {
display: none;
}
tbody, tr {
.brief-table {
display: block;
&__narrow-title {
color: $color--fade-main;
display: block;
flex: 0 0 190px;
text-align: right;
margin-right: 5px;
}
&__detail {
a {
position: absolute;
background-color: $color--dark-main;
color: #fff;
padding: 5px 10px;
border-radius: 5px;
right: 0;
top: 50%;
transform: translate(0, -50%);
}
}
thead {
display: none;
}
tbody, tr {
display: block;
}
tbody {
padding: 10px;
border-top: $color--table-border 1px solid;
}
tbody:first-of-type {
border-top: none;
}
tr {
position: relative;
padding-right: 60px;
}
tbody td {
display: flex;
border: none;
padding: 0;
}
}
tbody {
padding: 10px;
border-top: $color--table-border 1px solid;
}
tbody:first-of-type {
border-top: none;
}
tr {
position: relative;
padding-right: 60px;
}
tbody td {
display: flex;
border: none;
padding: 0;
}
body.fixed-width {
.search-result {
.container {
width: 1024px;
padding: 0 15px;
}
&__dic-list {
width: 1024px;
}
}
}
}

@media screen and (max-width: 560px) {
.search-result--list {
.dic-block__header {
flex-direction: column;
align-items: stretch;
}
.dic-block__title {
text-align: left;
font-size: 18px;
}
.dic-block__counts {
text-align: right;
.layout-select {
button {
padding: 5px;
}
}
.brief-table {
&__narrow-title {
flex: 0 0 auto;
text-align: left;
}
&__detail {
a {
margin-top: 5px;
position: static;
transform: translate(0, 0);
body:not(.fixed-width) {
.search-result--list {
.dic-block__header {
flex-direction: column;
align-items: stretch;
}
.dic-block__title {
text-align: left;
font-size: 18px;
}
.dic-block__counts {
text-align: right;
}
}
tr {
padding-right: 0;
}
tbody td {
flex-direction: column;
.brief-table {
&__narrow-title {
flex: 0 0 auto;
text-align: left;
}
&__detail {
a {
margin-top: 5px;
position: static;
transform: translate(0, 0);
}
}
tr {
padding-right: 0;
}
tbody td {
flex-direction: column;
}
}
}
.word-detail-table {
display: block;
border: $color--table-border 1px solid;
tbody, tr, th, td {
.word-detail-table {
display: block;
width: 100%;
text-align: left;
}
th, td {
border: none;
border: $color--table-border 1px solid;
tbody, tr, th, td {
display: block;
width: 100%;
text-align: left;
}
th, td {
border: none;
}
}
}
}
4 changes: 2 additions & 2 deletions imports/ui/pages/About.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class About extends Component {
<a className='btn btn--contact btn--contact-msg' href='http://chat.taigi.info/' target='_blank'>
<Translate id='contact-1' />
</a>
<a className='btn btn--contact btn--contact-mail' href='mailto:ngoohebi+chhoetaigi@gmail.com' target='_blank'>
<a className='btn btn--contact btn--contact-mail' href='mailto:taibunkesimi@gmail.com' target='_blank'>
<Translate id='contact-2' />
</a>
</div>
Expand Down Expand Up @@ -241,7 +241,7 @@ class About extends Component {
<div className='about__feedback'>
<div className='container'>
<h2><Translate id='opinion' /></h2>
<a id='feedback-email' href='mailto:ngoohebi+chhoetaigi@gmail.com'>ngoohebi+chhoetaigi@gmail.com</a>
<a id='feedback-email' href='mailto:taibunkesimi@gmail.com'>taibunkesimi@gmail.com</a>
</div>
</div>
</div>
Expand Down
Loading