definitions as the ones you can find in the demo.html file.
6 |
7 | If you prefer using PNGs or CSS sprites, refer to the Preferences panel of the IcoMoon app before downloading your zip pack.
8 |
--------------------------------------------------------------------------------
/10/example_10-02/IcoMoon - 5 Icons/SVG/drag-left-right.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/10/example_10-02/IcoMoon - 5 Icons/SVG/drag-left.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/10/example_10-02/IcoMoon - 5 Icons/SVG/drag-right.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/10/example_10-02/IcoMoon - 5 Icons/SVG/multitouch.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/10/example_10-02/IcoMoon - 5 Icons/SVG/touch.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/10/example_10-02/IcoMoon - 5 Icons/demo-files/demo.css:
--------------------------------------------------------------------------------
1 | body {
2 | padding: 0;
3 | margin: 0;
4 | font-family: sans-serif;
5 | font-size: 1em;
6 | line-height: 1.5;
7 | color: #555;
8 | background: #fff;
9 | }
10 | h1 {
11 | font-size: 1.5em;
12 | font-weight: normal;
13 | box-shadow: 0 1px #ddd, 0 2px #fff, 0 3px #ddd;
14 | }
15 | small {
16 | font-size: .66666667em;
17 | }
18 | a {
19 | color: #e74c3c;
20 | text-decoration: none;
21 | }
22 | a:hover, a:focus {
23 | box-shadow: 0 1px #e74c3c;
24 | }
25 | .bshadow0, input {
26 | box-shadow: inset 0 -2px #e7e7e7;
27 | }
28 | input:hover {
29 | box-shadow: inset 0 -2px #ccc;
30 | }
31 | input, fieldset {
32 | font-size: 1em;
33 | margin: 0;
34 | padding: 0;
35 | border: 0;
36 | }
37 | input {
38 | color: inherit;
39 | line-height: 1.5;
40 | height: 1.5em;
41 | padding: .25em 0;
42 | }
43 | input:focus {
44 | outline: none;
45 | box-shadow: inset 0 -2px #449fdb;
46 | }
47 | .glyph {
48 | font-size: 16px;
49 | width: 17em;
50 | margin-right: 1.5em;
51 | float: left;
52 | overflow: hidden;
53 | }
54 | .liga {
55 | width: 80%;
56 | width: calc(100% - 2.5em);
57 | }
58 | .talign-right {
59 | text-align: right;
60 | }
61 | .talign-center {
62 | text-align: center;
63 | }
64 | .bgc1 {
65 | background: #f1f1f1;
66 | }
67 | .fgc1 {
68 | color: #999;
69 | }
70 | .fgc0 {
71 | color: #000;
72 | }
73 | p {
74 | margin-top: 1em;
75 | margin-bottom: 1em;
76 | }
77 | .mvm {
78 | margin-top: .75em;
79 | margin-bottom: .75em;
80 | }
81 | .mtn {
82 | margin-top: 0;
83 | }
84 | .mtl, .mal {
85 | margin-top: 1.5em;
86 | }
87 | .mbl, .mal {
88 | margin-bottom: 1.5em;
89 | }
90 | .mal, .mhl {
91 | margin-left: 1.5em;
92 | margin-right: 1.5em;
93 | }
94 | .mhmm {
95 | margin-left: 1em;
96 | margin-right: 1em;
97 | }
98 | .mls {
99 | margin-left: .25em;
100 | }
101 | .ptl {
102 | padding-top: 1.5em;
103 | }
104 | .pbs, .pvs {
105 | padding-bottom: .25em;
106 | }
107 | .pvs, .pts {
108 | padding-top: .25em;
109 | }
110 | .unit {
111 | float: left;
112 | }
113 | .unitRight {
114 | float: right;
115 | }
116 | .size1of2 {
117 | width: 50%;
118 | }
119 | .size1of1 {
120 | width: 100%;
121 | }
122 | .clearfix:before, .clearfix:after {
123 | content: " ";
124 | display: table;
125 | }
126 | .clearfix:after {
127 | clear: both;
128 | }
129 | .hidden-true {
130 | display: none;
131 | }
132 | .textbox0 {
133 | width: 3em;
134 | background: #f1f1f1;
135 | padding: .25em .5em;
136 | line-height: 1.5;
137 | height: 1.5em;
138 | }
139 | .fs0 {
140 | font-size: 16px;
141 | }
142 | .fs1 {
143 | font-size: 32px;
144 | }
145 |
--------------------------------------------------------------------------------
/10/example_10-02/IcoMoon - 5 Icons/style.css:
--------------------------------------------------------------------------------
1 | .icon {
2 | display: inline-block;
3 | color: #444444;
4 | fill: currentColor;
5 | }
6 | .icon-drag-left-right {
7 | width: 42px;
8 | height: 32px;
9 | }
10 | #icon-drag-left-right .path1 {
11 | fill: currentcolor;
12 | }
13 | #icon-drag-left-right .path2 {
14 | fill: currentcolor;
15 | }
16 | #icon-drag-left-right .path3 {
17 | fill: currentcolor;
18 | }
19 | .icon-drag-left {
20 | width: 42px;
21 | height: 32px;
22 | }
23 | #icon-drag-left .path1 {
24 | fill: currentcolor;
25 | }
26 | #icon-drag-left .path2 {
27 | fill: currentcolor;
28 | }
29 | #icon-drag-left .path3 {
30 | fill: currentcolor;
31 | }
32 | .icon-drag-right {
33 | width: 42px;
34 | height: 32px;
35 | }
36 | #icon-drag-right .path1 {
37 | fill: currentcolor;
38 | }
39 | #icon-drag-right .path2 {
40 | fill: currentcolor;
41 | }
42 | #icon-drag-right .path3 {
43 | fill: currentcolor;
44 | }
45 | .icon-touch {
46 | width: 32px;
47 | height: 32px;
48 | }
49 | #icon-touch .path1 {
50 | fill: currentcolor;
51 | }
52 | #icon-touch .path2 {
53 | fill: currentcolor;
54 | }
55 | .icon-multitouch {
56 | width: 32px;
57 | height: 32px;
58 | }
59 | #icon-multitouch .path1 {
60 | fill: currentcolor;
61 | }
62 | #icon-multitouch .path2 {
63 | fill: currentcolor;
64 | }
65 | #icon-multitouch .path3 {
66 | fill: currentcolor;
67 | }
68 |
--------------------------------------------------------------------------------
/10/example_10-03/styles.css:
--------------------------------------------------------------------------------
1 | body {
2 | display: flex;
3 | }
4 | body > * {
5 | display: inline-flex;
6 | align-self: center;
7 | }
8 |
9 | * + * {
10 | margin-left: 2rem;
11 | }
12 |
13 | .icon-drag-left-right {
14 | width: 2.5rem;
15 | height: 2.5rem;
16 | fill: #f90;
17 | color: #ccc;
18 | }
19 |
20 | .different-context .icon-drag-left-right {
21 | fill: #14805e;
22 | color: #223344;
23 | width: 4rem;
24 | height: 4rem;
25 | }
26 |
27 | .alternate2.icon-drag-left-right {
28 | fill: rgba(33, 21, 220, 0.6);
29 | color: rgba(65, 30, 234, 0.88);
30 | width: 3.5rem;
31 | height: 3.5rem;
32 | }
33 |
--------------------------------------------------------------------------------
/10/example_10-04/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Re-coloring SVG with CSS Custom Properties
7 |
11 |
12 |
13 |
14 |
20 | Colouring Test
21 |
22 |
27 |
32 |
33 |
34 |
35 | Amend Colour
36 |
37 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/10/example_10-04/styles.css:
--------------------------------------------------------------------------------
1 | body {
2 | background-color: #333;
3 | display: flex;
4 | flex-direction: column;
5 | align-items: center;
6 | justify-content: center;
7 | height: 100vh;
8 | }
9 |
10 | .shape * {
11 | transition: all 1s;
12 | }
13 |
14 | .shape {
15 | display: block;
16 | --stroke1: #ddd;
17 | --fill1: #444;
18 | --stroke2: #f90;
19 | --fill2: #663d00;
20 | }
21 |
22 | .shape:hover {
23 | --stroke1: #333;
24 | --fill1: #444;
25 | --stroke2: #fff;
26 | --fill2: #ffc266;
27 | }
28 |
29 | .amended .shape {
30 | --stroke1: #080b2b;
31 | --fill1: #141a67;
32 | --fill2: #192183;
33 | --stroke2: #2d3ad7;
34 | }
35 |
36 | .amended .shape:hover {
37 | --stroke1: #092b08;
38 | --fill1: #125610;
39 | --fill2: #2dd728;
40 | --stroke2: #1b8118;
41 | }
42 |
43 | button {
44 | margin: 20px;
45 | height: 40px;
46 | font-size: 1.2rem;
47 | padding: 0 20px;
48 | }
49 |
--------------------------------------------------------------------------------
/10/example_10-05/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | An example from http://rwd.education
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/10/example_10-05/styles.css:
--------------------------------------------------------------------------------
1 | body {
2 | display: flex;
3 | }
4 | body > * {
5 | display: inline-flex;
6 | align-self: center;
7 | }
8 |
9 | * + * {
10 | margin-left: 2rem;
11 | }
12 |
13 | .icon-drag-left-right {
14 | width: 2.5rem;
15 | height: 2.5rem;
16 | fill: #f90;
17 | color: #ccc;
18 | }
19 |
20 | .different-context .icon-drag-left-right {
21 | fill: #14805e;
22 | color: #223344;
23 | width: 4rem;
24 | height: 4rem;
25 | }
26 |
27 | .alternate2.icon-drag-left-right {
28 | fill: rgba(33, 21, 220, 0.6);
29 | color: rgba(65, 30, 234, 0.88);
30 | width: 3.5rem;
31 | height: 3.5rem;
32 | }
33 |
--------------------------------------------------------------------------------
/10/example_10-06/Star.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 | Star 1
4 |
5 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/10/example_10-06/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | An example from http://rwd.education
6 |
7 |
8 |
9 |
10 |
11 |
12 | Testing the capabilities possible with SVG inserted into the document in different ways
13 |
14 |
As an image:
15 |
16 |
17 |
18 |
Inside an object tag:
19 |
20 | Your browser doesn't support SVG
21 |
22 |
23 |
24 |
Inserted 'inline':
25 |
26 |
27 | Star 1
28 |
29 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
Inserted via CSS as background image:
55 |
56 |
57 | What about <use> ?
58 |
59 |
60 |
61 |
62 |
63 |
82 |
83 |
84 |
--------------------------------------------------------------------------------
/10/example_10-06/main.js:
--------------------------------------------------------------------------------
1 | ;(function ready(fn) {
2 | if (document.readyState != 'loading'){
3 | fn();
4 | } else {
5 | document.addEventListener('DOMContentLoaded', fn);
6 | }
7 | })();
8 | function fn() {
9 | var imgStarPath = document.querySelector('#svgImg .star_Wrapper');
10 | console.log("Is SVG in an img tag accessibe? " + imgStarPath);
11 |
12 | var inlineStarPath = document.querySelector('#svgInline');
13 | console.log("Is inlineSVG accessible? " + inlineStarPath);
14 |
15 | var objectWrapper = document.querySelector('#svgObject');
16 | var svgInObject = objectWrapper.contentDocument;
17 | console.log("Is SVG in object accessible? " + svgInObject);
18 |
19 | var bgStarPath = document.querySelector('.has-StarBg .star_Wrapper');
20 | console.log("Is SVG in BG image accessible? " + bgStarPath);
21 | }
--------------------------------------------------------------------------------
/10/example_10-06/styles.css:
--------------------------------------------------------------------------------
1 | .star_Wrapper path {
2 | stroke-width: 6px;
3 | }
4 |
5 | .has-StarBg {
6 | background-image: url('Star.svg');
7 | background-size: cover;
8 | width: 198px;
9 | height: 188px;
10 | }
--------------------------------------------------------------------------------
/10/example_10-07/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | An example from http://rwd.education
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | Star 1
15 |
16 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/10/example_10-08/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | An example from http://rwd.education
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | Adjust Width
15 |
16 |
17 |
18 | Enter value
20 |
21 |
22 | Animate!!
23 |
24 |
25 |
26 |
27 |
32 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/10/example_10-08/main.js:
--------------------------------------------------------------------------------
1 | ;(function () {
2 | 'use strict';
3 |
4 | // VARS:
5 | var cicrle = document.querySelector(".circle");
6 | var circlePath = document.querySelector(".circle path");
7 | var pathLength = circlePath.getTotalLength();
8 | var pathLengthPx = pathLength + "px";
9 | var animateButton = document.querySelector(".animate");
10 | var text = document.querySelector(".circle text");
11 | var rangeField = document.querySelector(".range");
12 |
13 | // Set colours
14 | var strokeStartColour = "#333333";
15 | var strokeEndColour = "#ff9900";
16 |
17 | // MAIN:
18 | var radial = {
19 | initialisePath: function() {
20 | // This function resets the radial ready to animate
21 |
22 | // First set the stroke dashoffset to be the length of the path length
23 | // Note: remove the negative string to reverse the direction of the animation
24 | circlePath.style.strokeDashoffset = "-" + pathLength;
25 | // Set the stroke dash array
26 | circlePath.style.strokeDasharray = pathLength + ' ' + pathLength;
27 |
28 | // Reset the stroke colour
29 | circlePath.style.stroke = strokeStartColour;
30 | },
31 |
32 | animateClick: function() {
33 | // This function listens for changes to the input field and
34 | // sets the value attribute to that value
35 |
36 | // Update the value of the field when values change
37 | var inputField = document.querySelector(".enterValue");
38 |
39 | inputField.addEventListener("input", function(){
40 | this.setAttribute("value", this.value);
41 | }, false);
42 |
43 | // Pass values from the input field on button press
44 | animateButton.addEventListener('click', function() {
45 | var input = document.querySelector(".enterValue").value;
46 | var lineLengthFromInput = pathLength - (pathLength / 100 * input);
47 | radial.animateSVG(lineLengthFromInput, input);
48 | }, false);
49 | },
50 |
51 | // Actually do the animation
52 | animateSVG: function(amount, inputValue) {
53 | // This function first resets the animation
54 | radial.initialisePath();
55 | // Then it tweens the path stoke dashoffset amount
56 | TweenLite.to(circlePath, 1.5, {'stroke-dashoffset': "-"+amount, stroke: strokeEndColour});
57 | // While simultaneously tweening the percentage value in Text from the counter value to the
58 | // value of the input (that the user sets with the slider)
59 | var counter = { var: 0 };
60 | TweenLite.to(counter, 1.5, {
61 | var: inputValue,
62 | onUpdate: function () {
63 | text.textContent = Math.ceil(counter.var) + "%";
64 | },
65 | ease:Circ.easeOut
66 | });
67 | },
68 |
69 | changeWidth: function() {
70 | // This function changes the stroke width of the radial by listening to
71 | // input changes and applying those values to the circle stroke width
72 |
73 | // Update the value of the field when values change
74 | rangeField.addEventListener("input", function(){
75 | // this.setAttribute("value", this.value);
76 | circlePath.style.strokeWidth = this.value + "px";
77 | }, false);
78 | }
79 | };
80 | // Kick everything off
81 | radial.changeWidth();
82 | radial.initialisePath();
83 | radial.animateClick();
84 | })();
--------------------------------------------------------------------------------
/10/example_10-08/styles.css:
--------------------------------------------------------------------------------
1 | * {
2 | box-sizing: border-box;
3 | }
4 |
5 | body {
6 | background: #000;
7 | display: flex;
8 | align-items: center;
9 | }
10 |
11 | .anim_Wrapper {
12 | display: flex;
13 | flex-direction: column;
14 | max-width: 500px;
15 | }
16 |
17 | svg {
18 | padding: 20px;
19 | overflow: visible;
20 | }
21 |
22 | svg path {
23 | stroke: #14803f;
24 | stroke-width: 10px;
25 | // stroke-linecap: round;
26 | }
27 |
28 | svg text {
29 | stroke: none;
30 | fill: #fff;
31 | }
32 |
33 | .controls {
34 | padding: 2rem;
35 | background-color: #444;
36 | border-radius: 4px;
37 | font-size: 0.8rem;
38 | font-family: sans-serif;
39 | display: flex;
40 | flex-direction: column;
41 | }
42 |
43 | label {
44 | color: #fff;
45 | display: flex;
46 | align-items: center;
47 | align-content: center;
48 | }
49 |
50 | input {
51 | font-size: 1.2rem;
52 | line-height: 1.2;
53 | border-radius: 4px;
54 | margin: 0.2rem 0 0 auto;
55 | }
56 |
57 | .animate {
58 | -webkit-appearance: none;
59 | -moz-appearance: none;
60 | border-radius: 4px;
61 | background-color: #c7c7c7;
62 | min-height: 1.5rem;
63 | display: flex;
64 | flex: 1 1 100%;
65 | width: 100%;
66 | justify-content: center;
67 | margin-top: 1rem;
68 | }
69 |
--------------------------------------------------------------------------------
/10/example_10-09/filter.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/10/example_10-09/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | An example from http://rwd.education
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/10/example_10-09/queen@2x-1024x747.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/10/example_10-09/queen@2x-1024x747.png
--------------------------------------------------------------------------------
/10/example_10-09/styles.css:
--------------------------------------------------------------------------------
1 | .HRH {
2 | -webkit-filter: url('filter.svg#myfilter');
3 | filter: url('filter.svg#myfilter');
4 | }
--------------------------------------------------------------------------------
/11/example_11-01/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | An example from http://rwd.education
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | link1
14 | link2
15 | link3
16 | link4
17 | link5
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/11/example_11-01/styles.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | padding: 0;
4 | }
5 |
6 | nav {
7 | display: flex;
8 | min-height: 44px;
9 | }
10 |
11 | a {
12 | font-family: sans-serif;
13 | color: #fff;
14 | text-indent: 1rem;
15 | background-color: #ccc;
16 | display: inline-flex;
17 | flex: 1 1 20%;
18 | align-self: stretch;
19 | align-items: center;
20 | transition: box-shadow 1s;
21 | text-decoration: none;
22 | }
23 |
24 | a + a {
25 | border-left: 1px solid #aaa;
26 | }
27 |
28 | a:hover {
29 | box-shadow: inset 0 -3px 0 #CC3232;
30 | }
--------------------------------------------------------------------------------
/11/example_11-02/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | An example from http://rwd.education
6 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | Here is some flowing text. This item has
17 | margin-left: 10px;
18 | added on hover. Notice how it moves the text along on hover?
19 |
20 |
21 | Here is some flowing text. This item has
22 | transform: translateX(10px)
added on hover. Notice how the
23 | text stays in position on hover?
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/11/example_11-02/styles.css:
--------------------------------------------------------------------------------
1 | html,
2 | body {
3 | margin: 0;
4 | padding: 0;
5 | font-family: sans-serif;
6 | }
7 |
8 | body {
9 | width: 100%;
10 | max-width: 50em;
11 | margin: 0 auto;
12 | }
13 |
14 | p {
15 | font-size: 1.2rem;
16 | line-height: 1.2;
17 | color: #555;
18 | }
19 |
20 | .margin,
21 | .transform {
22 | color: #222;
23 | display: inline-block;
24 | transition: margin 1s, transform 1s;
25 | }
26 |
27 | .margin:hover {
28 | margin-left: 10px;
29 | }
30 |
31 | .transform:hover {
32 | transform: translateX(10px);
33 | }
34 |
--------------------------------------------------------------------------------
/11/example_11-03/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | An example from http://rwd.education
6 |
7 |
8 |
9 |
10 |
11 |
12 | Demonstration of CSS transforms
13 |
14 | scale(1.4)
15 | translate(-20px, -20px)
16 | rotate(30deg)
17 | skew(40deg, 12deg)
18 | matrix(1.178, -0.256, 1.122, 1.333, -41.533, -1.989)
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/11/example_11-03/styles.css:
--------------------------------------------------------------------------------
1 |
2 | body {
3 | padding: 0;
4 | margin: 0;
5 | }
6 |
7 | nav {
8 | padding: 30px;
9 | }
10 |
11 | a {
12 | display: inline-flex;
13 | background-color: #CC3232;
14 | flex: 1 0 auto;
15 | min-height: 88px;
16 | text-decoration: none;
17 | font-size: 22px;
18 | border: 1px solid #333;
19 | padding: 0 10px;
20 | color: #ccc;
21 | font-family: sans-serif;
22 | align-items: center;
23 | transition: transform 1s;
24 | }
25 |
26 | .scale:hover {
27 | transform: scale(1.4);
28 | }
29 |
30 | .translate:hover {
31 | transform: translate(-20px, -20px);
32 | }
33 |
34 | .rotate:hover {
35 | transform: rotate(30deg);
36 | }
37 |
38 | .skew:hover {
39 | transform: skew(40deg, 12deg);
40 | }
41 |
42 | .matrix:hover {
43 | transform: matrix(1.178, -0.256, 1.122, 1.333, -41.533, -1.989);
44 | }
--------------------------------------------------------------------------------
/11/example_11-04/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | An example from http://rwd.education
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/11/example_11-04/styles.css:
--------------------------------------------------------------------------------
1 | .outer {
2 | position: relative;
3 | height: 400px;
4 | background-color: #f90;
5 | }
6 |
7 | .inner {
8 | position: absolute;
9 | width: 200px;
10 | background-color: #999;
11 | top: 50%;
12 | left: 50%;
13 | transform: translate(-50%, -50%);
14 | }
--------------------------------------------------------------------------------
/11/example_11-05/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | An example from http://rwd.education
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | The Front
15 | The Back
16 |
17 |
18 |
19 |
20 |
21 | The Front
22 | The Back
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/11/example_11-05/styles.css:
--------------------------------------------------------------------------------
1 | .flipper {
2 | perspective: 400px;
3 | position: relative;
4 | width: 300px;
5 | height: 44px;
6 | }
7 |
8 | .flipper + .flipper {
9 | margin-top: 1em;
10 | }
11 |
12 | .flipper-object {
13 | position: absolute;
14 | width: 100%;
15 | height: 100%;
16 | transition: transform 1s;
17 | transform-style: preserve-3d;
18 | }
19 |
20 | .panel {
21 | display: flex;
22 | min-height: 44px;
23 | align-items: center;
24 | justify-content: center;
25 | top: 0;
26 | width: 100%;
27 | height: 100%;
28 | position: absolute;
29 | backface-visibility: hidden;
30 | }
31 |
32 | .flipper-vertical .back {
33 | transform: rotateX(180deg);
34 | }
35 |
36 | .flipper-horizontal .back {
37 | transform: rotateY(180deg);
38 | }
39 |
40 | .back {
41 | background-color: #CC3232;
42 | }
43 |
44 | .front {
45 | background-color: #739328;
46 | }
47 |
48 | .flipper:hover .flipper-vertical {
49 | transform: rotateX(180deg);
50 | }
51 |
52 | .flipper:hover .flipper-horizontal {
53 | transform: rotateY(180deg);
54 | }
--------------------------------------------------------------------------------
/11/example_11-06/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | An example from http://rwd.education
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | The Front
15 | The Back
16 |
17 |
18 |
19 |
20 |
21 | The Front
22 | The Back
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/11/example_11-06/styles.css:
--------------------------------------------------------------------------------
1 | body {
2 | padding: 5em;
3 | }
4 |
5 | .flipper {
6 | perspective: 400px;
7 | position: relative;
8 | width: 300px;
9 | height: 44px;
10 | }
11 |
12 | .flipper + .flipper {
13 | margin-top: 1em;
14 | }
15 |
16 | .flipper-object {
17 | position: absolute;
18 | width: 100%;
19 | height: 100%;
20 | transition: transform 1s;
21 | transform-style: preserve-3d;
22 | }
23 |
24 | .panel {
25 | display: flex;
26 | min-height: 44px;
27 | align-items: center;
28 | justify-content: center;
29 | top: 0;
30 | width: 100%;
31 | height: 100%;
32 | position: absolute;
33 | backface-visibility: hidden;
34 | }
35 |
36 | .flipper-vertical .back {
37 | transform: rotateX(180deg);
38 | }
39 |
40 | .flipper-horizontal .back {
41 | transform: rotateY(180deg);
42 | }
43 |
44 | .back {
45 | background-color: #CC3232;
46 | }
47 |
48 | .front {
49 | background-color: #739328;
50 | }
51 |
52 | .flipper:hover .flipper-vertical {
53 | transform: rotateX(180deg) translate3d(0, 0, -120px);
54 | animation: pulse 1s 1s infinite alternate both;
55 | }
56 |
57 | .flipper:hover .flipper-horizontal {
58 | transform: rotateY(180deg) translate3d(0, 0, 120px);
59 | animation: pulse 1s 1s infinite alternate both;
60 | }
61 |
62 | /*The animation keyframe*/
63 |
64 | @keyframes pulse {
65 | 100% {
66 | text-shadow: 0 0 5px #bbb;
67 | box-shadow: 0 0 3px 4px #bbb;
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/11/example_11-07/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | An example from http://rwd.education
6 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | Menu
17 | A basic off-canvas menu
18 |
19 | Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
20 | eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut
21 | enim ad minim veniam, quis nostrud exercitation ullamco laboris
22 | nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor
23 | in reprehenderit in voluptate velit esse cillum dolore eu fugiat
24 | nulla pariatur. Excepteur sint occaecat cupidatat non proident,
25 | sunt in culpa qui officia deserunt mollit anim id est laborum.
26 |
27 |
28 |
29 | Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
30 | eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut
31 | enim ad minim veniam, quis nostrud exercitation ullamco laboris
32 | nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor
33 | in reprehenderit in voluptate velit esse cillum dolore eu fugiat
34 | nulla pariatur. Excepteur sint occaecat cupidatat non proident,
35 | sunt in culpa qui officia deserunt mollit anim id est laborum.
36 |
37 |
38 |
39 | Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
40 | eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut
41 | enim ad minim veniam, quis nostrud exercitation ullamco laboris
42 | nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor
43 | in reprehenderit in voluptate velit esse cillum dolore eu fugiat
44 | nulla pariatur. Excepteur sint occaecat cupidatat non proident,
45 | sunt in culpa qui officia deserunt mollit anim id est laborum.
46 |
47 |
48 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/11/example_11-07/main.js:
--------------------------------------------------------------------------------
1 | // First wait for the DOM to be ready
2 | document.addEventListener("DOMContentLoaded", function() {
3 | // First things first, we have JavaScript, so let's tell the document
4 | document.documentElement.classList.remove("no-js");
5 | document.documentElement.classList.add("js");
6 | // This function merely toggles the class
7 | function a(event) {
8 | event.stopPropagation();
9 | document.body.classList.toggle("OffCanvas-Active");
10 | }
11 | function b() {
12 | document.body.classList.remove("OffCanvas-Active");
13 | }
14 | // When the header is clicked we fire the function to toggle the class
15 | document.querySelector(".off-canvas-launcher").addEventListener("click", a);
16 | document.querySelector(".main-content").addEventListener("click", b);
17 | document.querySelector(".nav-close-button").addEventListener("click", b);
18 |
19 | // This debounce function (via: https://remysharp.com/2010/07/21/throttling-function-calls) merely stops functioned firing too often on repetitive events (such as resize/scroll)
20 | function debounce(fn, delay) {
21 | var timer = null;
22 | return function() {
23 | var context = this,
24 | args = arguments;
25 | clearTimeout(timer);
26 | timer = setTimeout(function() {
27 | fn.apply(context, args);
28 | }, delay);
29 | };
30 | }
31 |
32 | // removing the class from the body inside a debounce
33 | var debouncedA = debounce(function() {
34 | document.body.classList.remove("OffCanvas-Active");
35 | }, 250);
36 |
37 | // When the window is resized, we want to fire the debouncedA function
38 | window.onresize = debouncedA;
39 | });
40 |
--------------------------------------------------------------------------------
/11/example_11-07/styles.css:
--------------------------------------------------------------------------------
1 | /*Make everything use border-box sizing for simplicity*/
2 |
3 | * {
4 | box-sizing: border-box;
5 | }
6 |
7 | body {
8 | margin: 0;
9 | padding: 0;
10 | overflow-x: hidden;
11 | }
12 |
13 | .main-content {
14 | font-size: 18px;
15 | font-family: sans-serif;
16 | padding: 2em;
17 | }
18 |
19 | /*remove default button styling*/
20 | .off-canvas-launcher {
21 | appearance: none;
22 | border: 1px solid #297d94;
23 | border-radius: 4px;
24 | background: none;
25 | padding: 4px 8px;
26 | position: relative;
27 | }
28 |
29 | /*if we don't have JavaScript available, no point showing the button*/
30 | .no-js .off-canvas-launcher {
31 | display: none;
32 | }
33 |
34 | /*add some interactivity when the button is clicked*/
35 | .off-canvas-launcher:active {
36 | top: 1px;
37 | }
38 |
39 | .nav-link {
40 | display: flex;
41 | align-items: center;
42 | padding: 5px;
43 | color: #ddd;
44 | min-height: 44px;
45 | text-decoration: none;
46 | transition: border 0.35s, background-color 0.35s;
47 | }
48 |
49 | /*when a link follows another, give it a border-top*/
50 | .nav-link + .nav-link {
51 | border-top: 1px solid #aaa;
52 | }
53 |
54 | .nav-link:hover {
55 | background-color: #236b7f;
56 | color: #fff;
57 | }
58 |
59 | /*add a transition for the left and transform properties and a duration for transitions*/
60 | .navigation-menu {
61 | background-color: #297d94;
62 | transition: left, transform 0.4s;
63 | }
64 |
65 | /*for smaller screens that support JavaScript by default hide the nav off screen*/
66 | @media (min-width: 200px) {
67 | .js .navigation-menu {
68 | position: absolute;
69 | top: 0;
70 | bottom: 0;
71 | width: 200px;
72 | left: -200px;
73 | }
74 | /*when the menu button is clicked move the nav back on screen*/
75 | .js .OffCanvas-Active .navigation-menu {
76 | left: 0;
77 | }
78 | /*where transform3d is supported reset left and pull off screen with a translate3d instead*/
79 | .js .navigation-menu {
80 | left: auto;
81 | transform: translate3d(-200px, 0, 0);
82 | }
83 | /*when transform3d is supported and the menu button is clicked, reset the nav to default position*/
84 | .js .OffCanvas-Active .navigation-menu {
85 | transform: translate3d(0, 0, 0);
86 | }
87 | }
88 |
89 | /*for larger screens set the nav to the left and give the main content extra margin to compensate for it*/
90 | @media (min-width: 800px) {
91 | .navigation-menu {
92 | left: 0 !important;
93 | transform: none !important;
94 | }
95 | .off-canvas-launcher,
96 | .nav-close-button {
97 | display: none;
98 | }
99 | .main-content {
100 | position: relative;
101 | margin-left: 200px;
102 | }
103 | .no-js .main-content {
104 | margin-left: 0;
105 | }
106 | }
107 |
108 | @media (prefers-reduced-motion) {
109 | .navigation-menu {
110 | transition: none;
111 | }
112 | }
113 |
--------------------------------------------------------------------------------
/11/example_11-08/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | An example from http://rwd.education
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | The Front
15 | The Back
16 |
17 |
18 |
19 |
20 |
21 | The Front
22 | The Back
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/11/example_11-08/styles.css:
--------------------------------------------------------------------------------
1 | .flipper {
2 | perspective: 400px;
3 | position: relative;
4 | width: 300px;
5 | height: 44px;
6 | }
7 |
8 | .flipper + .flipper {
9 | margin-top: 1em;
10 | }
11 |
12 | .flipper-object {
13 | position: absolute;
14 | width: 100%;
15 | height: 100%;
16 | transition: transform 1s;
17 | transform-style: preserve-3d;
18 | }
19 |
20 | .panel {
21 | display: flex;
22 | min-height: 44px;
23 | align-items: center;
24 | justify-content: center;
25 | top: 0;
26 | width: 100%;
27 | height: 100%;
28 | position: absolute;
29 | backface-visibility: hidden;
30 | }
31 |
32 | .flipper-vertical .back {
33 | transform: rotateX(180deg);
34 | }
35 |
36 | .flipper-horizontal .back {
37 | transform: rotateY(180deg);
38 | }
39 |
40 | .back {
41 | background-color: #CC3232;
42 | }
43 |
44 | .front {
45 | background-color: #739328;
46 | }
47 |
48 | .flipper:hover .flipper-vertical {
49 | transform: rotateX(180deg);
50 | animation: pulse 2s 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) 5 alternate both;
51 | }
52 |
53 | .flipper:hover .flipper-horizontal {
54 | transform: rotateY(180deg);
55 | animation: pulse 1s 1s infinite alternate both;
56 | }
57 |
58 | /*The animation keyframe*/
59 |
60 | @keyframes pulse {
61 | 100% {
62 | text-shadow: 0 0 5px #bbb;
63 | box-shadow: 0 0 3px 4px #bbb;
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/11/example_11-09/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | An example from http://rwd.education
6 |
7 |
8 |
9 |
10 |
11 |
12 | Without animation-fill-mode
13 |
14 | With animation-fill-mode forwards
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/11/example_11-09/styles.css:
--------------------------------------------------------------------------------
1 | .background-change {
2 | animation: fillBg 3s;
3 | height: 200px;
4 | width: 400px;
5 | border: 1px solid #ccc;
6 | }
7 |
8 | @keyframes fillBg {
9 | 0% {
10 | background-color: yellow;
11 | }
12 | 100% {
13 | background-color: red;
14 | }
15 | }
16 |
17 | .fill-mode-forwards {
18 | animation-fill-mode: forwards;
19 | }
--------------------------------------------------------------------------------
/12/example_12-01/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CSS Custom Properties
5 |
6 |
7 |
8 |
9 |
10 |
11 | If you can keep your head when all about you
12 | Are losing theirs and blaming it on you; If you can trust
13 | yourself when all men doubt you,
14 | But make allowance for their doubting too: If you can wait and
15 | not be tired by waiting,
16 | Or, being lied about, don't deal in lies, Or being hated don't
17 | give way to hating,
18 | And yet don't look too good, nor talk too wise;
19 | If you can dream- -and not make dreams your master;
20 | If you can think- -and not make thoughts your aim, If you can
21 | meet with Triumph and Disaster
22 | And treat those two impostors just the same:. If you can bear
23 | to hear the truth you've spoken
24 | Twisted by knaves to make a trap for fools, Or watch the things
25 | you gave your life to, broken,
26 | And stoop and build'em up with worn-out tools;
27 | If you can make one heap of all your winnings
28 | And risk it on one turn of pitch-and-toss, And lose, and start
29 | again at your beginnings,
30 | And never breathe a word about your loss: If you can force your
31 | heart and nerve and sinew
32 | To serve your turn long after they are gone, And so hold on
33 | when there is nothing in you
34 | Except the Will which says to them: 'Hold on! '
35 | If you can talk with crowds and keep your virtue,
36 | Or walk with Kings- -nor lose the common touch, If neither foes
37 | nor loving friends can hurt you,
38 | If all men count with you, but none too much: If you can fill
39 | the unforgiving minute
40 | With sixty seconds' worth of distance run, Yours is the Earth
41 | and everything that's in it,
42 | And- -which is more- -you'll be a Man, my son!
43 |
44 |
45 |
46 | Toggle Colors
47 |
68 |
69 |
70 |
--------------------------------------------------------------------------------
/12/example_12-01/styles.css:
--------------------------------------------------------------------------------
1 | body {
2 | background-color: var(--background);
3 | color: var(--foreground);
4 | transition: all 0.35s;
5 | font-size: 1.4em;
6 | line-height: 1.4;
7 | }
8 |
--------------------------------------------------------------------------------
/12/example_12-02/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | rwd.education example file
5 |
6 |
7 |
8 |
9 |
10 |
13 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/12/example_12-02/styles.css:
--------------------------------------------------------------------------------
1 | html,
2 | body {
3 | display: flex;
4 | height: 100%;
5 | width: 100%;
6 | margin: 0;
7 | align-items: center;
8 | justify-content: center;
9 | background-color: #333;
10 | }
11 |
12 | .court {
13 | width: 400px;
14 | height: 200px;
15 | background-color: rgb(197, 150, 86);
16 | position: relative;
17 | }
18 |
19 | .ball {
20 | --ballSize: 18px;
21 | --ball-border: #fff;
22 | --ball-color: #df4a23;
23 | position: absolute;
24 | left: calc(var(--x) - var(--ballSize));
25 | top: calc(var(--y) - var(--ballSize));
26 | width: var(--ballSize);
27 | height: var(--ballSize);
28 | background-color: var(--ball-color);
29 | border-radius: 50%;
30 | transition: all 0.3s ease-in-out;
31 | border: 1px solid var(--ball-border);
32 | animation: 0.5s ease infinite alternate forwards bounce;
33 | }
34 |
35 | @keyframes bounce {
36 | 0% {
37 | transform: scale(1);
38 | }
39 | 100% {
40 | transform: scale(1.3);
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/14/example_14-01/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Cascade Layers Example
7 |
8 |
9 |
10 | The rain in Spain falls mostly on the plain.
11 |
12 |
13 |
--------------------------------------------------------------------------------
/14/example_14-01/styles.css:
--------------------------------------------------------------------------------
1 | @layer reset,
2 | type;
3 |
4 | @layer reset {
5 | .para {
6 | font-size: 2rem;
7 | color: hotpink !important;
8 | text-decoration-style: dotted;
9 | text-decoration: line-through orange !important;
10 | }
11 | }
12 |
13 | @layer type {
14 | .para {
15 | font-size: 1.2rem !important;
16 | color: goldenrod !important;
17 | text-decoration: solid overline lime !important;
18 | }
19 | }
20 |
21 | .para {
22 | font-size: 1rem;
23 | color: brown;
24 | text-decoration: wavy underline lime !important;
25 | }
26 |
--------------------------------------------------------------------------------
/15/example_15-01/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Single Line Truncation
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | OK, listen up, I've figured out the key to eternal happiness. All
14 | you need to do is eat lots of scones.
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/15/example_15-01/styles.css:
--------------------------------------------------------------------------------
1 | .truncate {
2 | width: 530px;
3 | overflow: hidden;
4 | text-overflow: ellipsis;
5 | white-space: nowrap;
6 | }
7 |
--------------------------------------------------------------------------------
/15/example_15-02/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Multi-line Trunctation
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | OK, listen up, I've figured out the key to eternal happiness. All
14 | you need to do is eat lots of scones.
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/15/example_15-02/styles.css:
--------------------------------------------------------------------------------
1 | .multi-line-truncate {
2 | width: 250px;
3 | text-overflow: ellipsis;
4 | overflow: hidden;
5 | -webkit-line-clamp: 2;
6 | -webkit-box-orient: vertical;
7 | display: -webkit-box;
8 | }
9 |
--------------------------------------------------------------------------------
/15/example_15-03/Earth.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/15/example_15-03/Earth.jpg
--------------------------------------------------------------------------------
/15/example_15-03/Jupiter.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/15/example_15-03/Jupiter.jpg
--------------------------------------------------------------------------------
/15/example_15-03/Mars.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/15/example_15-03/Mars.jpg
--------------------------------------------------------------------------------
/15/example_15-03/Mercury.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/15/example_15-03/Mercury.jpg
--------------------------------------------------------------------------------
/15/example_15-03/Neptune.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/15/example_15-03/Neptune.jpg
--------------------------------------------------------------------------------
/15/example_15-03/Pluto.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/15/example_15-03/Pluto.jpg
--------------------------------------------------------------------------------
/15/example_15-03/Saturn.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/15/example_15-03/Saturn.jpg
--------------------------------------------------------------------------------
/15/example_15-03/Sun.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/15/example_15-03/Sun.jpg
--------------------------------------------------------------------------------
/15/example_15-03/Uranus.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/15/example_15-03/Uranus.jpg
--------------------------------------------------------------------------------
/15/example_15-03/Venus.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/15/example_15-03/Venus.jpg
--------------------------------------------------------------------------------
/15/example_15-03/styles.css:
--------------------------------------------------------------------------------
1 | body {
2 | background-color: #111;
3 | color: #fff;
4 | font-family: sans-serif;
5 | padding: 0 10px;
6 | }
7 |
8 | a {
9 | color: #fff;
10 | background-color: #666;
11 | text-decoration-style: double;
12 | }
13 |
14 | .Scroll_Wrapper {
15 | display: grid;
16 | width: 100%;
17 | overflow-y: hidden;
18 | overflow-x: scroll;
19 | gap: 0 20px;
20 | grid-template-rows: auto auto;
21 | grid-auto-columns: auto;
22 | grid-auto-flow: column;
23 | /* standards way, currently only implemented by Firefox */
24 | scrollbar-color: #b5b5b5 #616161;
25 | scrollbar-width: thin;
26 | scroll-snap-type: x mandatory;
27 | scroll-behavior: smooth;
28 | }
29 |
30 | .Scroll_Wrapper::-webkit-scrollbar {
31 | width: 25px;
32 | background-color: #616161;
33 | }
34 |
35 | .Scroll_Wrapper::-webkit-scrollbar-thumb {
36 | background-color: #b5b5b5;
37 | border-radius: 12px;
38 | }
39 |
40 | .Item {
41 | grid-row: 1/-1;
42 | display: grid;
43 | grid-template-rows: subgrid;
44 | grid-template-columns: 100px 200px;
45 | gap: 0 20px;
46 | margin: 0;
47 | scroll-snap-align: start;
48 | scroll-snap-stop: always;
49 | }
50 |
51 | .Item img {
52 | border: 1px solid #333;
53 | aspect-ratio: auto;
54 | width: 100%;
55 | display: block;
56 | grid-row: 1/-1;
57 | grid-column: 1;
58 | }
59 | .Item p {
60 | grid-row: 1;
61 | line-height: 1.2;
62 | grid-column: 2;
63 | margin-block: 0;
64 | }
65 |
66 | .Caption {
67 | font-size: 1.2rem;
68 | grid-row: 2;
69 | grid-column: 1/-1;
70 | margin: 0;
71 | }
72 |
73 | em {
74 | font-size: 0.8em;
75 | color: #ccc;
76 | display: inline-block;
77 | margin-left: 10px;
78 | }
79 |
80 | .ScrollBtn {
81 | margin: 20px 0 0 20px;
82 | display: inline-flex;
83 | align-items: center;
84 | padding: 0 20px;
85 | text-decoration: none;
86 | font-size: 12px;
87 | color: #fff;
88 | min-height: 35px;
89 | border: 1px solid #888;
90 | border-radius: 3px;
91 | transition: all 0.2s;
92 | }
93 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 Packt
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Responsive Web Design with HTML5 and CSS - 4th Edition
2 |
3 | Responsive Web Design with HTML5 and CSS, Fourth Edition, published by Packt
4 |
5 | For more about this title, visit [rwd.education](https://rwd.education)
6 |
7 | Queries? Create an issue, contact the author on [Twitter](https://twitter.com/benfrain) or via his [website](https://benfrain.com)
8 |
9 |
10 |
11 | ## Building the 'rwd.education' site
12 |
13 | You can browse the source files used to build the [rwd.education](https://rwd.education) website here.
14 |
15 | To build the site I used [vitejs](https://vitejs.dev/) to speed development.
16 |
17 | **Note** that a CSS post-processor step was used so I can nest media queries inside selectors (see Chapter 14 for more info) and TypeScript was used for the little bit of JavaScript.
18 |
19 | I also used the rather lovely [https://realfavicongenerator.net/](https://realfavicongenerator.net/) to make all the favicon images/manifests.
20 |
21 | If you are curious and 'don't mind getting your hands dirty', included in the folder should be everything you need to run it up in a local server yourself.
22 |
23 | - You will need to install a recent version of Node (I used 16 if memory serves)
24 | - You will need to install [Vite](https://vite.dev) v3
25 | - Run [sudo] npm install
in Terminal from the 'rwd.education' folder
26 | - Assuming all installs OK (cross all your digits!), after everything is installed, you should now be able to run `npm run build` from the Terminal and away you go.
27 |
28 | Problems? Open an issue, Tweet at me or send me a mail. Happy building!
29 |
--------------------------------------------------------------------------------
/rwd.education/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | pnpm-debug.log*
8 | lerna-debug.log*
9 |
10 | node_modules
11 | dist
12 | dist-ssr
13 | *.local
14 |
15 | # Editor directories and files
16 | .vscode/*
17 | !.vscode/extensions.json
18 | .idea
19 | .DS_Store
20 | *.suo
21 | *.ntvs*
22 | *.njsproj
23 | *.sln
24 | *.sw?
25 |
--------------------------------------------------------------------------------
/rwd.education/RWD3e_design.sketch:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/rwd.education/RWD3e_design.sketch
--------------------------------------------------------------------------------
/rwd.education/favicon.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/rwd.education/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "rwd.education",
3 | "private": true,
4 | "version": "0.0.0",
5 | "type": "module",
6 | "scripts": {
7 | "dev": "vite",
8 | "build": "tsc && vite build",
9 | "preview": "vite preview"
10 | },
11 | "postcss": {
12 | "plugins": {
13 | "postcss-nesting": {}
14 | }
15 | },
16 | "devDependencies": {
17 | "postcss-nesting": "^10.1.10",
18 | "typescript": "^4.6.4",
19 | "vite": "^3.2.4"
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/rwd.education/public/chapter1.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/rwd.education/public/chapter1.pdf
--------------------------------------------------------------------------------
/rwd.education/public/favicon.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/rwd.education/public/favicon/android-chrome-192x192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/rwd.education/public/favicon/android-chrome-192x192.png
--------------------------------------------------------------------------------
/rwd.education/public/favicon/android-chrome-512x512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/rwd.education/public/favicon/android-chrome-512x512.png
--------------------------------------------------------------------------------
/rwd.education/public/favicon/apple-touch-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/rwd.education/public/favicon/apple-touch-icon.png
--------------------------------------------------------------------------------
/rwd.education/public/favicon/browserconfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | #da532c
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/rwd.education/public/favicon/favicon-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/rwd.education/public/favicon/favicon-16x16.png
--------------------------------------------------------------------------------
/rwd.education/public/favicon/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/rwd.education/public/favicon/favicon-32x32.png
--------------------------------------------------------------------------------
/rwd.education/public/favicon/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/rwd.education/public/favicon/favicon.ico
--------------------------------------------------------------------------------
/rwd.education/public/favicon/mstile-144x144.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/rwd.education/public/favicon/mstile-144x144.png
--------------------------------------------------------------------------------
/rwd.education/public/favicon/mstile-150x150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/rwd.education/public/favicon/mstile-150x150.png
--------------------------------------------------------------------------------
/rwd.education/public/favicon/mstile-310x150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/rwd.education/public/favicon/mstile-310x150.png
--------------------------------------------------------------------------------
/rwd.education/public/favicon/mstile-310x310.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/rwd.education/public/favicon/mstile-310x310.png
--------------------------------------------------------------------------------
/rwd.education/public/favicon/mstile-70x70.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/rwd.education/public/favicon/mstile-70x70.png
--------------------------------------------------------------------------------
/rwd.education/public/favicon/safari-pinned-tab.svg:
--------------------------------------------------------------------------------
1 |
2 |
4 |
7 |
8 | Created by potrace 1.11, written by Peter Selinger 2001-2013
9 |
10 |
12 |
20 |
56 |
63 |
64 |
65 |
--------------------------------------------------------------------------------
/rwd.education/public/inside1.avif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/rwd.education/public/inside1.avif
--------------------------------------------------------------------------------
/rwd.education/public/inside1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/rwd.education/public/inside1.jpg
--------------------------------------------------------------------------------
/rwd.education/public/inside1.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/rwd.education/public/inside1.webp
--------------------------------------------------------------------------------
/rwd.education/public/inside2.avif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/rwd.education/public/inside2.avif
--------------------------------------------------------------------------------
/rwd.education/public/inside2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/rwd.education/public/inside2.jpg
--------------------------------------------------------------------------------
/rwd.education/public/inside2.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/rwd.education/public/inside2.webp
--------------------------------------------------------------------------------
/rwd.education/public/inside3.avif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/rwd.education/public/inside3.avif
--------------------------------------------------------------------------------
/rwd.education/public/inside3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/rwd.education/public/inside3.jpg
--------------------------------------------------------------------------------
/rwd.education/public/inside3.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/rwd.education/public/inside3.webp
--------------------------------------------------------------------------------
/rwd.education/public/inside4.avif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/rwd.education/public/inside4.avif
--------------------------------------------------------------------------------
/rwd.education/public/inside4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/rwd.education/public/inside4.jpg
--------------------------------------------------------------------------------
/rwd.education/public/inside4.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/rwd.education/public/inside4.webp
--------------------------------------------------------------------------------
/rwd.education/public/inside5.avif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/rwd.education/public/inside5.avif
--------------------------------------------------------------------------------
/rwd.education/public/inside5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/rwd.education/public/inside5.jpg
--------------------------------------------------------------------------------
/rwd.education/public/inside5.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/rwd.education/public/inside5.webp
--------------------------------------------------------------------------------
/rwd.education/public/site.webmanifest:
--------------------------------------------------------------------------------
1 | {
2 | "name": "",
3 | "short_name": "",
4 | "icons": [
5 | {
6 | "src": "/src/favicon/android-chrome-192x192.png",
7 | "sizes": "192x192",
8 | "type": "image/png"
9 | },
10 | {
11 | "src": "/src/favicon/android-chrome-512x512.png",
12 | "sizes": "512x512",
13 | "type": "image/png"
14 | }
15 | ],
16 | "theme_color": "#ffffff",
17 | "background_color": "#ffffff",
18 | "display": "standalone"
19 | }
20 |
--------------------------------------------------------------------------------
/rwd.education/src/fonts/Inter-Regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/rwd.education/src/fonts/Inter-Regular.woff
--------------------------------------------------------------------------------
/rwd.education/src/fonts/Inter-Regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/rwd.education/src/fonts/Inter-Regular.woff2
--------------------------------------------------------------------------------
/rwd.education/src/fonts/Inter.var.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/rwd.education/src/fonts/Inter.var.woff2
--------------------------------------------------------------------------------
/rwd.education/src/img/ResponsiveWebDesign_BenFrain_Cover500.avif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/rwd.education/src/img/ResponsiveWebDesign_BenFrain_Cover500.avif
--------------------------------------------------------------------------------
/rwd.education/src/img/ResponsiveWebDesign_BenFrain_Cover500.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/rwd.education/src/img/ResponsiveWebDesign_BenFrain_Cover500.jpg
--------------------------------------------------------------------------------
/rwd.education/src/img/ResponsiveWebDesign_BenFrain_Cover500.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/rwd.education/src/img/ResponsiveWebDesign_BenFrain_Cover500.webp
--------------------------------------------------------------------------------
/rwd.education/src/img/ResponsiveWebDesign_BenFrain_Cover700.avif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/rwd.education/src/img/ResponsiveWebDesign_BenFrain_Cover700.avif
--------------------------------------------------------------------------------
/rwd.education/src/img/ResponsiveWebDesign_BenFrain_Cover700.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/rwd.education/src/img/ResponsiveWebDesign_BenFrain_Cover700.jpg
--------------------------------------------------------------------------------
/rwd.education/src/img/ResponsiveWebDesign_BenFrain_Cover700.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/rwd.education/src/img/ResponsiveWebDesign_BenFrain_Cover700.webp
--------------------------------------------------------------------------------
/rwd.education/src/img/triangleRed.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/rwd.education/src/img/triangle_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benfrain/rwd4/2c4f890d5342e73c10a7f6ec5fe223079b683c76/rwd.education/src/img/triangle_bg.png
--------------------------------------------------------------------------------
/rwd.education/src/site.webmanifest:
--------------------------------------------------------------------------------
1 | {
2 | "name": "",
3 | "short_name": "",
4 | "icons": [
5 | {
6 | "src": "favicon/android-chrome-192x192.png",
7 | "sizes": "192x192",
8 | "type": "image/png"
9 | },
10 | {
11 | "src": "favicon/android-chrome-512x512.png",
12 | "sizes": "512x512",
13 | "type": "image/png"
14 | }
15 | ],
16 | "theme_color": "#ffffff",
17 | "background_color": "#ffffff",
18 | "display": "standalone"
19 | }
20 |
--------------------------------------------------------------------------------
/rwd.education/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/rwd.education/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ESNext",
4 | "useDefineForClassFields": true,
5 | "module": "ESNext",
6 | "lib": ["ESNext", "DOM"],
7 | "moduleResolution": "Node",
8 | "strict": true,
9 | "sourceMap": true,
10 | "resolveJsonModule": true,
11 | "isolatedModules": true,
12 | "esModuleInterop": true,
13 | "noEmit": true,
14 | "noUnusedLocals": true,
15 | "noUnusedParameters": true,
16 | "noImplicitReturns": true,
17 | "skipLibCheck": true
18 | },
19 | "include": ["src"]
20 | }
21 |
--------------------------------------------------------------------------------
/rwd.education/vite.config.js:
--------------------------------------------------------------------------------
1 | export default {
2 | base: "./",
3 | build: {
4 | rollupOptions: {
5 | output: {
6 | chunkFileNames: "[name].js",
7 | entryFileNames: "[name].js",
8 | assetFileNames: "assets/[name][extname]",
9 | },
10 | },
11 | },
12 | };
13 |
--------------------------------------------------------------------------------