diff --git a/_sass/content.scss b/_sass/content.scss index c32a3b4e..4ce1af0d 100644 --- a/_sass/content.scss +++ b/_sass/content.scss @@ -56,7 +56,7 @@ border: none; } -.answer { +.dropdown { @extend %call-to-action-shared; border-left: 8px solid #CCC; @@ -77,3 +77,16 @@ transform: rotate(90deg); transition: transform 0.2s ease; } + +.expander-arrow { + cursor: pointer; + transform: rotate(0deg); + transition: transform 0.2s ease; + height: 15px; + width: 15px; +} + +.expander-arrow.expanded { + transform: rotate(90deg); + transition: transform 0.2s ease; +} diff --git a/assets/images/dropdown-example.png b/assets/images/dropdown-example.png new file mode 100644 index 00000000..6e8615ae Binary files /dev/null and b/assets/images/dropdown-example.png differ diff --git a/public/js/expander.js b/public/js/expander.js index 1b9e72b8..145e3e4d 100644 --- a/public/js/expander.js +++ b/public/js/expander.js @@ -1,12 +1,12 @@ console.log("in expander.js") -$('.answer > h3').each(function(idx, title) { +$('.dropdown > h3').each(function(idx, title) { const titleText = $(title).text(); $(title).replaceWith(`

expander arrow ${titleText}

`); }); -$('.answer > h3').nextAll().hide(); +$('.dropdown > h3').nextAll().hide(); -$('.answer > h3').on('click', function() { +$('.dropdown > h3').on('click', function() { let arrowEl = $(this).find('img.expander-arrow'); if (!arrowEl.hasClass('expanded')) { diff --git a/readme.md b/readme.md index b28b640d..f5bf87ac 100644 --- a/readme.md +++ b/readme.md @@ -31,6 +31,23 @@ The `today.html` file is where you will find the basic html page for today, and ## Some handy tips for editing/creating content +### Creating Dropdowns + +To create a dropdown like this: + +![screenshot of dropdown format](./assets/images/dropdown-example.png) + +Use the following structure: + +``` + +``` + ### Headers in your markdown files Put something like this at the top of all your markdown files: