Informatik#2

In this example below you will see how to do a Informatik#2 with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by MGK_888, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright MGK_888 ©

Technologies

  • HTML
  • CSS
  • JavaScript
<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <title>Informatik#2</title>
  
  
  
      <link rel="stylesheet" href="css/style.css">

  
</head>

<body>

  <html>
<head>
  <title>Physik</title>
  <link type="text/css" rel="stylesheet" href="Informatik#2.css">
  <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700|Quicksand:300,700" rel="stylesheet">
</head>
  
  
  
<body>
 <div class="navbar">
  <ul>
   <li> 
     <div class="container" onclick="myFunction()">
     <div class="bar1"></div>
     <div class="bar2"></div>
     <div class="bar3"></div>
     </div>
     <p>Menü</p>
   </li>
  
<div id="m">
  <li><a href="#Home">Home</a></li>
  <li><a href="#Topic 1">Topic 1</a></li>
  <li><a href="#Topic 2">Topic 2</a></li>
  <li><a href="#Topic 3">Topic 3</a></li>
  <li><a href="#Topic 4">Topic 4</a></li>
  
</div>
  <li class="name"><a>Marten Karl</a></li>
</ul>
  </div>
   
  
 <div class="searchbtn">
  <button id="searchbtn" onclick="myFunction1()">Search</button>
  </div>
  
  <div id="search-list">
  <input type="text" id="myInput" onkeyup="myFunction()" placeholder="Search for topic...">
  <ul id="myUL">
   <li><a href="#" class="header2">T 1</a></li>
   <li><a href="#">Topic 1</a></li>
   <li><a href="#">Subtopic 1</a></li>

   <li><a href="#" class="header2">T 2</a></li>
   <li><a href="#">Topic 2</a></li>
   <li><a href="#">Subtopic 2</a></li>

   <li><a href="#" class="header2">T 3</a></li>
   <li><a href="#">Topic 3</a></li>
   <li><a href="#">Subtopic 3</a></li>
    
   <li><a href="#" class="header2">T 4</a></li>
   <li><a href="#">Topic 4</a></li>
   <li><a href="#">Subtopic 4</a></li>
 
 </ul>
  </div>
  
  </br>
  
  <div class="header">
    <div id="header-text" class="partner">
      <h1>Physik</h1>
 </br>
 </br>
 </br>
    <div class="tooltip"><i>Schwarze Löcher</i>
  <span class="tooltiptext">Ein Projekt des Informatik Kurses Q1 2016</span>
</div>
    </div>
  </div>
  
<div class="body">



  <div class="information">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem. Investigationes demonstraverunt lectores legere me lius quod ii legunt saepius.
</div>
<div class="img">
<img id="Oszilloskop"  src="http://i1.ytimg.com/vi/6BgcrRjqnKE/maxresdefault.jpg" alt="Oszilloskop">
</div>

  </br>
  
<div class="text-oszilloskop"> 
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu </p>
</div>

</br>


</br>



</div>




</body>
</html>
  
  

    <script  src="js/index.js"></script>




</body>

</html>

/*Downloaded from https://www.codeseek.co/MGK_888/informatik2-mOZdev */
@import url("https://fonts.googleapis.com/css?family=Fjalla+One");
@import url('https://fonts.googleapis.com/css?family=Lato');
@import url('https://fonts.googleapis.com/css?family=Montserrat');
@import url('https://fonts.googleapis.com/css?family=Abel');

.navbar{
  width: 100%;
}

ul {
    font-family: 'Montserrat', sans-serif;
    list-style-type: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: #333;
}

li {
    float: left;
}

li a {
    display: block;
    color: white;
    text-align: center;
    padding: 14px 16px;
    text-decoration: none;
}

li a:hover {
    background-color: #111;
}

.name {
  float: right;
}

.name a:hover {
  background-color: red;
}

p {
  float: right;
  color: rgba(255 ,255, 255, 0.3);
}

.container {
    display: inline-block;
    cursor: pointer;
    margin-top: 4px;
    margin-right: 10px;
    float: left;
}

.bar1, .bar2, .bar3 {
    
    width: 35px;
    height: 5px;
    background-color: white;
    margin: 6px 0;
    margin-left: 10px;
    transition: 0.4s;
}

/* Rotate first bar */
.change .bar1 {
    -webkit-transform: rotate(-45deg) translate(-9px, 6px) ;
    transform: rotate(-45deg) translate(-9px, 6px) ;
}

/* Fade out the second bar */
.change .bar2 {
    opacity: 0;
}

/* Rotate last bar */
.change .bar3 {
    -webkit-transform: rotate(45deg) translate(-8px, -8px) ;
    transform: rotate(45deg) translate(-8px, -8px) ;
}


#searchbtn {
    background-color: #333;
    float: right;
    border: none;
    border-radius: 5px;
    color: white;
    padding: 5px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    margin: 4px 2px;
    cursor: pointer;
    -webkit-transition-duration: 0.4s;
    transition-duration: 0.4s;
}

.searchbtn:hover {
  background: rgb(28, 130, 255); /* For browsers that do not support gradients */
    background: -webkit-linear-gradient(rgb(28, 130, 255), rgb(119, 180, 255)); /* For Safari 5.1 to 6.0 */
    background: -o-linear-gradient(rgb(28, 130, 255), rgb(119, 180, 255)); /* For Opera 11.1 to 12.0 */
    background: -moz-linear-gradient(rgb(28, 130, 255), rgb(119, 180, 255)); /* For Firefox 3.6 to 15 */
    background: linear-gradient(rgb(28, 130, 255), rgb(119, 180, 255)); /* Standard syntax (must be last) */
}

#myInput {
    font-family: 'Abel', sans-serif;
    background-color: none;
    background-image: url('/css/searchicon.png'); 
    background-position: center center; 
    background-repeat: no-repeat; 
    width: 100%;  
    font-size: 16px;
    padding: 12px 20px 12px 40px;  
    border: 1px solid #ddd; 
    margin-top: 12px;
    margin-bottom: 12px; 
    position: relative;
   
}

#myUL {
    /* Remove default list styling */
    width: 100%;
    font-family: 'Abel', sans-serif;
    list-style-type: none;
    padding: 0;
    margin: 0;
}

#myUL li a {
    border: 1px solid #ddd; /* Add a border to all links */
    margin-top: -1px; /* Prevent double borders */
    background-color: #f6f6f6; /* Grey background color */
    padding: 12px; /* Add some padding */
    text-decoration: none; /* Remove default text underline */
    font-size: 18px; /* Increase the font-size */
    color: black; /* Add a black text color */
    display: block; /* Make it into a block element to fill the whole list */
}

#myUL li a.header {
    background-color: #e2e2e2; /* Add a darker background color for headers */
    cursor: default; /* Change cursor style */
}

#myUL li a:hover:not(.header) {
    background-color: #eee; /* Add a hover effect to all links, except for headers */
}

#search-list {
  box-sizing: border-box;
  background-color: none;
  width: 100%;
  position: center center;
  margin: 0px;
}

body {
  background-color: rgb(72, 0, 124);       
    background: -webkit-linear-gradient(180deg, rgb(72, 0, 124), rgba(255, 175, 223, 0)); 
    background: -o-linear-gradient(180deg, rgb(72, 0, 124), rgba(255, 175, 223, 0)); 
    background: -moz-linear-gradient(180deg, rgb(72, 0, 124), rgba(255, 175, 223, 0)); 
    background: linear-gradient(180deg, rgb(72, 0, 124), rgba(255, 175, 223, 0));
    /* background-image: url("http://powerful-machine.com/wp-content/uploads/2015/05/Tesla-cars.jpg"); */;  
  margin: 0;
  padding: 0;
}

.header {
    background-color: none;
    background-position: center center;
    background-size: cover;
    height: 400px;
    width: 100%;
}

#header-text {
  margin: 0 auto;
  position: relative;
  text-align: center;
  top: 25%;
  width: 60%;
}

.tooltip {
    color: #FFF;
    font-family: 'Open Sans', sans-serif;
    text-align: center;
    font-size: 28px;
    font-weight: 100;
    position: relative;
    display: inline-block;
    border-bottom: 1px dotted black;
}

.tooltiptext {
  color: #FFF;
  font-family: 'Open Sans', sans-serif;
  text-align: center;
  font-size: 15px;
  font-weight: 200;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: rgba(0, 0, 0, 0.75);
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px 0;
    
    /* Position the tooltip */
    position: absolute;
    z-index: 1;
    top: 100%;
    left: 50%;
    margin-left: -60px;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
}

h1 {
  color: rgba(255, 255, 255, 0.75);
  font-family: 'Quicksand', sans-serif;
  font-size: 90px;
  font-weight: 100;
  line-height: 60px;
  margin: 0;
}

h2 {
  color: #FFF;
  font-family: 'Open Sans', sans-serif;
  text-align: center;
  font-size: 28px;
  font-weight: 100;
}

.information {
font-family: 'Lato', sans-serif;
    -webkit-column-count: 3;
    -webkit-column-gap: 40px;
    -webkit-column-rule-style: outset;
    -webkit-column-rule-color: rgba(81, 67, 76, 0.6);

    -moz-column-count: 3;
    -moz-column-gap: 40px;
    -moz-column-rule-style: outset;
    -moz-column-rule-color: rgba(81, 67, 76, 0.6);

    column-count: 3;
    column-gap: 40px;
    column-rule-style: outset;
    column-rule-color: rgba(81, 67, 76, 0.6);
    margin-left: 20px;
    margin-right: 20px;
}

#Oszilloskop {
    box-shadow: 10px 10px 5px grey;
    border-color: black;
    border-width: 5px;
    border-radius: 10px;
    margin-top: 2%;
    margin-left: 2%;
    background-position: left;
    float: left;
    background-size: cover;
    height: 50%;
    width: 40%;
}

.text-oszilloskop {
  font-family: 'Lato', sans-serif;
  padding-left: 5px;
  color: white;
  float:right;
  margin-top: 5px;
  width: 50%;
  padding: 10px;
  outline-style: solid;
  background-color: #3e3647;
}

iframe {
  float: right;
  margin-right: 25px;
  padding-left: 25px;
  width: 100%;
  height: 500px;
}




/*Downloaded from https://www.codeseek.co/MGK_888/informatik2-mOZdev */
function myFunction() {
    var x = document.getElementById('m');
    if (x.style.display === 'none') {
        x.style.display = 'block';
    } else {
        x.style.display = 'none';
    }
}


function myFunction1() {
    var x = document.getElementById('search-list');
    if (x.style.display === 'none') {
        x.style.display = 'block';
    } else {
        x.style.display = 'none';
    }
}



function myFunction2() {
    // Declare variables
    var input, filter, ul, li, a, i;
    input = document.getElementById('myInput');
    filter = input.value.toUpperCase();
    ul = document.getElementById("myUL");
    li = ul.getElementsByTagName('li');

    // Loop through all list items, and hide those who don't match the search query
    for (i = 0; i < li.length; i++) {
        a = li[i].getElementsByTagName("a")[0];
        if (a.innerHTML.toUpperCase().indexOf(filter) > -1) {
            li[i].style.display = "";
        } else {
            li[i].style.display = "none";
        }
    }
}



function myFunction3(x) {
    x.classList.toggle("change");
}

Comments