Skip to content

Commit

Permalink
+ [html5] add components styles
Browse files Browse the repository at this point in the history
  • Loading branch information
Hanks10100 committed Dec 18, 2016
1 parent 5146abc commit 781c8e4
Show file tree
Hide file tree
Showing 4 changed files with 371 additions and 1 deletion.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
html5/test/case/*/*.source.js
html5/test/case/*/*.output.js
html5/test/render/vue/vender/*
*.css
9 changes: 8 additions & 1 deletion html5/render/vue/env.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import './styles/reset.css'
import './styles/components.css'

import '../../shared/arrayFrom'
import '../../shared/objectAssign'
import '../../shared/objectSetPrototypeOf'
// TODO: Promise polyfill

import 'core-js/modules/es6.object.to-string'
import 'core-js/modules/es6.string.iterator'
import 'core-js/modules/web.dom.iterable'
import 'core-js/modules/es6.promise'

// TODO: parse UA
const ua = navigator.userAgent
Expand Down
303 changes: 303 additions & 0 deletions html5/render/vue/styles/components.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,303 @@
a, .weex-a {
display: block;
text-decoration: none;
}

div, .weex-div, .weex-container {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
-webkit-flex-shrink: 0;
-ms-flex-negative: 0;
flex-shrink: 0;
-webkit-box-align: stretch;
-webkit-align-items: stretch;
-ms-flex-align: stretch;
align-items: stretch;
box-align: stretch;
-webkit-align-content: flex-start;
-ms-flex-line-pack: start;
align-content: flex-start;
}

figure, img, .weex-image, .weex-img {
display: block;
background-repeat: no-repeat;
}

.weex-list,
.weex-list-wrapper {
position: relative;
background-color: #888888;
overflow: scroll;
}

.weex-list-inner {
background-color: #FFFFFF;
}

.weex-list-top-mark {
width: 100%;
height: 0;
visibility: hidden;
}

.weex-list-bottom-mark {
width: 100%;
height: 0;
visibility: hidden;
}

.weex-refresh,
.weex-loading {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: center;
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
width: 100%;
height: 0;
overflow: hidden;
position: absolute;
visibility: hidden;
z-index: 100;
}

.weex-refresh {
top: 0;
}

.weex-loading {
bottom: 0;
bottom: -212px;
}

.weex-scroller-wrapper {
overflow: scroll;
}

.weex-scroller-top-mark {
width: 100%;
height: 0;
visibility: hidden;
}

.weex-scroller-bottom-mark {
width: 100%;
height: 0;
visibility: hidden;
}

.weex-slider-wrapper {
overflow: hidden;
position: relative;
}

.weex-slider-inner {
position: absolute;
height: 100%;
top: 0;
left: 0;
}

.weex-slider-cell {
display: block;
float: left;
margin: 0;
padding: 0;
height: 100%;
overflow: hidden;
}

.weex-indicator {
position: absolute;
right: 30px;
bottom: 10px;
margin: 0;
padding: 10px 20px;
}

.weex-indicator-item {
display: inline-block;
border-radius: 50%;
width: 20px;
height: 20px;
background-color: #BBBBBB;
}
.weex-indicator-item + .weex-indicator-item {
margin-left: 10px;
}

.weex-indicator-item-active {
background-color: blue;
}

.weex-refresh-indicator,
.weex-loading-indicator {
width: 1.013333rem;
/* 76px */
height: 1.013333rem;
-webkit-box-align: center;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: center;
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
overflow: visible;
background: none;
}
.weex-refresh-indicator:before,
.weex-loading-indicator:before {
display: block;
content: '';
font-size: 0.16rem;
/* 12px */
width: 1em;
height: 1em;
border-radius: 50%;
position: relative;
text-indent: -9999em;
-webkit-animation: weex-spinner 1.1s infinite ease;
animation: weex-spinner 1.1s infinite ease;
-webkit-transform: translateZ(0);
transform: translateZ(0);
}

@-webkit-keyframes weex-spinner {
0%,
100% {
box-shadow: 0em -2.6em 0em 0em #ffffff, 1.8em -1.8em 0 0em rgba(255, 255, 255, 0.2), 2.5em 0em 0 0em rgba(255, 255, 255, 0.2), 1.75em 1.75em 0 0em rgba(255, 255, 255, 0.2), 0em 2.5em 0 0em rgba(255, 255, 255, 0.2), -1.8em 1.8em 0 0em rgba(255, 255, 255, 0.2), -2.6em 0em 0 0em rgba(255, 255, 255, 0.5), -1.8em -1.8em 0 0em rgba(255, 255, 255, 0.7);
}
12.5% {
box-shadow: 0em -2.6em 0em 0em rgba(255, 255, 255, 0.7), 1.8em -1.8em 0 0em #ffffff, 2.5em 0em 0 0em rgba(255, 255, 255, 0.2), 1.75em 1.75em 0 0em rgba(255, 255, 255, 0.2), 0em 2.5em 0 0em rgba(255, 255, 255, 0.2), -1.8em 1.8em 0 0em rgba(255, 255, 255, 0.2), -2.6em 0em 0 0em rgba(255, 255, 255, 0.2), -1.8em -1.8em 0 0em rgba(255, 255, 255, 0.5);
}
25% {
box-shadow: 0em -2.6em 0em 0em rgba(255, 255, 255, 0.5), 1.8em -1.8em 0 0em rgba(255, 255, 255, 0.7), 2.5em 0em 0 0em #ffffff, 1.75em 1.75em 0 0em rgba(255, 255, 255, 0.2), 0em 2.5em 0 0em rgba(255, 255, 255, 0.2), -1.8em 1.8em 0 0em rgba(255, 255, 255, 0.2), -2.6em 0em 0 0em rgba(255, 255, 255, 0.2), -1.8em -1.8em 0 0em rgba(255, 255, 255, 0.2);
}
37.5% {
box-shadow: 0em -2.6em 0em 0em rgba(255, 255, 255, 0.2), 1.8em -1.8em 0 0em rgba(255, 255, 255, 0.5), 2.5em 0em 0 0em rgba(255, 255, 255, 0.7), 1.75em 1.75em 0 0em #ffffff, 0em 2.5em 0 0em rgba(255, 255, 255, 0.2), -1.8em 1.8em 0 0em rgba(255, 255, 255, 0.2), -2.6em 0em 0 0em rgba(255, 255, 255, 0.2), -1.8em -1.8em 0 0em rgba(255, 255, 255, 0.2);
}
50% {
box-shadow: 0em -2.6em 0em 0em rgba(255, 255, 255, 0.2), 1.8em -1.8em 0 0em rgba(255, 255, 255, 0.2), 2.5em 0em 0 0em rgba(255, 255, 255, 0.5), 1.75em 1.75em 0 0em rgba(255, 255, 255, 0.7), 0em 2.5em 0 0em #ffffff, -1.8em 1.8em 0 0em rgba(255, 255, 255, 0.2), -2.6em 0em 0 0em rgba(255, 255, 255, 0.2), -1.8em -1.8em 0 0em rgba(255, 255, 255, 0.2);
}
62.5% {
box-shadow: 0em -2.6em 0em 0em rgba(255, 255, 255, 0.2), 1.8em -1.8em 0 0em rgba(255, 255, 255, 0.2), 2.5em 0em 0 0em rgba(255, 255, 255, 0.2), 1.75em 1.75em 0 0em rgba(255, 255, 255, 0.5), 0em 2.5em 0 0em rgba(255, 255, 255, 0.7), -1.8em 1.8em 0 0em #ffffff, -2.6em 0em 0 0em rgba(255, 255, 255, 0.2), -1.8em -1.8em 0 0em rgba(255, 255, 255, 0.2);
}
75% {
box-shadow: 0em -2.6em 0em 0em rgba(255, 255, 255, 0.2), 1.8em -1.8em 0 0em rgba(255, 255, 255, 0.2), 2.5em 0em 0 0em rgba(255, 255, 255, 0.2), 1.75em 1.75em 0 0em rgba(255, 255, 255, 0.2), 0em 2.5em 0 0em rgba(255, 255, 255, 0.5), -1.8em 1.8em 0 0em rgba(255, 255, 255, 0.7), -2.6em 0em 0 0em #ffffff, -1.8em -1.8em 0 0em rgba(255, 255, 255, 0.2);
}
87.5% {
box-shadow: 0em -2.6em 0em 0em rgba(255, 255, 255, 0.2), 1.8em -1.8em 0 0em rgba(255, 255, 255, 0.2), 2.5em 0em 0 0em rgba(255, 255, 255, 0.2), 1.75em 1.75em 0 0em rgba(255, 255, 255, 0.2), 0em 2.5em 0 0em rgba(255, 255, 255, 0.2), -1.8em 1.8em 0 0em rgba(255, 255, 255, 0.5), -2.6em 0em 0 0em rgba(255, 255, 255, 0.7), -1.8em -1.8em 0 0em #ffffff;
}
}
@keyframes weex-spinner {
0%,
100% {
box-shadow: 0em -2.6em 0em 0em #ffffff, 1.8em -1.8em 0 0em rgba(255, 255, 255, 0.2), 2.5em 0em 0 0em rgba(255, 255, 255, 0.2), 1.75em 1.75em 0 0em rgba(255, 255, 255, 0.2), 0em 2.5em 0 0em rgba(255, 255, 255, 0.2), -1.8em 1.8em 0 0em rgba(255, 255, 255, 0.2), -2.6em 0em 0 0em rgba(255, 255, 255, 0.5), -1.8em -1.8em 0 0em rgba(255, 255, 255, 0.7);
}
12.5% {
box-shadow: 0em -2.6em 0em 0em rgba(255, 255, 255, 0.7), 1.8em -1.8em 0 0em #ffffff, 2.5em 0em 0 0em rgba(255, 255, 255, 0.2), 1.75em 1.75em 0 0em rgba(255, 255, 255, 0.2), 0em 2.5em 0 0em rgba(255, 255, 255, 0.2), -1.8em 1.8em 0 0em rgba(255, 255, 255, 0.2), -2.6em 0em 0 0em rgba(255, 255, 255, 0.2), -1.8em -1.8em 0 0em rgba(255, 255, 255, 0.5);
}
25% {
box-shadow: 0em -2.6em 0em 0em rgba(255, 255, 255, 0.5), 1.8em -1.8em 0 0em rgba(255, 255, 255, 0.7), 2.5em 0em 0 0em #ffffff, 1.75em 1.75em 0 0em rgba(255, 255, 255, 0.2), 0em 2.5em 0 0em rgba(255, 255, 255, 0.2), -1.8em 1.8em 0 0em rgba(255, 255, 255, 0.2), -2.6em 0em 0 0em rgba(255, 255, 255, 0.2), -1.8em -1.8em 0 0em rgba(255, 255, 255, 0.2);
}
37.5% {
box-shadow: 0em -2.6em 0em 0em rgba(255, 255, 255, 0.2), 1.8em -1.8em 0 0em rgba(255, 255, 255, 0.5), 2.5em 0em 0 0em rgba(255, 255, 255, 0.7), 1.75em 1.75em 0 0em #ffffff, 0em 2.5em 0 0em rgba(255, 255, 255, 0.2), -1.8em 1.8em 0 0em rgba(255, 255, 255, 0.2), -2.6em 0em 0 0em rgba(255, 255, 255, 0.2), -1.8em -1.8em 0 0em rgba(255, 255, 255, 0.2);
}
50% {
box-shadow: 0em -2.6em 0em 0em rgba(255, 255, 255, 0.2), 1.8em -1.8em 0 0em rgba(255, 255, 255, 0.2), 2.5em 0em 0 0em rgba(255, 255, 255, 0.5), 1.75em 1.75em 0 0em rgba(255, 255, 255, 0.7), 0em 2.5em 0 0em #ffffff, -1.8em 1.8em 0 0em rgba(255, 255, 255, 0.2), -2.6em 0em 0 0em rgba(255, 255, 255, 0.2), -1.8em -1.8em 0 0em rgba(255, 255, 255, 0.2);
}
62.5% {
box-shadow: 0em -2.6em 0em 0em rgba(255, 255, 255, 0.2), 1.8em -1.8em 0 0em rgba(255, 255, 255, 0.2), 2.5em 0em 0 0em rgba(255, 255, 255, 0.2), 1.75em 1.75em 0 0em rgba(255, 255, 255, 0.5), 0em 2.5em 0 0em rgba(255, 255, 255, 0.7), -1.8em 1.8em 0 0em #ffffff, -2.6em 0em 0 0em rgba(255, 255, 255, 0.2), -1.8em -1.8em 0 0em rgba(255, 255, 255, 0.2);
}
75% {
box-shadow: 0em -2.6em 0em 0em rgba(255, 255, 255, 0.2), 1.8em -1.8em 0 0em rgba(255, 255, 255, 0.2), 2.5em 0em 0 0em rgba(255, 255, 255, 0.2), 1.75em 1.75em 0 0em rgba(255, 255, 255, 0.2), 0em 2.5em 0 0em rgba(255, 255, 255, 0.5), -1.8em 1.8em 0 0em rgba(255, 255, 255, 0.7), -2.6em 0em 0 0em #ffffff, -1.8em -1.8em 0 0em rgba(255, 255, 255, 0.2);
}
87.5% {
box-shadow: 0em -2.6em 0em 0em rgba(255, 255, 255, 0.2), 1.8em -1.8em 0 0em rgba(255, 255, 255, 0.2), 2.5em 0em 0 0em rgba(255, 255, 255, 0.2), 1.75em 1.75em 0 0em rgba(255, 255, 255, 0.2), 0em 2.5em 0 0em rgba(255, 255, 255, 0.2), -1.8em 1.8em 0 0em rgba(255, 255, 255, 0.5), -2.6em 0em 0 0em rgba(255, 255, 255, 0.7), -1.8em -1.8em 0 0em #ffffff;
}
}
.weex-switch {
border: 1px solid #dfdfdf;
cursor: pointer;
display: inline-block;
position: relative;
vertical-align: middle;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
box-sizing: content-box;
background-clip: content-box;
color: #64bd63;
width: 100px;
height: 60px;
background-color: white;
border-color: #dfdfdf;
box-shadow: #dfdfdf 0px 0px 0px 0px inset;
border-radius: 60px;
-webkit-transition: border 0.4s, box-shadow 0.4s, background-color 1.2s;
transition: border 0.4s, box-shadow 0.4s, background-color 1.2s;
}

.weex-switch-checked {
background-color: #64bd63;
border-color: #64bd63;
box-shadow: #64bd63 0px 0px 0px 40px inset;
}

.weex-switch-disabled {
background-color: #EEEEEE;
}

.weex-switch-inner {
width: 60px;
height: 60px;
background: #fff;
border-radius: 100%;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
position: absolute;
top: 0;
left: 0;
-webkit-transition: background-color 0.4s, left 0.2s;
transition: background-color 0.4s, left 0.2s;
}

.weex-switch-checked > .weex-switch-inner {
left: 40px;
}

p, .weex-text {
white-space: pre-wrap;
font-size: 32px;
word-wrap: break-word;
display: -webkit-box;
-webkit-box-orient: vertical;
overflow: visible;
}

textarea, .weex-textarea {
font-size: 32px;
}

.weex-web {
width: 100%;
height: 100%;
border: none;
box-sizing: border-box;
}
59 changes: 59 additions & 0 deletions html5/render/vue/styles/reset.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
* {
color: initial;
cursor: initial;
direction: initial;
font: initial;
font-family: initial;
font-size: initial;
font-style: initial;
font-variant: initial;
font-weight: initial;
line-height: initial;
text-align: initial;
text-indent: initial;
visibility: initial;
white-space: initial;
word-spacing: initial;
}

*,
*::before,
*::after {
box-sizing: border-box;
-webkit-text-size-adjust: none;
-ms-text-size-adjust: none;
text-size-adjust: none;
}

html {
-ms-overflow-style: scrollbar;
-webkit-tap-highlight-color: transparent;
}

a,
button,
[role="button"],
input,
label,
select,
textarea {
-ms-touch-action: manipulation;
touch-action: manipulation;
}

p, ol, ul, dl {
margin: 0;
padding: 0;
}

li {
list-style: none;
}

figure {
margin: 0;
}

textarea {
resize: none;
}

0 comments on commit 781c8e4

Please sign in to comment.