sass-stuff/3D Components/index.html
Michał 52da7d7899 Clearer tab select
correct padding in Alerts
Pressed button has inset shaddow
2022-10-01 18:49:17 +00:00

194 lines
7.6 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sass Template</title>
<link rel="stylesheet" href="norm.css">
<link rel="stylesheet" href="Sass/style.css">
</head>
<style>
html {
background-color: #f5f5f5;
}
main {
margin: 0 auto 1rem auto;
padding: 2rem;
max-width: 1200px;
}
main > * {
max-width: 1200px;
}
main > *:last-child {
margin-bottom: 0;
}
</style>
<body>
<main>
<h1>Sass Templates</h1>
<p>gwa gwa</p>
<hr>
<div class="tabs">
<button class="tab tab-light" onclick="openTab(event, 'Buttons')">Buttons</button>
<button class="tab tab-light" onclick="openTab(event, 'Alerts')">Alerts</button>
<button class="tab tab-light" onclick="openTab(event, 'Badges')">Badges</button>
<button class="tab tab-light" onclick="openTab(event, 'Banners')">Banners</button>
<button class="tab tab-light" onclick="openTab(event, 'Image-Containers')">Image Containers</button>
<button class="tab tab-light" onclick="openTab(event, 'Tabs')">Tabs</button>
</div>
<div id="Buttons" class="tabcontent" style="display: none;">
<h2>Buttons</h2>
<div>
<h3>Active</h3>
<button class="btn btn-primary">Primary</button>
<button class="btn btn-secondary">Secondary</button>
<button class="btn btn-success">Success</button>
<button class="btn btn-danger">Danger</button>
<button class="btn btn-warning">Warning</button>
<button class="btn btn-info">Info</button>
<button class="btn btn-light">Light</button>
<button class="btn btn-dark">Dark</button>
</div>
<div>
<h3>Disabled</h3>
<button class="btn btn-primary" disabled>Primary</button>
<button class="btn btn-secondary" disabled>Secondary</button>
<button class="btn btn-success" disabled>Success</button>
<button class="btn btn-danger" disabled>Danger</button>
<button class="btn btn-warning" disabled>Warning</button>
<button class="btn btn-info" disabled>Info</button>
<button class="btn btn-light" disabled>Light</button>
<button class="btn btn-dark" disabled>Dark</button>
</div>
</div>
<div id="Alerts" class="tabcontent" style="display: none;">
<h2>Alerts</h2>
<div class="alert alert-primary">Primary <a href="">Gwa gwa</a>
<span class="alert-close">&times;</span>
</div>
<div class="alert alert-secondary">Secondary <a href="">Gwa gwa</a>
<span class="alert-close">&times;</span>
</div>
<div class="alert alert-success">Success <a href="">Gwa gwa</a>
<span class="alert-close">&times;</span>
</div>
<div class="alert alert-danger">Danger <a href="">Gwa gwa</a>
<span class="alert-close">&times;</span>
</div>
<div class="alert alert-warning">Warning <a href="">Gwa gwa</a>
<span class="alert-close">&times;</span>
</div>
<div class="alert alert-info">Info <a href="">Gwa gwa</a>
<span class="alert-close">&times;</span>
</div>
</div>
<div id="Badges" class="tabcontent" style="display: none;">
<h2>Badges</h2>
<span class="badge badge-primary">Primary</span>
<span class="badge badge-secondary">Secondary</span>
<span class="badge badge-success">Success</span>
<span class="badge badge-danger">Danger</span>
<span class="badge badge-warning">Warning</span>
<span class="badge badge-info">Info</span>
<span class="badge badge-light">Light</span>
<span class="badge badge-dark">Dark</span>
</div>
<div id="Banners" class="tabcontent" style="display: none;">
<h2>Banners</h2>
<div class="page-banner page-banner-primary">
<p>Primary <a href="">link</a></p>
<span class="page-banner-close">&times;</span>
</div>
<div class="page-banner page-banner-secondary">
<p>Secondary <a href="">link</a></p>
<span class="page-banner-close">&times;</span>
</div>
<div class="page-banner page-banner-success">
<p>Success <a href="">link</a></p>
<span class="page-banner-close">&times;</span>
</div>
<div class="page-banner page-banner-danger">
<p>Danger <a href="">link</a></p>
<span class="page-banner-close">&times;</span>
</div>
<div class="page-banner page-banner-warning">
<p>Warning <a href="">link</a></p>
<span class="page-banner-close">&times;</span>
</div>
<div class="page-banner page-banner-info">
<p>Info <a href="">link</a></p>
<span class="page-banner-close">&times;</span>
</div>
</div>
<div id="Image-Containers" class="tabcontent" style="display: none;">
<h2>Image container</h2>
<div class="img-container" style="width: 250px;">
<img src="racc.jpg" alt="Image">
<div class="div div-transparent">
<p>Racc ooon</p>
</div>
</div>
</div>
<div id="Tabs" class="tabcontent" style="display: none;">
<h2>Tabs</h2>
<div class="tabs">
<button class="tab tab-primary">Primary</button>
<button class="tab tab-secondary">Secondary</button>
<button class="tab tab-warning">Warning</button>
<button class="tab tab-info">Info</button>
<button class="tab tab-danger">Danger</button>
<button class="tab tab-light">Light</button>
<button class="tab tab-dark">Dark</button>
</div>
</div>
</main>
<script>
// Tabs
function openTab(evt, tabName) {
var i, tabcontent, tablinks;
tabcontent = document.getElementsByClassName("tabcontent");
for (i = 0; i < tabcontent.length; i++) {
tabcontent[i].style.display = "none";
}
tablinks = document.getElementsByClassName("tab");
for (i = 0; i < tablinks.length; i++) {
tablinks[i].className = tablinks[i].className.replace(" active", "");
}
document.getElementById(tabName).style.display = "block";
evt.currentTarget.className += " active";
}
// Alerts
const alertClose = document.querySelectorAll('.alert-close');
alertClose.forEach((close) => {
close.addEventListener('click', (e) => {
e.target.parentElement.style.display = 'none';
});
});
// Banners
const pageBannerClose = document.querySelectorAll('.page-banner-close');
pageBannerClose.forEach((close) => {
close.addEventListener('click', (e) => {
e.target.parentElement.style.display = 'none';
});
});
</script>
</body>
</html>