Skip to content

Commit

Permalink
docs(*): fix some docs error
Browse files Browse the repository at this point in the history
  • Loading branch information
olivewind committed Oct 12, 2018
1 parent 68c051e commit ddcec3d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 135 deletions.
2 changes: 1 addition & 1 deletion examples/plugins/i18n/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default {
show_more: 'Load More...',
index: {
desc: 'A high quality component library built on Vue.js',
cr: 'Build and Maintained Open‑Source by {company}',
cr: 'Build and Maintained by {company}',
},
installationPage: {
use_npm: 'Using npm',
Expand Down
2 changes: 1 addition & 1 deletion examples/utils/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const LangKey = 'DaoStyleLang';

function getLang() {
return localStorage.getItem(LangKey) || 'zh';
return localStorage.getItem(LangKey) || 'en';
}

function setLang(lang) {
Expand Down
2 changes: 1 addition & 1 deletion examples/view/demos/dialog/demo-1.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="dao-dialog demo1">
<button class="dao-btn blue" @click="config.visible = true">最简单的默认版本</button>
<dao-dialog :visible.sync="config.visible">
<dao-dialog :visible.sync="config.visible" header="demo1">
<div class="body">
在这里自定义Dialog 内容
</div>
Expand Down
2 changes: 1 addition & 1 deletion examples/view/page/components/dialog/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
</template>
</docs-section>
<docs-section>
<template slot="title">垂直居中</template>
<template slot="title">修改 top 和 bottom</template>
<template slot="content">
<demo-code>
<demo9 slot="demo"></demo9>
Expand Down
135 changes: 4 additions & 131 deletions examples/view/page/index/index.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<template>
<div class="index">
<canvas id="canvas">
</canvas>
<div class="center">
<div class="name">
<svg class="icon">
Expand All @@ -25,131 +23,19 @@

<script>
// https://codepen.io/wulv5/pen/dpRmjR
/* eslint-disable */
// function renderStar() {
// window.requestAnimFrame = (function() {
// return (
// window.requestAnimationFrame ||
// window.webkitRequestAnimationFrame ||
// window.mozRequestAnimationFrame ||
// function(callback) {
// window.setTimeout(callback, 1000 / 60);
// }
// );
// })();
// let canvas = document.getElementById('canvas'),
// ctx = canvas.getContext('2d'),
// w = (canvas.width = window.innerWidth),
// h = (canvas.height = window.innerHeight),
// hue = 217,
// stars = [],
// count = 0,
// maxStars = 1200;
// let canvas2 = document.createElement('canvas'),
// ctx2 = canvas2.getContext('2d');
// canvas2.width = 100;
// canvas2.height = 100;
// let half = canvas2.width / 2,
// gradient2 = ctx2.createRadialGradient(half, half, 0, half, half, half);
// gradient2.addColorStop(0.025, '#fff');
// gradient2.addColorStop(0.1, 'hsl(' + hue + ', 61%, 33%)');
// gradient2.addColorStop(0.25, 'hsl(' + hue + ', 64%, 6%)');
// gradient2.addColorStop(1, 'transparent');
// ctx2.fillStyle = gradient2;
// ctx2.beginPath();
// ctx2.arc(half, half, half, 0, Math.PI * 2);
// ctx2.fill();
// function random(min, max) {
// if (arguments.length < 2) {
// max = min;
// min = 0;
// }
// if (min > max) {
// let hold = max;
// max = min;
// min = hold;
// }
// return Math.floor(Math.random() * (max - min + 1)) + min;
// }
// function maxOrbit(x, y) {
// let max = Math.max(x, y),
// diameter = Math.round(Math.sqrt(max * max + max * max));
// return diameter / 2;
// }
// let Star = function() {
// this.orbitRadius = random(maxOrbit(w, h));
// this.radius = random(60, this.orbitRadius) / 12;
// this.orbitX = w / 2;
// this.orbitY = h / 2;
// this.timePassed = random(0, maxStars);
// this.speed = random(this.orbitRadius) / 900000;
// this.alpha = random(2, 10) / 10;
// count++;
// stars[count] = this;
// };
// Star.prototype.draw = function() {
// let x = Math.sin(this.timePassed) * this.orbitRadius + this.orbitX,
// y = Math.cos(this.timePassed) * this.orbitRadius + this.orbitY,
// twinkle = random(10);
// if (twinkle === 1 && this.alpha > 0) {
// this.alpha -= 0.05;
// } else if (twinkle === 2 && this.alpha < 1) {
// this.alpha += 0.05;
// }
// ctx.globalAlpha = this.alpha;
// ctx.drawImage(
// canvas2,
// x - this.radius / 2,
// y - this.radius / 2,
// this.radius,
// this.radius
// );
// this.timePassed += this.speed;
// };
// for (let i = 0; i < maxStars; i += 1) {
// new Star();
// }
// function animation() {
// ctx.globalCompositeOperation = 'source-over';
// ctx.globalAlpha = 0.8;
// ctx.fillStyle = 'hsla(' + hue + ', 64%, 6%, 1)';
// ctx.fillRect(0, 0, w, h);
// ctx.globalCompositeOperation = 'lighter';
// for (let i = 1, l = stars.length; i < l; i += 1) {
// stars[i].draw();
// }
// window.requestAnimationFrame(animation);
// }
// animation();
// }
export default {
name: 'Index',
mounted() {
// this.renderStar();
// window.addEventListener('resize', this.renderStar);
},
methods: {
// renderStar() {
// renderStar();
// },
goToGetStarted() {
this.$router.push('/components/installation');
},
},
// destroyed() {
// window.removeEventListener('resize', this.renderStar);
// },
};
</script>

<style lang="scss" scoped>
@import "daoColor";
.index {
background: $black-light;
background: #060e1b;
overflow: hidden;
height: 100vh;
Expand All @@ -160,42 +46,29 @@ export default {
color: $white;
.center {
z-index: 1;
.name,
.desc {
margin-bottom: 25px;
}
max-width: 80vw;
.name {
font-size: 22px;
margin-bottom: 40px;
svg {
height: 32px;
width: 32px;
}
@media (max-width: 768px) {
font-size: 32px;
svg {
height: 45px;
width: 45px;
}
}
}
.desc {
margin-bottom: 50px;
h2 {
font-size: 36px;
}
h4 {
font-size: 20px;
margin-top: 25px;
font-weight: 400;
a {
color: $white;
}
}
}
}
canvas {
opacity: 0.5;
position: absolute;
top: 0;
left: 0;
}
}
</style>

0 comments on commit ddcec3d

Please sign in to comment.