Skip to content

Allows you to reveal an article by clicking an element

License

Notifications You must be signed in to change notification settings

swashbuck/adapt-article-reveal

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

adapt-article-reveal

DEPRECATED - USE DROP INSTEAD https://github.com/cgkineo/adapt-drop

Article reveal hides the article inner and prepends an element containing a button to the top of the article element. Pressing the button reveals the hidden article inner.

To set up article reveal with the standard configuration use the JSON provided in the example.json file

Configuration options are explained below the example JSON. "_articleReveal" object is added to each required article object in article.json


"_articleReveal":{
    "_classes": "",
    "_height":300,
    "_mobileHeight":200,
    "_icon-text": "REVEAL",
    "_showCloseButton": true,
    "_closeButtonText": "CLOSE",
    "_triggerPosition": {
        "_top":30,
        "_left":50
    },
    "_mobileTriggerPosition": {
        "_top":30,
        "_left":50
    },
    "_ariaLabels": {
        "openArticle": "",
        "closeArticle": ""
    },
    "_ariaRegions": {
        "articleReveal": ""
    },
    "_backgroundImage":"",
    "_mobileBackgroundImage":""
}

Config Options

Classes

"_classes": "",

Adds classes to the article reveal element. Use for bespoke styling.

Height

"_height":200,
"_mobileHeight":100,

Set the height of the element containing the button. Different heights can be set for large and small viewports.

Trigger(button) position

"_triggerPosition": {
    "_top":30,
    "_left":50
},
"_mobileTriggerPosition": {
    "_top":30,
    "_left":20
},

Set position of the reveal button, the position is set using percentages. Different positions can be set for large and small viewports.

Accessibility

"_ariaLabels": {
    "openArticle": "",
    "closeArticle": ""
},
"_ariaRegions": {
    "articleReveal": ""
},

Aria configuration options.

Background images

"_backgroundImage":"image.png",
"_mobileBackgroundImage":"mobile-image.png"

Background images can be set on the element that conatins the button. Different images can be set for large and small viewports.

About

Allows you to reveal an article by clicking an element

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 59.1%
  • Less 21.6%
  • Handlebars 19.3%