JSFiddle - React, Tailwind, and code Playground
by tharunkumar33
HTML
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui, viewport-fit=cover">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<title>My App</title>
<link rel="stylesheet" href="https://framework7.io/packages/core/css/framework7.min.css">
<link rel="stylesheet" href="https://framework7.io/css/framework7-icons.css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
</head>
<body>
<div id="app">
<div class="panel panel-left panel-reveal">
<div class="block">
<p>Left Panel content here</p>
<p><a class="panel-close" href="#">Close me</a></p>
</div>
</div>
<div class="view view-main view-init">
<div class="page">
<div class="navbar">
<div class="navbar-inner">
<div class="left"></div>
<div class="title">Toast</div>
<div class="right"></div>
</div>
</div>
<div class="page-content">
<div class="block">
<p>Swipe from the left to see the panel,close it.Then again, try Opening a toast and then swipe from the left.</p>
<p>
<a href="#" class="button button-raised open-toast-bottom">Toast on Bottom</a>
</p>
<p>
<a href="#" class="button button-raised open-toast-top">Toast on Top</a>
</p>
<p>
<a href="#" class="button button-raised open-toast-center">Toast on Center</a>
</p>
<p>
<a href="#" class="button button-raised open-toast-icon">Toast with icon</a>
</p>
<p>
<a href="#" class="button button-raised open-toast-large">Toast with large message</a>
</p>
<p>
<a href="#" class="button button-raised open-toast-button">Toast with close button</a>
</p>
<p>
<a href="#" class="button button-raised open-toast-custom-button">Toast with custom button</a>
</p>
<p>
<a href="#" class="button button-raised open-toast-callback">Toast with callback on close</a>
</p>
</div>
</div>
</div>
</div>
</div>
<script...
JavaScript
var theme = 'ios';
if (location.href.indexOf('theme=md') >= 0) theme = 'md';
var plugin = {
params: {
theme: theme,
root: '#app',
}
};
if (Framework7.use) Framework7.use(plugin);
else if (Framework7.Class && Framework7.Class.use) Framework7.Class.use(plugin);
var app = new Framework7();
var $$ = Dom7;
// Create bottom toast
var toastBottom = app.toast.create({
text: 'This is default bottom positioned toast',
closeTimeout: 10000,
});
// Create top toast
var toastTop = app.toast.create({
text: 'Top positioned toast',
position: 'top',
closeTimeout: 2000,
});
// Create center toast
var toastCenter = app.toast.create({
text: 'I\'m on center',
position: 'center',
closeTimeout: 2000,
});
// Create toast with icon
var toastIcon = app.toast.create({
icon: app.theme === 'ios' ? '<i class="f7-icons">star</i>' : '<i class="material-icons">star</i>',
text: 'I\'m with icon',
position: 'center',
closeTimeout: 2000,
});
// Create toast with large message
var toastLargeMessage = app.toast.create({
text: 'This toast contains a lot of text. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nihil, quae, ab. Delectus amet optio facere autem sapiente quisquam beatae culpa dolore.',
closeTimeout: 2000,
});
// Create toast with button
var toastWithButton = app.toast.create({
text: 'Toast with additional close button',
closeButton: true,
});
// Create toast with custom button text
var toastWithCustomButton = app.toast.create({
text: 'Custom close button',
closeButton: true,
closeButtonText: 'Close Me',
closeButtonColor: 'red',
});
// Create toast with callback on close
var...