Skip to content

Commit 3aebe10

Browse files
committed
clean and some bit update
1 parent e388237 commit 3aebe10

File tree

14 files changed

+60
-45
lines changed

14 files changed

+60
-45
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
node_modules/
22
dist/
3+
*.log

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"main": "index.js",
66
"scripts": {
77
"start": "webpack-dev-server",
8-
"build": "webpack --mode=production"
8+
"build": "webpack --mode production"
99
},
1010
"keywords": [],
1111
"author": "",

src/components/global/footer/footer.scss

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#footer {
2+
@include global-container;
3+
24
background-size: cover;
35
background-image: url("./img/footer_bg.jpg");
46
background-repeat: no-repeat;

src/components/global/footer/footer.vue

+8-2
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,19 @@
3030
</div>
3131

3232
<div class="footer_credit">
33-
<p>Copyright &copy; 2010-2020 WorkStore Tokyo Do.<br>All Rights Reserved.</p>
33+
<p>Copyright &copy; 2010-{{ current }} WorkStore Tokyo Do.<br>All Rights Reserved.</p>
3434
</div>
3535
</footer>
3636
</template>
3737

3838
<script>
39-
39+
export default {
40+
computed: {
41+
current() {
42+
return (new Date()).getFullYear();
43+
}
44+
}
45+
};
4046
</script>
4147

4248
<style src="./footer.scss" lang="scss" scoped />

src/components/global/header/header.js

+9-10
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@ import media from '../../../js/media';
33
const cls = 'active';
44
const speed = 350;
55

6-
let header, toggle, brands, menus, others;
6+
let toggle, brands, menus, others;
77

88
const initCollapse = () => {
9-
header = document.getElementById('header');
10-
toggle = header.querySelector('.header_gnav_btn a');
11-
brands = header.querySelector('.header_gnav_brand');
12-
menus = header.querySelector('.header_gnav_menu');
13-
others = header.querySelector('.header_gnav_other');
9+
if (!toggle && !brands && !menus && !others) {
10+
const header = document.getElementById('header');
11+
toggle = header.querySelector('.header_gnav_btn a');
12+
brands = header.querySelector('.header_gnav_brand');
13+
menus = header.querySelector('.header_gnav_menu');
14+
others = header.querySelector('.header_gnav_other');
15+
}
1416

1517
media.init();
1618

@@ -27,9 +29,6 @@ const initCollapse = () => {
2729
};
2830

2931
export default {
30-
data() {
31-
return { speed };
32-
},
3332
mounted() {
3433
this.initialize();
3534

@@ -55,7 +54,7 @@ export default {
5554
$(others).slideToggle(speed);
5655
}
5756

58-
this.$emit('toggle-header-collapse', this.speed);
57+
this.$emit('toggle-header-collapse', speed);
5958
}
6059
}
6160
}

src/components/global/header/header.scss

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#header {
2+
@include global-container;
3+
24
position: fixed;
35
top: 0;
46
z-index: 20000;
@@ -78,7 +80,6 @@
7880
z-index: 20000;
7981

8082
@include phone {
81-
// min-width: calc(100vw - 30px); // 要らない気がする
8283
width: calc(100vw - 30px);
8384
left: 15px;
8485
}
@@ -452,6 +453,7 @@
452453
display: block;
453454
position: relative;
454455
opacity: 1;
456+
cursor: pointer;
455457

456458
@include phone {
457459
width: 50px;

src/components/global/pagetop/pagetop.vue

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export default {
3535
display: none;
3636
position: fixed;
3737
z-index: 19999;
38+
cursor: pointer;
3839
3940
@include phone {
4041
right: 10px;

src/css/core/mixin/_layout.scss

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
@mixin global-container {
2+
width: 100%;
3+
4+
@include desktop {
5+
min-width: 1080px;
6+
}
7+
}

src/css/core/mixin/_media-query.scss

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
@mixin phone {
2+
@media (max-width: 896px) {
3+
@content;
4+
}
5+
}
6+
7+
@mixin desktop {
8+
@media (min-width: 897px) {
9+
@content;
10+
}
11+
}

src/css/core/mixin/_mixin.scss

+2-13
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
1-
// Media queries
2-
// - Phone
3-
@mixin phone {
4-
@media (max-width: 896px) {
5-
@content;
6-
}
7-
}
8-
// - Desktop
9-
@mixin desktop {
10-
@media (min-width: 897px) {
11-
@content;
12-
}
13-
}
1+
@import "media-query";
2+
@import "layout";
143

154
// Kick out text
165
@mixin kick-out-text {

src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ const router = new VueRouter({
1414
new Vue({
1515
el: '#app',
1616
components: { Web },
17-
template: '<Web/>',
17+
template: '<web/>',
1818
router
1919
});

src/layouts/web-frame.vue

+11-14
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33
<global-header @init-header="initOverlay" @toggle-header-collapse="toggleOverlay" />
44

55
<div class="header_overlay"></div>
6+
67
<div id="loader"></div>
78

89
<div id="contents">
910
<slot></slot>
1011
</div>
1112

1213
<global-footer />
14+
1315
<global-page-top />
1416
</div>
1517
</template>
@@ -47,21 +49,16 @@ export default {
4749
</script>
4850

4951
<style lang="scss" scoped>
50-
#header,
51-
#contents,
52-
#footer {
53-
width: 100%;
54-
55-
@include desktop {
56-
min-width: 1080px;
57-
}
58-
}
5952
#contents {
60-
@include phone {
61-
padding: 48px 15px 55px;
62-
}
63-
@include desktop {
64-
padding: 90px 40px 110px;
53+
@include global-container;
54+
55+
> * {
56+
@include phone {
57+
padding: 48px 15px 55px;
58+
}
59+
@include desktop {
60+
padding: 90px 40px 110px;
61+
}
6562
}
6663
}
6764

src/web.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
2-
<WebFrame>
2+
<web-frame>
33
<router-view></router-view>
4-
</WebFrame>
4+
</web-frame>
55
</template>
66

77
<script>

webpack.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const path = require('path');
22
const dist = path.resolve(__dirname, 'dist');
3-
const mode = process.env.NODE_ENV;
3+
const mode = (process.env.NODE_ENV === 'production') ? 'production' : 'development';
44

55
const HtmlWebpackPlugin = require('html-webpack-plugin');
66
const MiniCssExtractPlugin = require('mini-css-extract-plugin');

0 commit comments

Comments
 (0)