diff --git a/src/cpns/ClipFullData.vue b/src/cpns/ClipFullData.vue new file mode 100644 index 0000000..8f2db80 --- /dev/null +++ b/src/cpns/ClipFullData.vue @@ -0,0 +1,35 @@ + + + + + diff --git a/src/cpns/ClipItemList.vue b/src/cpns/ClipItemList.vue new file mode 100644 index 0000000..df40884 --- /dev/null +++ b/src/cpns/ClipItemList.vue @@ -0,0 +1,60 @@ + + + + + diff --git a/src/cpns/FileList.vue b/src/cpns/FileList.vue index 89e3475..e8844ea 100644 --- a/src/cpns/FileList.vue +++ b/src/cpns/FileList.vue @@ -27,21 +27,6 @@ export default { } - diff --git a/src/style/cpns/clip-full-data.less b/src/style/cpns/clip-full-data.less new file mode 100644 index 0000000..e8cf64c --- /dev/null +++ b/src/style/cpns/clip-full-data.less @@ -0,0 +1,20 @@ +.clip-full { + z-index: 9999999999; + position: fixed; + top: 0; + height: 100%; + width: 60%; + background: white; + padding: 0px 20px 0px 20px; + overflow-y: scroll; + word-break: break-all; + white-space: pre-wrap; +} +.clip-overlay { + z-index: 999999999; + position: fixed; + top: 0; + height: 100%; + width: 100%; + background: rgba(0, 0, 0, 0.5); +} diff --git a/src/style/cpns/clip-item-list.less b/src/style/cpns/clip-item-list.less new file mode 100644 index 0000000..f634cc6 --- /dev/null +++ b/src/style/cpns/clip-item-list.less @@ -0,0 +1,76 @@ +@import '../style/variable.less'; +.clip-item { + display: flex; + justify-content: space-between; + border: 0px solid #eee; + border-width: 0px 0px 1px 0px; + cursor: pointer; + &:hover { + background-color: @text-bg-color-lighter; + transition: all 0.15s; + } + .clip-info { + display: flex; + justify-content: center; + align-items: center; + font-size: 14px; + padding: 10px; + .clip-time { + display: flex; + justify-content: center; + align-items: center; + min-width: 100px; + span { + display: flex; + justify-content: center; + align-items: center; + font-size: 13px; + color: @text-color-lighter; + background-color: @text-bg-color; + border-radius: 5px; + min-width: 50px; + padding: 5px 10px 5px 10px; + } + } + .clip-data { + display: flex; + overflow: hidden; + word-break: break-all; + max-height: 150px; + padding: 5px; + white-space: pre-wrap; + flex-direction: column; + background-color: white; + img { + max-height: 150px; + } + .clip-image-size { + position: absolute; + background-color: white; + } + } + } + .clip-count { + display: flex; + align-items: center; + justify-content: center; + min-width: 50px; + padding: 10px; + font-size: 13px; + color: @text-color-lighter; + padding: 10px; + } + .clip-more { + display: flex; + justify-content: center; + align-items: center; + padding: 10px; + font-size: 13px; + cursor: pointer; + border-radius: 0px 5px 5px 0px; + } + .clip-more:hover { + background-color: @text-bg-color; + transition: all 0.15s; + } +} diff --git a/src/style/cpns/file-list.less b/src/style/cpns/file-list.less new file mode 100644 index 0000000..973b073 --- /dev/null +++ b/src/style/cpns/file-list.less @@ -0,0 +1,16 @@ +.clip-file { + display: flex; + justify-content: flex-start; + align-items: center; + cursor: pointer; + &:hover { + font-weight: 600; + &::after { + content: '📤'; + } + } + .clip-file-icon { + width: 15px; + height: 15px; + } +} diff --git a/src/style/variable.less b/src/style/variable.less new file mode 100644 index 0000000..be5159d --- /dev/null +++ b/src/style/variable.less @@ -0,0 +1,6 @@ +@primary-color: #8a2be2; +@primary-color-lighter: #d3b8ec; +@text-color: #333; +@text-color-lighter: rgb(138, 138, 138); +@text-bg-color: #e3d9ec; +@text-bg-color-lighter: #eeeaf3; diff --git a/src/utils/index.js b/src/utils/index.js new file mode 100644 index 0000000..6ffbfe8 --- /dev/null +++ b/src/utils/index.js @@ -0,0 +1,22 @@ +const dateFormat = (timeStamp) => { + const startTime = new Date(timeStamp) // 开始时间 + const endTime = new Date() // 结束时间 + const gaps = [ + Math.floor((endTime - startTime) / 1000 / 60), // 分钟 + Math.floor((endTime - startTime) / 1000 / 60 / 60), // 小时 + Math.floor((endTime - startTime) / 1000 / 60 / 60 / 24) // 天 + ] + let info = '' + if (gaps[2] > 0) { + info = `${gaps[2]}天前` + } else if (gaps[1] > 0) { + info = `${gaps[1]}小时前` + } else if (gaps[0] > 0) { + info = `${gaps[0]}分钟前` + } else { + info = '刚刚' + } + return info +} + +export { dateFormat } diff --git a/src/views/Main.vue b/src/views/Main.vue index ce2f8bd..93221d1 100644 --- a/src/views/Main.vue +++ b/src/views/Main.vue @@ -1,17 +1,11 @@ -