├── assets
├── img
│ └── image
│ │ └── logo.png
└── css
│ ├── reset.css
│ ├── base.css
│ └── index.css
├── index.html
└── README.md
/assets/img/image/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cyclegtx/wave_background/HEAD/assets/img/image/logo.png
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 三里屯SOHO商盟
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
43 |
88 |
89 |
--------------------------------------------------------------------------------
/assets/css/reset.css:
--------------------------------------------------------------------------------
1 | html, body, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, cite, code, del, dfn, em, img, ins, kbd, q, samp, small, strike, strong, sub, sup, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, details, figure, figcaption, hgroup, menu, nav, section, summary, time, mark, audio, video {
2 | margin: 0;
3 | padding: 0;
4 | font-size: 100%;
5 | }
6 | body {
7 | font: 14px/1.5 "Microsoft YaHei", Helvetica, Arial, 'Lucida Grande', sans-serif;
8 | -webkit-tap-highlight-color: rgba(255,255,0,0);
9 | -webkit-user-select: none;
10 | -moz-user-select: none;
11 | -ms-user-select: none;
12 | -webkit-touch-callout: none;
13 | cursor: default;
14 | -ms-content-zooming: none;
15 | -webkit-text-size-adjust: 100%;
16 | -ms-text-size-adjust: 100%;
17 | -webkit-font-smoothing: antialiased;
18 | -moz-font-smoothing: antialiased;
19 | -ms-font-smoothing: antialiased;
20 | font-smoothing: antialiased;
21 | text-rendering: optimizelegibility;
22 | color: #3c3c3c;
23 | }
24 | h1, h2, h3, h4, h5, h6 {
25 | -webkit-font-feature-settings: "liga", "dlig";
26 | -moz-font-feature-settings: "liga=1, dlig=1";
27 | font-feature-settings: "liga", "dlig";
28 | }
29 | table {
30 | border-collapse: collapse;
31 | border-spacing: 0;
32 | empty-cells: show;
33 | line-height: 1.3em;
34 | }
35 | caption, th, td {
36 | vertical-align: middle;
37 | }
38 | q, blockquote {
39 | quotes: none;
40 | }
41 | q:before, q:after, blockquote:before, blockquote:after {
42 | content: "";
43 | content: none;
44 | }
45 | img {
46 | border: 0;
47 | -ms-interpolation-mode: bicubic;
48 | }
49 | button, input, select, textarea {
50 | margin: 0;
51 | font-family: inherit;
52 | font-size: 100%;
53 | }
54 | button, input {
55 | line-height: normal;
56 | }
57 | button, select {
58 | text-transform: none;
59 | }
60 | button,
61 | html input[type="button"],
62 | input[type="reset"],
63 | input[type="submit"] {
64 | cursor: pointer;
65 | -webkit-appearance: button;
66 | }
67 |
68 | button[disabled],
69 | html input[disabled] {
70 | cursor: default;
71 | }
72 |
73 | input[type="checkbox"],
74 | input[type="radio"] {
75 | padding: 0;
76 | box-sizing: border-box;
77 | }
78 | input:not([type="checkbox"]):not([type="radio"]), select, textarea {
79 | user-select: auto;
80 | -webkit-appearance: none;
81 | -moz-appearance: none;
82 | width: 100%;
83 | }
84 | input[type="search"] {
85 | -webkit-box-sizing: content-box;
86 | -moz-box-sizing: content-box;
87 | box-sizing: content-box;
88 | -webkit-appearance: textfield;
89 | }
90 | input[type="search"]::-webkit-search-cancel-button,
91 | input[type="search"]::-webkit-search-decoration {
92 | -webkit-appearance: none;
93 | }
94 |
95 | button::-moz-focus-inner,
96 | input::-moz-focus-inner {
97 | padding: 0;
98 | border: 0;
99 | }
100 | textarea {
101 | overflow: auto;
102 | vertical-align: top;
103 | }
104 | p {
105 | -ms-word-break: break-all;
106 | word-break: break-all;
107 | word-break: break-word;
108 | -webkit-hyphens: auto;
109 | -moz-hyphens: auto;
110 | hyphens: auto;
111 | -webkit-hyphenate-before: 2;
112 | -webkit-hyphenate-after: 3;
113 | hyphenate-lines: 3;
114 | }
115 | a {
116 | outline: none;
117 | color: inherit;
118 | text-decoration: none;
119 | }
120 | fieldset {
121 | border: 0;
122 | }
123 | input[type="text"], input[type="email"], input[type="password"], textarea {
124 | padding: 6px;
125 | background-color: rgba(255, 255, 255, 1);
126 | font-size: 15px;
127 | line-height: 1.4em;
128 | outline: none;
129 | -webkit-appearance: none;
130 | }
131 | :focus {
132 | outline: none;
133 | }
134 | label {
135 | cursor: pointer;
136 | }
137 | b, strong {
138 | font-weight: 700;
139 | }
140 | em, i {
141 | font-style: italic;
142 | }
143 | small {
144 | font-size: 0.8em;
145 | }
146 | code{
147 | font-family: arial;
148 | }
--------------------------------------------------------------------------------
/assets/css/base.css:
--------------------------------------------------------------------------------
1 | /* ----------------------------------
2 | * html, body
3 | * ---------------------------------- */
4 | html, body {
5 | position: relative;
6 | width: 100%;
7 | }
8 | /* ----------------------------------
9 | * box sizing
10 | * ---------------------------------- */
11 | *,
12 | *:after,
13 | *::before {
14 | -webkit-box-sizing: border-box;
15 | -moz-box-sizing: border-box;
16 | box-sizing: border-box;
17 | }
18 | /* ----------------------------------
19 | * clearfix
20 | * ---------------------------------- */
21 | .clearfix:before,
22 | .clearfix:after {
23 | display: table;
24 | content: " ";
25 | }
26 | .clearfix:after {
27 | clear: both;
28 | }
29 | /* ----------------------------------
30 | * scroll
31 | * ---------------------------------- */
32 | .scroll-y, .scroll-x {
33 | -webkit-overflow-scrolling: touch;
34 | -moz-overflow-scrolling: touch;
35 | overflow-scrolling: touch;
36 | }
37 | .scroll-y {
38 | overflow-x: hidden;
39 | overflow-y: scroll;
40 | }
41 | .scroll-x {
42 | overflow-x: scroll;
43 | overflow-y: hidden;
44 | }
45 | /* ----------------------------------
46 | * hr
47 | * ---------------------------------- */
48 | .rule {
49 | color: rgba(0, 0, 0, .1);
50 | border: none;
51 | border-bottom-width: 1px;
52 | border-bottom-style: solid;
53 | margin-bottom: 10px;
54 | }
55 | .rule--dotted {
56 | border-bottom-style: dotted;
57 | }
58 | .rule--dashed {
59 | border-bottom-style: dashed;
60 | }
61 | /* ----------------------------------
62 | * image
63 | * ---------------------------------- */
64 | img {
65 | display: block;
66 | width: 100%;
67 | }
68 | img[width],
69 | img[height] {
70 | width: none;
71 | }
72 | .img--right {
73 | float: right;
74 | marin: 10px;
75 | }
76 | .img--left {
77 | float: left;
78 | margin: 10px;
79 | }
80 | .img--center {
81 | display: block;
82 | margin: 0 auto 10px;
83 | }
84 | /* ----------------------------------
85 | * ellipsis
86 | * ---------------------------------- */
87 | .ellipsis {
88 | white-space: nowrap;
89 | overflow: hidden;
90 | text-overflow: ellipsis;
91 | }
92 | /* ----------------------------------
93 | * break
94 | * ---------------------------------- */
95 | .break {
96 | word-wrap: break-word;
97 | word-break: normal;
98 | word-break:break-all;
99 | }
100 | /* ----------------------------------
101 | * align
102 | * ---------------------------------- */
103 | .align-vertical {
104 | display: -webkit-box;
105 | display: -moz-box;
106 | display: -ms-flexbox;
107 | display: box;
108 | /*------content vertical------*/
109 | -webkit-box-align: center;
110 | -moz-box-align: center;
111 | -ms-flex-align:center;
112 | box-align: center;
113 | /*------content horizontal------*/
114 | -webkit-box-pack: center;
115 | -moz-box-pack: center;
116 | -ms-flex-pack:center;
117 | box-pack: center;
118 | }
119 | .align-center {
120 | text-align: center;
121 | }
122 | .align-left {
123 | text-align: left;
124 | }
125 | .align-right {
126 | text-align: right;
127 | }
128 | /* ----------------------------------
129 | * flexbox
130 | * ---------------------------------- */
131 | .flexbox {
132 | display: -webkit-box !important;
133 | display: -moz-box !important;
134 | display: -ms-flexbox !important;
135 | display: box !important;
136 | }
137 | .flexbox > .cell__equality {
138 | -webkit-box-flex: 1;
139 | -webkit-flex: 1;
140 | -moz-box-flex: 1;
141 | -ms-box-flex: 1;
142 | flex: 1;
143 | }
144 | .flexbox--block {
145 | -webkit-box-orient: vertical;
146 | -moz-box-orient: vertical;
147 | box-orient: vertical;
148 | }
149 | .flexbox--top {
150 | -webkit-box-align: start;
151 | -moz-box-align: start;
152 | box-align: start;
153 | }
154 | .flexbox--bottom {
155 | -webkit-box-align: end;
156 | -moz-box-align: end;
157 | box-align: end;
158 | }
159 | .flexbox--middle {
160 | -webkit-box-align: center;
161 | -moz-box-align: center;
162 | box-align: center;
163 | }
164 | .flexbox--grass {
165 | -webkit-box-align: grass;
166 | -moz-box-align: grass;
167 | box-align: grass;
168 | }
169 | /* ----------------------------------
170 | * tablebox
171 | * ---------------------------------- */
172 | .tablebox {
173 | display: table;
174 | width: 100%;
175 | }
176 | html.tablebox {
177 | display: block;
178 | width: auto;
179 | }
180 | .tablebox__cell {
181 | display: table-cell;
182 | vertical-align: middle;
183 | }
184 | /* ----------------------------------
185 | * no-flicker
186 | * ---------------------------------- */
187 | .no-flicker {
188 | -webkit-transform-style: preserve-3d;
189 | -moz-transform-style: preserve-3d;
190 | transform-style: preserve-3d;
191 | -webkit-backface-visibility: hidden;
192 | -moz-backface-visibility: hidden;
193 | backface-visibility: hidden;
194 | }
195 | /* ----------------------------------
196 | * full
197 | * ---------------------------------- */
198 | .full-screen {
199 | width: 100%;
200 | height: 100%;
201 | }
202 | .full-background {
203 | background-repeat: no-repeat;
204 | background-position: center center;
205 | background-size: cover;
206 | }
207 | .full-fixe{
208 | position: fixed;
209 | left: 0;
210 | top:0;
211 | }
212 | /* ----------------------------------
213 | * page
214 | * ---------------------------------- */
215 | section[role="page"] {
216 | position: relative;
217 | }
218 | section[role="page"][type="end"] {
219 | padding-bottom: 56px;
220 | }
221 | section[role="page"][type="both"]{
222 | padding: 10px 0 56px;
223 | }
224 | /* ----------------------------------
225 | * button
226 | * ---------------------------------- */
227 | .btn {
228 | position: relative;
229 | display: inline-block;
230 | vertical-align: middle;
231 | outline: none;
232 | text-align: center;
233 | text-decoration: none;
234 | white-space: nowrap;
235 | cursor: pointer;
236 | -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
237 | -webkit-transition: all 0.2s ease;
238 | -moz-transition: all 0.2s ease;
239 | transition: all 0.2s ease;
240 | font-size: 16px;
241 | line-height: 1;
242 | border-radius: 3px;
243 | color: rgba(0, 0, 0, 1);
244 | background-color: #ffffff;
245 | padding: 5px 10px;
246 | border:1px solid transparent;
247 | }
248 | .btn:hover{
249 | background-color: #f9f9f9;
250 | }
251 | .btn--default{
252 | border-color: #c9c9c9;
253 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | canvas制作波浪状动态背景
2 | ===============
3 | 先看效果图
4 | 
5 |
6 | 此页面是微信公众帐号《玩转三里屯》中的“消费指南”功能所用的页面。考虑到页面只在手机中浏览,而且手机对canvas的支持又非常好,所以打算使用canvas做点不一样的动画。
7 |
8 | 代码在线预览
9 |
10 |
11 | ####Step1.HTML页面
12 | 完成HTML页面
13 |
14 | 
15 |
16 | 点击查看历史代码
17 | ####Step2.添加Canvas
18 | 新建一个画布```