-
-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/shakee93/vue-toasted
# Conflicts: # .idea/workspace.xml
- Loading branch information
Showing
13 changed files
with
410 additions
and
8,792 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,5 @@ src/ | |
.babelrc | ||
webpack.config.js | ||
README.md | ||
*.map | ||
*.map | ||
examples |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2017 Shakeeb Sadikeen | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import Vue from 'vue'; | ||
import VueToasted from 'vue-toasted'; | ||
|
||
Vue.use(VueToasted); | ||
|
||
let toast = Vue.toasted.show('hello there, i am a toast !!'); | ||
|
||
// now you can use the toast object methods | ||
toast | ||
// change the text | ||
.text("change me now") | ||
|
||
// fade away in 1.5 seconds | ||
.goAway(1500); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
import { initPlugin } from './toast'; | ||
|
||
export default { | ||
const Toasted = { | ||
install: (Vue, options) => { | ||
initPlugin(Vue, options) | ||
} | ||
}; | ||
|
||
if (typeof window !== 'undefined' && window.Vue) { | ||
window.Vue.use(Toasted); | ||
} | ||
|
||
export default Toasted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,183 @@ | ||
#toasted-container { | ||
display: block; | ||
position: fixed; | ||
z-index: 10000; | ||
|
||
.toasted { | ||
top: 35px; | ||
width: auto; | ||
clear: both; | ||
margin-top: 10px; | ||
position: relative; | ||
max-width: 100%; | ||
height: auto; | ||
word-break: break-all; | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
|
||
.btn, .btn-flat { | ||
margin: 0; | ||
margin-left: 3rem; | ||
} | ||
|
||
// Templates | ||
|
||
&.rounded { | ||
border-radius: 24px; | ||
} | ||
|
||
// Primary | ||
&.primary { | ||
border-radius: 2px; | ||
min-height: 38px; | ||
line-height: 1.1em; | ||
background-color: #353535; | ||
padding: 0 20px; | ||
font-size: 15px; | ||
font-weight: 300; | ||
color: #fff; | ||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24); | ||
|
||
&.success { | ||
background: #4CAF50; | ||
} | ||
|
||
&.error { | ||
background: #F44336; | ||
} | ||
|
||
&.info { | ||
background: #3F51B5; | ||
} | ||
|
||
} | ||
|
||
// Bubble | ||
&.bubble { | ||
border-radius: 30px; | ||
min-height: 38px; | ||
line-height: 1.1em; | ||
background-color: #FF7043; | ||
padding: 0 20px; | ||
font-size: 15px; | ||
font-weight: 300; | ||
color: #fff; | ||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24); | ||
|
||
&.success { | ||
background: #4CAF50; | ||
} | ||
|
||
&.error { | ||
background: #F44336; | ||
} | ||
|
||
&.info { | ||
background: #3F51B5; | ||
} | ||
} | ||
|
||
&.outline { | ||
border-radius: 30px; | ||
min-height: 38px; | ||
line-height: 1.1em; | ||
background-color: white; | ||
border: 1px solid #676767; | ||
padding: 0 20px; | ||
font-size: 15px; | ||
color: #676767; | ||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24); | ||
font-weight: bold; | ||
|
||
&.success { | ||
color: #4CAF50; | ||
border-color: #4CAF50; | ||
} | ||
|
||
&.error { | ||
color: #F44336; | ||
border-color: #F44336; | ||
} | ||
|
||
&.info { | ||
color: #3F51B5; | ||
border-color: #3F51B5; | ||
} | ||
} | ||
} | ||
} | ||
|
||
@media only screen and (max-width: 600px) { | ||
#toasted-container { | ||
min-width: 100%; | ||
bottom: 0%; | ||
} | ||
} | ||
|
||
@media only screen and (min-width: 601px) and (max-width: 992px) { | ||
#toasted-container { | ||
max-width: 90%; | ||
} | ||
} | ||
|
||
@media only screen and (min-width: 993px) { | ||
#toasted-container { | ||
max-width: 86%; | ||
|
||
&.top-right { | ||
top: 10%; | ||
right: 7%; | ||
} | ||
|
||
&.top-left { | ||
top: 10%; | ||
left: 7%; | ||
} | ||
|
||
&.top-center { | ||
top: 10%; | ||
left: 50%; | ||
transform: translateX(-50%); | ||
} | ||
|
||
&.bottom-right { | ||
right: 5%; | ||
bottom: 7%; | ||
} | ||
|
||
&.bottom-left { | ||
left: 5%; | ||
bottom: 7%; | ||
} | ||
|
||
&.bottom-center { | ||
left: 50%; | ||
transform: translateX(-50%); | ||
bottom: 7%; | ||
} | ||
|
||
&.top-left .toasted, &.bottom-left .toasted { | ||
float: left; | ||
} | ||
} | ||
} | ||
|
||
@media only screen and (max-width: 600px) { | ||
.toasted { | ||
width: 100%; | ||
border-radius: 0; | ||
} | ||
} | ||
|
||
@media only screen and (min-width: 601px) and (max-width: 992px) { | ||
.toasted { | ||
float: left; | ||
} | ||
} | ||
|
||
@media only screen and (min-width: 993px) { | ||
.toasted { | ||
float: right; | ||
} | ||
} |
Oops, something went wrong.