Skip to content

Commit

Permalink
πŸ†• #17 - emotion.js λ„μž…
Browse files Browse the repository at this point in the history
  • Loading branch information
taeuk-gang committed Oct 1, 2019
1 parent 1a9c094 commit d1c713c
Show file tree
Hide file tree
Showing 6 changed files with 224 additions and 330 deletions.
61 changes: 31 additions & 30 deletions client/src/components/region-selector.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { html, render } from 'lit-html'
import i18next from 'i18next'
import { css, injectGlobal } from 'emotion'

export class regionSelector extends HTMLElement {
constructor() {
Expand All @@ -23,8 +24,7 @@ export class regionSelector extends HTMLElement {

render() {
return html`
${style}
<div class="list">
<div class="list ${styles}">
<ul>
<li>
<a class="item-link smart-select smart-select-init" data-open-in="popover">
Expand Down Expand Up @@ -59,45 +59,46 @@ export class regionSelector extends HTMLElement {
}
}

const style = html`
<style>
region-selector .list {
margin: 0;
}
const styles = css`
& {
& .list {
margin: 0;
}
region-selector .smart-select div.item-title {
max-width: none;
text-align: center;
font-size: 12px;
}
& .smart-select div.item-title {
max-width: none;
text-align: center;
font-size: 12px;
}
region-selector .smart-select div.item-after {
width: 100px;
max-width: none;
text-align: center;
font-weight: bold;
}
& .smart-select div.item-after {
width: 100px;
max-width: none;
text-align: center;
font-weight: bold;
}
region-selector .list ul:after, region-selector .list ul:before {
background-color: transparent;
}
& .list ul:after, & .list ul:before {
background-color: transparent;
}
region-selector .item-inner {
padding-left: 15px;
}
& .item-inner {
padding-left: 15px;
}
region-selector .item-inner:before {
content: 'chevron_down' !important;
& .item-inner:before {
content: 'chevron_down' !important;
}
}
`
injectGlobal`
[data-select-name="region"] .popover-inner {
max-height: none;
}
}
[data-select-name="region"].popover-on-right {
width: 180px;
}
</style>
`
`

customElements.define(`region-selector`, regionSelector)
69 changes: 0 additions & 69 deletions client/src/components/swiper-slider-nearby.js

This file was deleted.

59 changes: 32 additions & 27 deletions client/src/components/swiper-slider.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { html, render } from 'lit-html'
import i18next from 'i18next'
import { css, injectGlobal } from 'emotion'

export class SwiperSlider extends HTMLElement {
constructor() {
Expand All @@ -12,22 +13,28 @@ export class SwiperSlider extends HTMLElement {

render() {
return html`
${style}
<div data-pagination='{"el": ".swiper-pagination"}' data-space-between="50" class="swiper-container swiper-init demo-swiper">
<div class="swiper-pagination"></div>
<div class="swiper-wrapper">
<div class="swiper-slide">${i18next.t(`PICTURE_1`)}</div>
<div class="swiper-slide">Slide 2</div>
<div class="swiper-slide">Slide 3</div>
<div class="swiper-wrap ${styles}">
<div data-pagination='{"el": ".swiper-pagination"}' data-space-between="50" class="swiper-container swiper-init demo-swiper">
<div class="swiper-pagination"></div>
<div class="swiper-wrapper">
<div class="swiper-slide">${i18next.t(`PICTURE_1`)}</div>
<div class="swiper-slide">Slide 2</div>
<div class="swiper-slide">Slide 3</div>
</div>
</div>
</div>
</div>
`
}
}

const style = html`
<style>
injectGlobal`
swiper-slider {
overflow: hidden;
}
`

const styles = css`
& {
height: 150px;
margin: 1px;
position: relative;
Expand All @@ -40,27 +47,25 @@ swiper-slider {
border-radius: 15px;
overflow: hidden;
}
swiper-slider .swiper-container {
width: 100%;
height: 100%;
}
& .swiper-container {
width: 100%;
height: 100%;
}
swiper-slider .swiper-slide {
display: flex;
justify-content: center;
align-items: center;
}
& .swiper-slide {
display: flex;
justify-content: center;
align-items: center;
}
swiper-slider .swiper-slide:nth-child(1) {
background-image: url(https://storage.googleapis.com/mac-tour-251517.appspot.com/breweries/seoul-brewery1.jpg);
background-repeat: no-repeat;
background-size: cover;
background-position: center;
& .swiper-slide:nth-child(1) {
background-image: url(https://storage.googleapis.com/mac-tour-251517.appspot.com/breweries/seoul-brewery1.jpg);
background-repeat: no-repeat;
background-size: cover;
background-position: center;
}
}
</style>
`

customElements.define(`swiper-slider`, SwiperSlider)
Loading

0 comments on commit d1c713c

Please sign in to comment.