HTML preprocessors can make writing HTML more powerful or convenient. For instance, Markdown is designed to be easier to write and read for text documents and you could write a loop in Pug.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. So you don't have access to higher-up elements like the <html>
tag. If you want to add classes there that can affect the whole document, this is the place to do it.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. If you need things in the <head>
of the document, put that code here.
The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https.
CSS preprocessors help make authoring CSS easier. All of them offer things like variables and mixins to provide convenient abstractions.
It's a common practice to apply CSS to a page that styles elements such that they are consistent across all browsers. We offer two of the most popular choices: normalize.css and a reset. Or, choose Neither and nothing will be applied.
To get the best cross-browser support, it is a common practice to apply vendor prefixes to CSS properties and values that require them to work. For instance -webkit-
or -moz-
.
We offer two popular choices: Autoprefixer (which processes your CSS server-side) and -prefix-free (which applies prefixes via a script, client-side).
Any URLs added here will be added as <link>
s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.
You can apply CSS to your Pen from any stylesheet on the web. Just put a URL to it here and we'll apply it, in the order you have them, before the CSS in the Pen itself.
You can also link to another Pen here (use the .css
URL Extension) and we'll pull the CSS from that Pen and include it. If it's using a matching preprocessor, use the appropriate URL Extension and we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
JavaScript preprocessors can help make authoring JavaScript easier and more convenient.
Babel includes JSX processing.
Any URL's added here will be added as <script>
s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
Search for and use JavaScript packages from npm here. By selecting a package, an import
statement will be added to the top of the JavaScript editor for this package.
Using packages here is powered by esm.sh, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ESM usage.
All packages are different, so refer to their docs for how they work.
If you're using React / ReactDOM, make sure to turn on Babel for the JSX processing.
If active, Pens will autosave every 30 seconds after being saved once.
If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.
If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.
Visit your global Editor Settings.
<!-- Cagla Bacaksiz (1315979) -->
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>University of Applied Sciences and Arts</title>
</head>
<!-- JavaScript Library -->
<script src="js/jquery.js"></script>
<link href="http://fonts.googleapis.com/css?family=Roboto+Slab:300" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="layout.css">
<link rel="shortcut icon" href="bilder/favicon.ico" type="image/x-png" />
<body>
<!--#####################################################################################################-->
<!-- NAVIGATION -->
<div id="navigation" class="nav">
<a href="javascript:void(0)" class="button_close" onclick="closeNav()">×</a>
<!-- javascript:void()
The void operator evaluates the given expression and then returns undefined.
The void operator is often used merely to obtain the undefined primitive value,
usually using “void(0)” (which is equivalent to “void 0”).
In these cases, the global variable undefined can be used instead (assuming it
has not been assigned to a non-default value).
-->
<a href="#section1">Welcome</a>
<a href="#section2">Information</a>
</div>
<div id="button" onclick="openNav()">☰</div>
<!--#######################################################################################################-->
<!-- SECTION 1 -->
<section id="section1" class="scroll">
<div id="layer_1" class="img-parallax"></div>
<div id="layer_2" class="img-parallax"></div>
<ul class="fly-in-text hidden">
<li>W</li>
<li>E</li>
<li>L</li>
<li>C</li>
<li>O</li>
<li>M</li>
<li>E</li>
<br></br>
<li>E</li>
<li>X</li>
<li>C</li>
<li>H</li>
<li>A</li>
<li>N</li>
<li>G</li>
<li>E</li>
<br></br>
<li>S</li>
<li>T</li>
<li>U</li>
<li>D</li>
<li>E</li>
<li>N</li>
<li>T</li>
<li>S</li>
</ul>
</section>
<!-- External Integration of section1.js -->
<script src="js/section1.js"></script>
<!--#######################################################################################################-->
<!-- SECTION 2 -->
<section id="section2" class="scroll">
<div class="slideshow-container">
<div class="mySlides fade">
<img src="bilder/1.jpg" style="height: 100%; width: 100%;">
</div>
<div class="mySlides fade">
<img src="bilder/2.jpg" style="height: 100%; width: 100%;">
</div>
<div class="mySlides fade">
<img src="bilder/3.jpg" style="height: 100%; width: 100%;">
</div>
<a class="prev" onclick="plusSlides(-1)">❮</a>
<a class="next" onclick="plusSlides(1)">❯</a>
</div>
</section>
<!--########################################################################################################-->
<!-- External Integration of JS Data and JS Libraries -->
<script src="js/jquery.waypoints.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script src="js/menu.js"></script>
<script src="js/scroll.js"></script>
<script src="js/section2.js"></script>
</body>
</html>
/* Cagla Bacaksiz (1315979) */
/****************************************************************************************************************************************************/
/* General Styles */
/****************************************************************************************************************************************************/
body,html {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
background: #2A4A69;
font-family: 'Roboto Slab', serif;
}
.scroll {
width: 100%;
height: 100%;
float: left;
position: relative;
}
/****************************************************************************************************************************************************/
/* Navigation */
/****************************************************************************************************************************************************/
.nav {
height: 100%;
width: 0;
position: fixed;
z-index: 1;
top: 0;
left: 0;
background-color: rgba(255,255,255, 0.9);
overflow-x: hidden;
padding-top: 60px;
transition: 0.5s;
}
#button {
font-size: 40px;
cursor: pointer;
margin-left: 10px;
z-index: 50;
position: fixed;
color: rgba(255,255,255, 0.6);
}
.nav .button_close {
position: absolute;
top: -15px;
right: 25px;
font-size: 40px;
margin-left: 50px;
}
.nav a {
padding: 8px 8px 8px 32px;
text-decoration: none;
font-size: 25px;
color: #818181;
display: block;
transition: 0.3s;
}
.nav a:hover, .offcanvas a:focus {
color: #ff9966;
}
/****************************************************************************************************************************************************/
/* Section 1 */
/****************************************************************************************************************************************************/
#section1 {
background: url(bilder/layer0.jpg);
background-position: center center;
background-size: cover;
}
#section1 ul {
text-align: center;
font-size: 1vw;
}
.img-parallax {
position: fixed;
width: 100%;
height: 100%;
}
#layer_1 {
background: url(bilder/layer1.png) no-repeat;
background-position: center center;
background-size: cover;
}
#layer_2 {
background: url(bilder/layer2.png) no-repeat;
background-position: center center;
background-size: cover;
}
.fly-in-text {
list-style: none;
position: absolute;
left: 50%;
top: 40%;
transform: translateX(-50%) translateY(-50%);
}
.fly-in-text li {
display: inline-block;
margin-right: 30px;
font-family: Open Sans, Arial;
font-weight: 300;
font-size: 4em;
color: #fff;
opacity: 1;
transition: all 2.5s ease;
}
.fly-in-text li:last-child {
margin-right: 0;
}
.fly-in-text.hidden li {
opacity: 0;
}
.fly-in-text.hidden li:nth-child(1) {transform: translateX(-200px) translateY(150px); }
.fly-in-text.hidden li:nth-child(2) {transform: translateX(150px) translateY(-200px); }
.fly-in-text.hidden li:nth-child(3) {transform: translateX(-200px) translateY(150px); }
.fly-in-text.hidden li:nth-child(4) {transform: translateX(150px) translateY(-200px); }
.fly-in-text.hidden li:nth-child(5) {transform: translateX(-200px) translateY(150px); }
.fly-in-text.hidden li:nth-child(6) {transform: translateX(150px) translateY(-200px); }
.fly-in-text.hidden li:nth-child(7) {transform: translateX(-200px) translateY(150px); }
.fly-in-text.hidden li:nth-child(8) {transform: translateX(0px) translateY(-200px); }
.fly-in-text.hidden li:nth-child(9) {transform: translateX(-200px) translateY(0px); }
.fly-in-text.hidden li:nth-child(10){transform: translateX(0px) translateY(-200px); }
.fly-in-text.hidden li:nth-child(11){transform: translateX(-200px) translateY(0px); }
.fly-in-text.hidden li:nth-child(12){transform: translateX(0px) translateY(-200px); }
.fly-in-text.hidden li:nth-child(13){transform: translateX(-200px) translateY(0px); }
.fly-in-text.hidden li:nth-child(14){transform: translateX(0px) translateY(-200px); }
.fly-in-text.hidden li:nth-child(15){transform: translateX(-200px) translateY(0px); }
.fly-in-text.hidden li:nth-child(16){transform: translateX(0px) translateY(-200px); }
.fly-in-text.hidden li:nth-child(17){transform: translateX(-200px) translateY(0px);}
.fly-in-text.hidden li:nth-child(18){transform: translateX(0px) translateY(-200px); }
/****************************************************************************************************************************************************/
/* Section 2 */
/****************************************************************************************************************************************************/
#section2 {
background: #ff9966;
background-repeat: no-repeat;
background-position: top;
background-size: 80vw;
}
/****************************************************************************************************************************************************/
/* Section 2 */
/****************************************************************************************************************************************************/
#section2 {
background: #ff9966;
}
.slideshow-container {
max-width: 100vw;
max-height: 100vw;
position: relative;
margin: auto;
opacity: 0.8;
}
.slideshow-container img {
height: 100vw;
width: 100vw;
}
.prev, .next {
cursor: pointer;
position: absolute;
top: 20vw;
padding: 16px;
color: white;
font-weight: bold;
font-size: 3vw;
transition: 0.6s ease;
border-radius: 0 3px 3px 0;
}
.next {
right: 0;
border-radius: 3px 0 0 3px;
}
.prev:hover, .next:hover {
font-size: 4vw;
}
.active, .dot:hover {
background-color: #717171;
}
.fade {
-webkit-animation-name: fade; /* Browser Support für die Fading-Animation */
-webkit-animation-duration: 1.5s; /* Browser Support für die Fading-Dauer */
animation-name: fade; /* Fading-Animation */
animation-duration: 1.5s; /* Fading-Dauer */
}
@-webkit-keyframes fade {
from {opacity: .4}
to {opacity: 1}
}
@keyframes fade {
from {opacity: .4}
to {opacity: 1}
}
// Cagla Bacaksiz (1315979)
// ########################################################################################################
// Section 1
// ########################################################################################################
// Parallax effect - Mountains and Sky
// Source: https://www.youtube.com/watch?v=ivfnUiCVnBU&t=3s
function parallax(){
var layer_1 = document.getElementById('layer_1');
var layer_2 = document.getElementById('layer_2');
layer_1.style.top = -(window.pageYOffset / 3) + 'px';
layer_2.style.top = -(window.pageYOffset / 3) + 'px';
}
window.addEventListener("scroll", parallax, false);
// Explanation:
// - pageYOffset - pixels the current document has been scrolled from upper left corner of window vertically
// - negative pageYOffset so the layers go up
// - we used photoshop to have the two layers for our background here
// - Add an event listener that works when a user scrolls the website
// ########################################################################################################
// Text Animation
// Source: https://www.youtube.com/watch?v=QZpZ1zRcR6c
$(function(){
setTimeout(function(){
$(".fly-in-text").removeClass("hidden");
}, 400);
})();
// Explanation:
// - has a $-sign because we use jquery for the 'animation'
// - remove class from fly-in-text
// - setTimeout() method calls a function or evaluates an expression after 400 milliseconds
Also see: Tab Triggers