Skip to content

Commit

Permalink
chore: one-div
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmlzhou committed Oct 13, 2019
1 parent 8da44ac commit 22fa05b
Show file tree
Hide file tree
Showing 14 changed files with 512 additions and 0 deletions.
49 changes: 49 additions & 0 deletions one-div/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<template>
<div id="app">
<router-view />
</div>
</template>

<style>
* {
margin: 0;
padding: 0;
}
a {
text-decoration: inherit;
}
em {
font-style: normal;
}
ul,
ol {
list-style: none;
}
h1,
h2,
h3,
h4 {
font: inherit;
}
input,
select,
button {
font: inherit;
}
html,
body {
height: 100%;
-webkit-user-select: none;
-webkit-touch-callout: none;
-webkit-tap-highlight-color: transparent;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
background-image: linear-gradient(45deg, #f4f1ff, #fff5f5);
}
#app {
height: 100%;
overflow: hidden;
}
</style>
14 changes: 14 additions & 0 deletions one-div/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# one-div

### Compiles and hot-reloads for development
```
npm run serve
```

### Compiles and minifies for production
```
npm run build
```

### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
Binary file added one-div/assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 50 additions & 0 deletions one-div/components/BubbleLoading.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<template>
<div class="bubble-loading">20%</div>
</template>

<style>
@keyframes rotate2 {
0% {
transform: rotate(0deg) translateY(-2px);
}
100% {
transform: rotate(360deg) translateY(-2px);
}
}
.bubble-loading {
position: relative;
display: flex;
justify-content: center;
align-items: center;
border-radius: 100%;
width: 40px;
height: 40px;
background-image: linear-gradient(45deg, rgb(14, 14, 46), rgb(64, 64, 113));
color: white;
font-size: 12px;
font-weight: bold;
box-shadow: 0 3px 2px 1px rgba(0, 0, 0, 0.2);
}
.bubble-loading::before,
.bubble-loading::after {
content: '';
position: absolute;
left: 50%;
top: 50%;
display: block;
margin-left: -20px;
margin-top: -20px;
width: 40px;
height: 40px;
border-radius: 100%;
background-color: rgb(51, 149, 230);
transform: translateY(-2px);
z-index: -1;
}
.bubble-loading::before {
animation: rotate2 infinite 3s linear;
}
.bubble-loading::after {
animation: rotate2 infinite 2s linear;
}
</style>
44 changes: 44 additions & 0 deletions one-div/components/CircleLoading.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<template>
<div class="circle-loading">20%</div>
</template>

<style>
@keyframes rotate1 {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.circle-loading {
position: relative;
display: flex;
justify-content: center;
align-items: center;
border: 4px solid rgb(184, 187, 191);
border-radius: 100%;
width: 40px;
height: 40px;
font-size: 12px;
font-weight: bold;
box-shadow: 0 1px 2px 1px rgba(0, 0, 0, 0.2),
inset 0 1px 2px 1px rgba(0, 0, 0, 0.2);
color: rgb(172, 28, 177);
}
.circle-loading::before {
content: '';
position: absolute;
left: 50%;
top: 50%;
margin-left: -24px;
margin-top: -24px;
display: block;
border: 4px solid transparent;
border-top-color: rgb(172, 28, 177);
border-radius: 100%;
width: 40px;
height: 40px;
animation: rotate1 infinite 2s ease;
}
</style>
42 changes: 42 additions & 0 deletions one-div/components/FloatingButton.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<template>
<div class="floating-btn" />
</template>

<style>
.floating-btn {
position: relative;
width: 40px;
height: 40px;
border-radius: 100%;
background-image: linear-gradient(45deg, #52ffaf, #2196f3);
box-shadow: 0 1px 2px 1px #52ffafa3;
}
.floating-btn::before,
.floating-btn::after {
content: '';
position: absolute;
left: 50%;
top: 0;
display: block;
margin-left: -9px;
border-radius: 3px;
width: 18px;
height: 3px;
background-color: white;
transition: all 0.2s ease;
}
.floating-btn::before {
transform: translateY(12px);
filter: drop-shadow(0 6px 0 white);
}
.floating-btn::after {
transform: translateY(24px);
}
.floating-btn:active::before {
filter: none;
transform: translateY(18px) rotate(-45deg);
}
.floating-btn:active::after {
transform: translateY(18px) rotate(45deg);
}
</style>
57 changes: 57 additions & 0 deletions one-div/components/PlayButton.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<template>
<div class="play-btn" />
</template>

<style>
.play-btn {
position: relative;
width: 40px;
height: 40px;
border-radius: 100%;
background-image: linear-gradient(45deg, #5298ff, #ff00a8);
box-shadow: 0 1px 2px 1px #5297ffa3;
}
.play-btn::before {
content: '';
position: absolute;
left: 21px;
top: 50%;
margin-left: -4px;
margin-top: -8px;
width: 0;
height: 0;
border: 10px solid transparent;
border-left-color: white;
border-top-width: 8px;
border-bottom-width: 8px;
filter: drop-shadow(0 2px 1px rgba(0, 0, 0, 0.2));
transition: all 0.2s ease;
will-change: border-width, height, left;
}
.play-btn::after {
content: '';
position: absolute;
right: 16px;
top: 50%;
margin-right: -4px;
margin-top: -8px;
width: 0;
height: 16px;
border: 5px solid transparent;
border-width: 0 0 0 5px;
border-left-color: white;
filter: drop-shadow(0 2px 1px rgba(0, 0, 0, 0.2));
opacity: 0;
transform: scale(0);
transition: all 0.2s ease;
}
.play-btn:active::before {
border-width: 0 0 0 5px;
height: 16px;
left: 16px;
}
.play-btn:active::after {
opacity: 1;
transform: scale(1);
}
</style>
42 changes: 42 additions & 0 deletions one-div/components/ProgressBar.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<template>
<div class="progress-bar" />
</template>

<style>
.progress-bar {
position: relative;
border-radius: 8px;
width: 60px;
height: 20px;
background-color: #eee;
transform: translateY(-34%);
}
.progress-bar::before {
content: '';
position: relative;
z-index: 1;
display: block;
border-radius: 8px;
height: 20px;
width: 50%;
background-image: linear-gradient(0deg, #ff7a3b, #ffc107);
box-shadow: 0 1px 2px 0 #ff7a3ba3;
filter: drop-shadow(2px 0 1px rgba(0, 0, 0, 0.2));
transition: all 0.2s ease;
}
.progress-bar::after {
content: '50%';
position: absolute;
left: 50%;
transform: scale(0.9) translate(-50%, 20%);
font-size: 12px;
font-weight: bold;
color: #54390f;
}
.progress-bar:active::before {
width: 100%;
}
.progress-bar:active::after {
content: '100%';
}
</style>
Loading

0 comments on commit 22fa05b

Please sign in to comment.