diff --git a/challenges/01-responsive-web-design/applied-accessibility.json b/challenges/01-responsive-web-design/applied-accessibility.json
index 87df848bf1..2424a1d4c0 100644
--- a/challenges/01-responsive-web-design/applied-accessibility.json
+++ b/challenges/01-responsive-web-design/applied-accessibility.json
@@ -1251,7 +1251,9 @@
"assert(code.match(/background-color:\\s*?hsl\\(120,\\s*?25%,\\s*?55%\\)/gi), 'Your code should only change the lightness value for the background-color
property to a value of 55%.');"
}
],
- "solutions": [],
+ "solutions": [
+ "var code = \"body {color: hsl(0, 55%, 15%); background-color: hsl(120, 25%, 55%);}\""
+ ],
"hints": [],
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
diff --git a/challenges/01-responsive-web-design/applied-visual-design.json b/challenges/01-responsive-web-design/applied-visual-design.json
index 123724e7e0..51da359bf0 100644
--- a/challenges/01-responsive-web-design/applied-visual-design.json
+++ b/challenges/01-responsive-web-design/applied-visual-design.json
@@ -98,7 +98,9 @@
"assert(code.match(/.fullCard\\s*{[\\s\\S][^}]*\\n*^\\s*width\\s*:\\s*245px\\s*;/gm), 'Your code should change the width
property of the card to 245 pixels by using the fullCard
class selector.');"
}
],
- "solutions": [],
+ "solutions": [
+ "var code = \".fullCard {\\nwidth: 245px; border: 1px solid #ccc; border-radius: 5px; margin: 10px 5px; padding: 4px;}\""
+ ],
"hints": [],
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
@@ -809,7 +811,9 @@
"assert(code.match(/box-shadow:\\s*?0\\s+?10px\\s+?20px\\s+?rgba\\(\\s*?0\\s*?,\\s*?0\\s*?,\\s*?0\\s*?,\\s*?0?\\.19\\),\\s*?0\\s+?6px\\s+?6px\\s+?rgba\\(\\s*?0\\s*?,\\s*?0\\s*?,\\s*?0\\s*?,\\s*?0?\\.23\\)/gi), 'You should use the given CSS for the box-shadow
value.');"
}
],
- "solutions": [],
+ "solutions": [
+ "var code = \"#thumbnail {box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);}\""
+ ],
"hints": [],
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
@@ -1735,7 +1739,9 @@
"assert(code.match(/margin:\\s*?auto;/g), 'The div
should have a margin
set to auto.');"
}
],
- "solutions": [],
+ "solutions": [
+ "var code = \"div {background-color: blue; height: 100px; width: 100px; margin: auto;}\""
+ ],
"hints": [],
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
@@ -2099,7 +2105,9 @@
"assert(code.match(/nav\\s*?{\\s*?background-color:\\s*?hsl\\(180,\\s*?80%,\\s*?25%\\)/gi), 'The nav
element should have a background-color
of the adjusted cyan tone using the hsl()
property.');"
}
],
- "solutions": [],
+ "solutions": [
+ "var code = \"nav {background-color: hsl(180, 80%, 25%);}\""
+ ],
"hints": [],
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
@@ -2178,7 +2186,9 @@
"assert(code.match(/background:\\s*?linear-gradient\\(35deg,\\s*?(#CCFFFF|#CFF),\\s*?(#FFCCCC|#FCC)\\);/gi), 'The div
element should have a linear-gradient
background
with the specified direction and colors.');"
}
],
- "solutions": [],
+ "solutions": [
+ "var code = \"
black
.');"
}
],
- "solutions": [],
+ "solutions": [
+ "var code = \"background: repeating-linear-gradient(45deg, yellow 0px, yellow 40px, black 40px, black 80px);\""
+ ],
"hints": [],
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
@@ -2310,7 +2322,9 @@
"assert(code.match(/background:\\s*?url\\(\\s*(\"|'|)https:\\/\\/i\\.imgur\\.com\\/MJAkxbh\\.png\\1\\s*\\)/gi), 'Your body
element should have a background
property set to a url()
with the given link.');"
}
],
- "solutions": [],
+ "solutions": [
+ "var code = \"body {background: url('https://i.imgur.com/MJAkxbh.png')}\""
+ ],
"hints": [
"Remember to wrap the address in quotes within the url() function."
],
@@ -2346,7 +2360,9 @@
"assert(code.match(/#ball2\\s*?{\\s*?left:\\s*?65%;\\s*?transform:\\s*?scale\\(1\\.5\\);\\s*?}|#ball2\\s*?{\\s*?transform:\\s*?scale\\(1\\.5\\);\\s*?left:\\s*?65%;\\s*?}/gi), 'Set the transform
property for #ball2
to scale it 1.5 times its size.');"
}
],
- "solutions": [],
+ "solutions": [
+ "var code = \"#ball2 {left: 65%; transform: scale(1.5);}\""
+ ],
"hints": [],
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
@@ -2408,7 +2424,7 @@
"assert(code.match(/div:hover\\s*?{\\s*?transform:\\s*?scale\\(1\\.1\\);/gi), 'The size of the div
element should scale 1.1 times when the user hovers over it.');"
}
],
- "solutions": [],
+ "solutions": ["var code = \"div:hover {transform: scale(1.1);}\""],
"hints": [
"Make sure to apply the CSS rule to the hover state of the div, using div:hover"
],
@@ -2463,7 +2479,9 @@
"assert(code.match(/#bottom\\s*?{\\s*?.*?\\s*?transform:\\s*?skewX\\(24deg\\);/g), 'The element with id bottom
should be skewed by 24 degrees along its X-axis.');"
}
],
- "solutions": [],
+ "solutions": [
+ "var code = \"#bottom {background-color: blue; transform: skewX(24deg);}\""
+ ],
"hints": [
"Notice that there is no space between the number and \"deg\" (-32deg) when declaring the degrees value."
],
@@ -2516,7 +2534,9 @@
"assert(code.match(/#top\\s*?{\\s*?.*?\\s*?transform:\\s*?skewY\\(-10deg\\);/g), 'The element with id top
should be skewed by -10 degrees along its Y-axis.');"
}
],
- "solutions": [],
+ "solutions": [
+ "var code = \"#top {background-color: red; transform: skewY(-10deg);}\""
+ ],
"hints": [],
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
@@ -2582,7 +2602,9 @@
"assert(code.match(/box-shadow:\\s*?25px\\s+?10px\\s+?0(px)?\\s+?0(px)?\\s+?blue\\s*?;/gi), 'The value of the box-shadow
property should be set to 25px for offset-x
, 10px for offset-y
, 0 for blur-radius
, 0 for spread-radius
, and finally blue for the color.');"
}
],
- "solutions": [],
+ "solutions": [
+ "var code = \".center {background-color: transparent; border-radius: 50%; box-shadow: 25px 10px 0px 0 blue;}\""
+ ],
"hints": [],
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
@@ -2657,7 +2679,9 @@
"assert(code.match(/\\.heart::before\\s*?{\\s*?content\\s*?:\\s*?(\"|')\\1\\s*?;/gi), 'The content
of the heart::before
selector should be an empty string.');"
}
],
- "solutions": [],
+ "solutions": [
+ "var code = \".heart {transform: rotate(-45deg);} .heart::after {background-color: pink; border-radius: 50%;} .heart::before {content: \\\"\\\"; border-radius: 50%;}\""
+ ],
"hints": [],
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
@@ -2873,7 +2897,9 @@
"assert(code.match(/button\\s*?:\\s*?hover\\s*?{[\\s\\S]*animation-fill-mode\\s*?:\\s*?forwards\\s*?;[\\s\\S]*}/gi) && code.match(/button\\s*?:\\s*?hover\\s*?{[\\s\\S]*animation-name\\s*?:\\s*?background-color\\s*?;[\\s\\S]*}/gi) && code.match(/button\\s*?:\\s*?hover\\s*?{[\\s\\S]*animation-duration\\s*?:\\s*?500ms\\s*?;[\\s\\S]*}/gi), 'button:hover
should have a animation-fill-mode
property with a value of forwards
.');"
}
],
- "solutions": [],
+ "solutions": [
+ "var code = \"button:hover {animation-name: background-color; animation-duration: 500ms; animation-fill-mode: forwards;}\""
+ ],
"hints": [],
"challengeType": 0,
"translations": {},
@@ -2940,7 +2966,9 @@
"assert(code.match(/100%\\s*?{\\s*?background-color:\\s*?yellow;\\s*?top:\\s*?0(px)?;\\s*?left:\\s*?-25px;\\s*?}/gi), 'The @keyframes
rule for 100%
should use the left
offset of -25px.');"
}
],
- "solutions": [],
+ "solutions": [
+ "var code = \"@keyframes rainbow {0% {background-color: blue; top: 0px; left: 0px;} 50% {background-color: green; top: 50px; left: 25px;} 100% {background-color: yellow; top: 0px; left:-25px;}}\""
+ ],
"hints": [],
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
@@ -3010,7 +3038,9 @@
"assert(code.match(/@keyframes fade\\s*?{\\s*?50%\\s*?{\\s*?(?:left:\\s*?60%;\\s*?opacity:\\s*?0?\\.1;|opacity:\\s*?0?\\.1;\\s*?left:\\s*?60%;)/gi), 'The keyframes
rule for fade should set the opacity
property to 0.1 at 50%.');"
}
],
- "solutions": [],
+ "solutions": [
+ "var code = \"@keyframes fade {50% { left: 60%; opacity: 0.1;}}\""
+ ],
"hints": [],
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
@@ -3249,7 +3279,9 @@
"assert(code.match(/twinkle-1\\s*?{\\s*?50%/g), 'The @keyframes
rule for the star-1
class should be 50%.');"
}
],
- "solutions": [],
+ "solutions": [
+ "var code = \"@keyframes twinkle-1 {50% {transform: scale(0.5); opacity: 0.5;}}\""
+ ],
"hints": [
"Check the animation-name declared in the star-1 class to find the right @keyframes rule to change."
],
diff --git a/challenges/01-responsive-web-design/basic-css.json b/challenges/01-responsive-web-design/basic-css.json
index 1556443aea..ec0bfec4f0 100644
--- a/challenges/01-responsive-web-design/basic-css.json
+++ b/challenges/01-responsive-web-design/basic-css.json
@@ -20,14 +20,11 @@
"tests": [
{
"text": "Your h2
element should be red.",
- "testString":
- "assert($(\"h2\").css(\"color\") === \"rgb(255, 0, 0)\", 'Your h2
element should be red.');"
+ "testString": "assert($(\"h2\").css(\"color\") === \"rgb(255, 0, 0)\", 'Your h2
element should be red.');"
},
{
- "text":
- "Your style
declaration should end with a ;
.",
- "testString":
- "assert(code.match(/style
declaration should end with a ;
.');"
+ "text": "Your style
declaration should end with a ;
.",
+ "testString": "assert(code.match(/style
declaration should end with a ;
.');"
}
],
"challengeType": 0,
@@ -140,32 +137,24 @@
],
"tests": [
{
- "text":
- "Remove the style attribute from your h2
element.",
- "testString":
- "assert(!$(\"h2\").attr(\"style\"), 'Remove the style attribute from your h2
element.');"
+ "text": "Remove the style attribute from your h2
element.",
+ "testString": "assert(!$(\"h2\").attr(\"style\"), 'Remove the style attribute from your h2
element.');"
},
{
"text": "Create a style
element.",
- "testString":
- "assert($(\"style\") && $(\"style\").length > 1, 'Create a style
element.');"
+ "testString": "assert($(\"style\") && $(\"style\").length > 1, 'Create a style
element.');"
},
{
"text": "Your h2
element should be blue.",
- "testString":
- "assert($(\"h2\").css(\"color\") === \"rgb(0, 0, 255)\", 'Your h2
element should be blue.');"
+ "testString": "assert($(\"h2\").css(\"color\") === \"rgb(0, 0, 255)\", 'Your h2
element should be blue.');"
},
{
- "text":
- "Ensure that your stylesheet h2
declaration is valid with a semicolon and closing brace.",
- "testString":
- "assert(code.match(/h2\\s*\\{\\s*color\\s*:.*;\\s*\\}/g), 'Ensure that your stylesheet h2
declaration is valid with a semicolon and closing brace.');"
+ "text": "Ensure that your stylesheet h2
declaration is valid with a semicolon and closing brace.",
+ "testString": "assert(code.match(/h2\\s*\\{\\s*color\\s*:.*;\\s*\\}/g), 'Ensure that your stylesheet h2
declaration is valid with a semicolon and closing brace.');"
},
{
- "text":
- "Make sure all your style
elements are valid and have a closing tag.",
- "testString":
- "assert(code.match(/<\\/style>/g) && code.match(/<\\/style>/g).length === (code.match(/