Alexandre NOEL 3 mesiacov pred
rodič
commit
3ceaac240c
3 zmenil súbory, kde vykonal 243 pridanie a 0 odobranie
  1. BIN
      logo.png
  2. 41 0
      menu.html
  3. 202 0
      style.css

BIN
logo.png


+ 41 - 0
menu.html

@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Pure HTML5/CSS3 Sidemenu</title>
+    <link rel="stylesheet" href="style.css">
+</head>
+<body>
+    <input type="checkbox" id="toggle-sidebar" hidden>
+    <input type="checkbox" id="toggle-dark-mode" hidden>
+
+    <nav class="sidebar close">
+        <label for="toggle-sidebar" class="toggle">☰</label>
+
+        <div class="menu top-menu">
+            <ul>
+                <li><a href="#"><img src="logo.png" alt="Logo NNS" width="28"></a></li>
+                <li><a href="#"><i class="fa fa-commenting-o"></i><span>Link</span></a></li>
+                <li><a href="#"><i class="fa fa-commenting-o"></i><span>Link</span></a></li>
+				<li><a href="#"><i class="fa fa-commenting-o"></i><span>Link</span></a></li>
+				<li><a href="#"><i class="fa fa-commenting-o"></i><span>Link</span></a></li>
+            </ul>
+        </div>
+
+        <div class="menu bottom-menu">
+            <ul>
+				<li><a href="#"><i class="fa fa-commenting-o"></i><span>Link</span></a></li>
+				<li><a href="#"><i class="fa fa-commenting-o"></i><span>Link</span></a></li>
+				<li><a href="#"><i class="fa fa-commenting-o"></i><span>Link</span></a></li>
+                <li><a href="#"><img src="logo.png" alt="Logo OverSu" width="28"></a></li>
+            </ul>
+        </div>
+    </nav>
+
+    <section class="content">
+        <h1>Title h1</h1>
+        <p>Paragraph here</p>
+    </section>
+</body>
+</html>

+ 202 - 0
style.css

@@ -0,0 +1,202 @@
+@import url('https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css');
+
+body {
+    margin: 0;
+    font-family: Arial, sans-serif;
+    background: #f4f4f4;
+    transition: background 0.3s, color 0.3s;
+    display: flex;
+}
+
+body.dark {
+    background: #333;
+    color: #f4f4f4;
+}
+
+.sidebar {
+    position: fixed;
+    left: 0;
+    top: 0;
+    width: 60px;
+    height: 100%;
+    background: #231f20;
+    padding: 20px;
+    box-sizing: border-box;
+    transition: width 0.3s ease-in-out;
+    overflow: hidden;
+    z-index: 1000;
+    display: flex;
+    flex-direction: column;
+    justify-content: space-between;
+}
+
+.sidebar.close {
+    width: 60px;
+}
+
+.sidebar.close .profile-label span,
+.sidebar.close a span {
+    opacity: 0;
+    visibility: hidden;
+    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
+}
+
+.sidebar:not(.close) .profile-label span,
+.sidebar:not(.close) a span {
+    opacity: 1;
+    visibility: visible;
+    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
+}
+
+.sidebar ul {
+    margin-left: -6px;
+    padding: 0;
+    list-style: none;
+}
+
+.sidebar ul li span {
+    margin-left: 10px;
+}
+
+.sidebar ul li a:has(img) {
+    padding: 0;
+}
+
+.sidebar .toggle {
+    cursor: pointer;
+    font-size: 23px;
+    color: #ddd;
+    display: block;
+    margin: 0 0 20px -3px;
+}
+
+.sidebar .toggle-switch {
+    cursor: pointer;
+    color: #ddd;
+    display: flex;
+    align-items: center;
+    margin-top: auto;
+}
+
+.sidebar .toggle-switch .mode-text {
+    margin-left: 10px;
+}
+
+.content {
+    margin-left: 60px;
+    padding: 20px;
+    transition: margin-left 0.3s ease-in-out;
+    flex-grow: 1;
+}
+
+#toggle-sidebar:checked ~ .sidebar {
+    width: 250px;
+}
+
+#toggle-sidebar:checked ~ .content {
+    margin-left: 250px;
+}
+
+#toggle-sidebar:checked ~ .sidebar .profile-label span,
+#toggle-sidebar:checked ~ .sidebar a span {
+    opacity: 1;
+    visibility: visible;
+    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
+}
+
+.sidebar .profile-label,
+.sidebar a {
+    display: flex;
+    align-items: center;
+    font-size: 18px;
+    color: #ddd;
+    text-decoration: none;
+    margin: 10px 0;
+    transition: font-size 0.3s ease-in-out, visibility 0.3s ease-in-out;
+    position: relative;
+    padding: 5px 0 0 5px;
+}
+
+.sidebar a:hover, .sidebar label:hover {
+    color: #fff;
+}
+
+.sidebar .profile-label:before,
+.sidebar a:before {
+    content: attr(data-icon);
+    font-size: 24px;
+    display: inline-block;
+    width: 30px;
+    text-align: center;
+    position: absolute;
+    left: 10px;
+    top: 50%;
+    transform: translateY(-50%);
+}
+
+#toggle-dark-mode:checked ~ body {
+    background: #333;
+    color: #f4f4f4;
+}
+
+#toggle-dark-mode:checked ~ .sidebar {
+    background: #333;
+}
+
+#toggle-dark-mode:checked ~ .sidebar a,
+#toggle-dark-mode:checked ~ .sidebar .profile-label,
+#toggle-dark-mode:checked ~ .sidebar .toggle-switch .mode-text {
+    color: #f4f4f4;
+}
+
+.sidebar .top-menu {
+    flex-grow: 1;
+}
+
+.sidebar .bottom-menu {
+    margin-top: 20px;
+}
+
+.sidebar .bottom-menu ul li {
+    height: 40px;
+    display: flex;
+    align-items: center;
+}
+
+@media screen and (max-width: 768px) {
+    .sidebar {
+        width: 60px;
+    }
+
+    .content {
+        margin-left: 60px;
+        padding: 10px;
+    }
+
+    #toggle-sidebar:checked ~ .sidebar {
+        width: 250px;
+    }
+
+    #toggle-sidebar:checked ~ .content {
+        margin-left: 250px;
+    }
+
+    .sidebar .toggle {
+        display: block;
+        margin: 10px 0;
+    }
+
+    .sidebar .toggle-switch {
+        display: none;
+    }
+}
+
+@media screen and (max-width: 480px) {
+    .sidebar .toggle {
+        font-size: 18px;
+    }
+
+    .content h1 {
+        font-size: 24px;
+    }
+}