Skip to content

Commit

Permalink
[publish]
Browse files Browse the repository at this point in the history
  • Loading branch information
MatrixAge committed Dec 16, 2020
1 parent 549bcf8 commit 1958c63
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 180 deletions.
12 changes: 6 additions & 6 deletions build/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@ const main = async () => {
} else {
fs.removeSync(paths.dist)
fs.mkdirSync(paths.dist)
}

}
fs.writeFileSync(`${paths.dist}/index.html`, await inject())
fs.copySync(paths.assets, paths.dist)
fs.copySync(paths.getPath('../src'), paths.dist)
fs.copySync(paths.getPath('../../src'), paths.dist)
fs.removeSync(`${paths.dist}/source.html`)

const less = await globby(`${paths.dist}/**/*.less`)

less.map(item => fs.removeSync(item))
less.map(item => fs.removeSync(item))

console.log('---------- picpic build success! ---------- \n')
}

try {
main()

console.log('---------- picpic build success! ---------- \n')
} catch (error) {
console.log('---------- picpic build error! ---------- \n')
console.error(error)
Expand Down
8 changes: 5 additions & 3 deletions build/inject/injectJs.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ const globby = require('globby')
const paths = require('../utils/paths')

module.exports = async str => {
const paths_source = await globby([ `${paths.getPath('../../src/components/**/*.js')}` ])
const paths_source = await globby([ `${paths.getPath('../../src/components/**/*.js')}`])
const paths_target = []

paths_source.map(item => paths_target.push(item.replace('src', '.')))

paths_source.map(item =>
paths_target.push(item.replace('src', '.').split('/').slice(-4).join('/'))
)

const items = paths_target.map(item => '<script src="' + item + '"></script>' + '\n')

return str.replace(
Expand Down
4 changes: 3 additions & 1 deletion build/inject/injectStyles.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ module.exports = async str => {
const paths_source = await globby([ `${paths.getPath('../../src/components/**/*.css')}` ])
const paths_target = []

paths_source.map(item => paths_target.push(item.replace('src', '.')))
paths_source.map(item =>
paths_target.push(item.replace('src', '.').split('/').slice(-4).join('/'))
)

const items = paths_target.map(item => '@import ' + "'" + item + "'" + ';' + '\n')

Expand Down
8 changes: 5 additions & 3 deletions build/inject/injectTemplates.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ const paths = require('../utils/paths')

module.exports = async str => {
const paths_source = await globby([ `${paths.getPath('../../src/components/**/*.html')}` ])
const paths_target = []
const paths_target = []

paths_source.map(item => paths_target.push(item.replace('src', '.')))
paths_source.map(item =>
paths_target.push(item.replace('src', '.').split('/').slice(-4).join('/'))
)

const items = paths_target.map(item => '<include src="' + item + '"></include>' + '\n')
const items = paths_target.map(item => '<include src="' + item + '"></include>' + '\n')

return str.replace(
`
Expand Down
2 changes: 1 addition & 1 deletion build/utils/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ module.exports = {
root: root,
dist: `${root}/dist`,
assets: `${root}/assets`,
getPath: p => path.join(__dirname,'../', p)
getPath: p => path.join(__dirname, p)
}
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@matrixage/picpic",
"version": "1.1.8",
"version": "1.2.3",
"description": "A awesome image bed by github pages.",
"keywords": [
"picpic",
Expand All @@ -19,8 +19,7 @@
"pages"
],
"scripts": {
"init": "picpic init",
"build": "picpic build"
"build": "node ./build/index.js"
},
"repository": {
"type": "git",
Expand Down
8 changes: 4 additions & 4 deletions src/components/FolderSelect/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
background-color: rgba(0, 0, 0, 0.72);
}
.folder_select_wrap .folder_select {
width: 30vw;
width: 500px;
height: 100vh;
background: rgba(248, 249, 253, 0.6);
overflow-x: hidden;
Expand Down Expand Up @@ -98,7 +98,7 @@
padding: 12px;
}
.folder_select_wrap .folder_select .content_wrap .content .content_item {
width: calc((30vw - 24px) / 4);
width: calc((500px - 24px) / 4);
box-sizing: border-box;
padding: 6px 12px;
padding-bottom: 12px;
Expand All @@ -120,7 +120,7 @@
}
.folder_select_wrap .folder_select .content_wrap .content .content_item .icon_folder {
width: 100%;
height: calc((30vw - 24px) / 4 - 30px);
height: calc((500px - 24px) / 4 - 30px);
display: flex;
mask-repeat: no-repeat;
-webkit-mask-repeat: no-repeat;
Expand All @@ -143,7 +143,7 @@
}
.folder_select_wrap .folder_select .content_wrap .content .content_item .img_item {
width: 100%;
height: calc((30vw - 24px) / 4 - 27px);
height: calc((500px - 24px) / 4 - 27px);
margin-bottom: 6px;
border-radius: 6px;
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/FolderSelect/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
-webkit-backdrop-filter: blur(9px);
background-color: rgba(0, 0, 0, 0.72);

@width: 30vw;
@width: 500px;

.folder_select {
width: @width;
Expand Down
63 changes: 11 additions & 52 deletions src/styles/mobile.css
Original file line number Diff line number Diff line change
@@ -1,23 +1,3 @@
@media screen and (max-width: 1400px) {
.folder_select_wrap .folder_select {
width: 36vw;
}
.folder_select_wrap .folder_select .content_wrap .content .content_item {
width: calc((36vw - 24px) / 4);
}
.folder_select_wrap .folder_select .content_wrap .content .content_item .icon_folder {
height: calc((36vw - 24px) / 4 - 30px);
}
.folder_select_wrap .folder_select .content_wrap .content .content_item .icon_folder .children {
bottom: 27px;
}
.folder_select_wrap .folder_select .content_wrap .content .content_item .icon_folder .size {
bottom: 12px;
}
.folder_select_wrap .folder_select .content_wrap .content .content_item .img_item {
height: calc((36vw - 24px) / 4 - 27px);
}
}
@media screen and (max-width: 1200px) {
.img_items .img_item_wrap {
width: calc(80vw / 4);
Expand All @@ -34,15 +14,6 @@
.detail_wrap .detail .img_item {
height: calc(100vw / 1.5);
}
.folder_select_wrap .folder_select .content_wrap .content .content_item .icon_folder {
font-size: 10px;
}
.folder_select_wrap .folder_select .content_wrap .content .content_item .icon_folder .children {
bottom: 22px;
}
.folder_select_wrap .folder_select .content_wrap .content .content_item .icon_folder .size {
bottom: 9px;
}
}
@media screen and (max-width: 1000px) {
.img_items.list .img_item_wrap {
Expand All @@ -64,25 +35,6 @@
.header_wrap .header .search_wrap .search .input {
width: 24vw;
}
.folder_select_wrap .folder_select {
width: 45vw;
}
.folder_select_wrap .folder_select .content_wrap .content .content_item {
width: calc((45vw - 24px) / 4);
}
.folder_select_wrap .folder_select .content_wrap .content .content_item .icon_folder {
height: calc((45vw - 24px) / 4 - 30px);
font-size: 8px;
}
.folder_select_wrap .folder_select .content_wrap .content .content_item .icon_folder .children {
display: none;
}
.folder_select_wrap .folder_select .content_wrap .content .content_item .icon_folder .size {
bottom: 9px;
}
.folder_select_wrap .folder_select .content_wrap .content .content_item .img_item {
height: calc((45vw - 24px) / 4 - 27px);
}
}
@media screen and (max-width: 800px) {
button:active {
Expand Down Expand Up @@ -185,19 +137,23 @@
.folder_select_wrap .folder_select .content_wrap .content .content_item .icon_folder {
height: calc((100vw - 24px) / 4 - 30px);
}
.folder_select_wrap .folder_select .content_wrap .content .content_item .icon_folder .children {
display: none;
}
.folder_select_wrap .folder_select .content_wrap .content .content_item .icon_folder .size {
display: none;
}
.folder_select_wrap .folder_select .content_wrap .content .content_item .img_item {
height: calc((100vw - 24px) / 4 - 27px);
}
}
@media screen and (max-width: 415px) {
.folder_select_wrap .folder_select .content_wrap .content .content_item .icon_folder .size {
display: inline-block;
.folder_select_wrap .folder_select .content_wrap .content .content_item .name {
font-size: 10px;
}
}
@media screen and (max-width: 376px) {
.header_wrap .header .left_wrap .name {
display: none;
}
.img_items.list .img_item_wrap .img_item {
height: 24vh;
}
Expand All @@ -209,6 +165,9 @@
}
}
@media screen and (max-width: 321px) {
.img_items {
padding-bottom: 15vh;
}
.img_items.list .img_item_wrap .img_item {
height: 27vh;
}
Expand Down
Loading

0 comments on commit 1958c63

Please sign in to comment.