-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
493ed59
commit d515254
Showing
22 changed files
with
362 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
@import "../../assets/scss/variables"; | ||
@import "../../assets/scss/mixins"; | ||
|
||
.button-icon { | ||
display: block; | ||
width: var(--button-icon-size, 42px); | ||
height: var(--button-icon-size, 42px); | ||
cursor: pointer; | ||
box-sizing: border-box; | ||
border: none; | ||
user-select: none; | ||
border-radius: 2px; | ||
background: var(--button-icon-bgcolor, var(--color-content-bg)); | ||
transition: opacity 200ms ease-out; | ||
&[type='button'], &[type='submit'], &[type='reset'] { | ||
-webkit-appearance: button; | ||
outline: 0; | ||
} | ||
&:active { | ||
opacity: .5; | ||
} | ||
&__unit { | ||
display: block; | ||
margin: 0 auto; | ||
width: var(--button-icon-unit-size, 20px); | ||
height: var(--button-icon-unit-size, 20px); | ||
color: var(--button-icon-color, var(--color-base)); | ||
stroke-width: var(--button-icon-stroke, 2px); | ||
} | ||
&--link { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
&--disabled { | ||
cursor: not-allowed; | ||
opacity: .5; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<template> | ||
<a | ||
v-if="computedType === 'a'" | ||
:title="title" | ||
:href="href" | ||
:target="target" | ||
:class="computedClass"> | ||
<icon :name="iconName" class="button-icon__unit"/> | ||
</a> | ||
<nuxt-link | ||
v-else-if="computedType === 'router'" | ||
:title="title" | ||
:to="href" | ||
:class="computedClass"> | ||
<icon :name="iconName" class="button-icon__unit"/> | ||
</nuxt-link> | ||
<button | ||
v-else | ||
:type="computedType" | ||
:title="title" | ||
:class="computedClass"> | ||
<icon :name="iconName" class="button-icon__unit"/> | ||
</button> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'button-icon', | ||
components: { | ||
'icon': () => import('~/components/icon'), | ||
}, | ||
props: { | ||
iconName: { type: String, default: 'menu' }, | ||
href: { type: String }, | ||
target: { type: String }, | ||
title: { type: String }, | ||
disabled: { type: Boolean, default: false }, | ||
}, | ||
computed: { | ||
computedType() | ||
{ | ||
if (this.href) | ||
{ | ||
return /^http/.test(this.href) ? 'a' : 'router'; | ||
} | ||
switch (this.type) | ||
{ | ||
case 'reset': | ||
case 'submit': | ||
return this.type; | ||
case 'button': | ||
default: | ||
return 'button'; | ||
} | ||
}, | ||
computedClass() | ||
{ | ||
return [ | ||
'button-icon', | ||
(this.computedType === 'a' || this.computedType === 'router') && 'button-icon--link', | ||
this.disabled && 'button-icon--disabled', | ||
]; | ||
} | ||
}, | ||
} | ||
</script> | ||
|
||
<style src="./icon.scss" lang="scss" scoped></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.checklist-progress {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<template> | ||
<div class="checklist-progress"> | ||
.progress | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'checklist-progress', | ||
} | ||
</script> | ||
|
||
<style src="./progress.scss" lang="scss" scoped></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { compareDate } from '~/libs/dates'; | ||
|
||
/** | ||
* check time | ||
* 시간을 검사하여 아이템을 새로 추가할건지 마지막 데이터를 사용할건지 결정한다. | ||
* | ||
* @param {String|String[]} src `0000-00-00` | ||
* @param {String|String[]} resetTime `00:00` | ||
* @return {Boolean} 데이터를 새로 만드는 상황이라면 true | ||
*/ | ||
export function checkTime(src, resetTime) | ||
{ | ||
const now = new Date(); | ||
const reset = new Date(); | ||
reset.setHours(Number(resetTime.split(':')[0])); | ||
reset.setMinutes(Number(resetTime.split(':')[1])); | ||
reset.setSeconds(0); | ||
reset.setMilliseconds(0); | ||
src = src.split('-'); | ||
let srcDate = new Date(Number(src[0]), Number(src[1])-1, Number(src[2])); | ||
return ((now.getTime() > reset.getTime()) && compareDate(srcDate, now, '<')) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
@import "../assets/scss/variables"; | ||
@import "../assets/scss/mixins"; | ||
|
||
.checklist { | ||
&__wrap {} | ||
&__side {} | ||
&__body {} | ||
&__header-button { | ||
--button-icon-unit-size: 16px; | ||
} | ||
&__progress { | ||
position: sticky; | ||
left: 50%; | ||
bottom: 30px; | ||
border: 1px solid red; | ||
} | ||
} |
Oops, something went wrong.