Skip to content

Commit

Permalink
First version of Light Modal
Browse files Browse the repository at this point in the history
  • Loading branch information
hunzaboy committed Oct 23, 2017
1 parent 88bc8ec commit 9cd30b3
Show file tree
Hide file tree
Showing 14 changed files with 454 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Node
node_modules
demoSrc
package.json
package-lock.json
src
favicons
gulpfile.js
46 changes: 46 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at hunzaboy@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
For contribution, please submit a PR.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2017 Aslam Shah

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
1 change: 1 addition & 0 deletions demoDist/demo.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added demoDist/image.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demoDist/norbert-von-niman-354528.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demoDist/pattern.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions demoDist/scripts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

//Only for Demo animation Selection


function testAnim(x) {
$('.light-modal-content').removeClass().addClass(x + ' light-modal-content animated');
};

$(document).ready(function() {
$('.js--animations').change(function() {
var anim = $(this).val();
testAnim(anim);
});
});
156 changes: 156 additions & 0 deletions dist/css/light-modal.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
/*!
light-modal v1.4.0: Lightest 100% Css modal with cool animations.
(c) 2017
MIT License
git+https://github.com/hunzaboy/Light-Modal.git
*/
.light-modal {
display: none;
position: fixed;
background: transparent;
top: 0;
bottom: 0;
left: 0;
-ms-flex-align: center;
align-items: center;
-ms-flex-pack: center;
justify-content: center;
right: 0;
z-index: 9000;
transition: background 1s;
font-size: 16px;
}

.light-modal-content {
background: #845ec2;
color: #fff;
width: 30vw;
border-radius: .2em;
position: relative;
max-height: calc(100vh - 150px);
line-height: 1.4;
display: -ms-flexbox;
display: flex;
-ms-flex-direction: column;
flex-direction: column;
}

.light-modal-content img {
max-width: 100%;
border-radius: .2em;
}

.light-modal-content.large-content {
width: 50vw;
}

.light-modal-header {
padding: 20px 20px 20px 20px;
background: rgba(0, 0, 0, 0.2);
display: -ms-flexbox;
display: flex;
-ms-flex-pack: justify;
justify-content: space-between;
-ms-flex-align: center;
align-items: center;
}

.light-modal-heading {
margin: 0;
font-size: 1.5em;
}

.light-modal-heading + .light-modal-close-icon {
position: static;
}

.light-modal-body {
padding: 20px;
overflow: auto;
max-height: 500px;
}

.light-modal-footer {
padding: 20px 20px 20px 20px;
background: rgba(0, 0, 0, 0.2);
text-align: right;
display: -ms-flexbox;
display: flex;
-ms-flex-align: center;
align-items: center;
}

.light-modal-close-icon, .light-modal-close-btn {
text-decoration: none;
color: #fff;
padding: 5px 10px;
border-radius: .2em;
background: #FF6F91;
font-size: 1.5em;
line-height: 1;
transition: background .2s ease-in-out;
}

.light-modal-close-icon:hover, .light-modal-close-btn:hover {
background: #ff3c6a;
}

.light-modal-close-icon {
position: absolute;
top: -15px;
right: -15px;
}

.light-modal-close-btn {
font-size: 1em;
}

.light-modal-caption {
position: absolute;
left: 50%;
-ms-transform: translateX(-50%);
transform: translateX(-50%);
top: 100%;
padding: 10px 0;
background: rgba(0, 0, 0, 0.2);
border-radius: .2em;
width: 100%;
text-align: center;
margin-top: 5px;
}

.light-modal:target {
background: rgba(0, 0, 0, 0.5);
display: -ms-flexbox;
display: flex;
}

@keyframes basic {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}

.basic {
animation-name: basic;
}

@media (max-width: 767px) {
.light-modal {
font-size: 14px;
}
.light-modal:target .light-modal-content {
width: 70vw;
}
}

@supports (display: flex) {
@media (max-width: 767px) {
.light-modal:target .light-modal-content {
width: 70vw;
}
}
}
2 changes: 2 additions & 0 deletions dist/css/light-modal.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9cd30b3

Please sign in to comment.