• Jetzt anmelden. Es dauert nur 2 Minuten und ist kostenlos!

Logo Erscheinen lassen

Xcheta

Neues Mitglied
Hi leute ich suche jetzt schon länger ne möglichkeit ein Logo bzw. ein Text erscheinen zu lassen. Er soll nach dem anklicken der Startseite nach ca 5. langsam erscheinen also erst ganz "leicht sichtbar" und dann eben am schluss "mit vollen farben". Kann man so etwas in CSS realisieren oder sollte man eher auf etwas anderes zurückgreifen ?
 
Werbung:
Dazu kannst du keyframes und JavaScript nutzen:
Edit: mach ich gleich ^^
Edit 2: Wörter und so

HTML:
<div class="box"></div>

CSS:
Der Name deines keyframes musst dann in der hinzuzufügenden Klasse als Name aufgezählt werden.
Code:
.box {
    opacity: 0;
    width: 150px;
    height: 150px;
    background: gray;
}

@-webkit-keyframes blender { 
    from  { opacity: 0; }
      to  { opacity: 1; }
}

.blend {
    opacity: 1;
 
    -webkit-animation-name: blender;
    -webkit-animation-duration: 1s;
    -webkit-animation-timing-function: linear; 
    -webkit-animation-delay:  5s; 
    -webkit-animation-iteration-count: 1;
}

JavaScript (dafür brauchst du jQuery so wie ich es gemacht habe, aber eigentlich geht es nur darum die Klasse hinzuzufügen).
Code:
(function($, window, document) {
    $(function() {
        $('html').on({
            "click": function() {
                $('.box').addClass('blend');
            }
        });
    });
}(window.jQuery, window, document));
 
Zuletzt bearbeitet:
Edit: mach ich gleich ^^
Edit 2: Wörter und so
rofl...


Keyframes kenn ich noch gar nicht. Sieht sehr proprietär aus. Heutzutage gibts dafür doch transitions. Belehr mich wenn ich irre :)

Code:
.box {
    opacity: 0;
    width: 150px;
    height: 150px;
    background: gray;
    transition: all 0.4s ease-out;
}

.box.blend {
     opacity: 1;
}

Wenn mans noch abwärtskompatibler braucht:

Code:
    -webkit-transition: all 0.4s ease-out;
    -moz-transition: all 0.4s ease-out;
    -ms-transition: all 0.4s ease-out;
    -o-transition: all 0.4s ease-out;
    transition: all 0.4s ease-out;
 
Werbung:
rofl...


Keyframes kenn ich noch gar nicht. Sieht sehr proprietär aus. Heutzutage gibts dafür doch transitions. Belehr mich wenn ich irre :)

Code:
.box {
    opacity: 0;
    width: 150px;
    height: 150px;
    background: gray;
    transition: all 0.4s ease-out;
}

.box.blend {
     opacity: 1;
}

Wenn mans noch abwärtskompatibler braucht:

Code:
    -webkit-transition: all 0.4s ease-out;
    -moz-transition: all 0.4s ease-out;
    -ms-transition: all 0.4s ease-out;
    -o-transition: all 0.4s ease-out;
    transition: all 0.4s ease-out;

Nene, das ist schon Zukunft.
Mach das mal mit transitions:
http://tobiasahlin.com/spinkit/
 
Zuletzt bearbeitet:
Werbung:
Zurück
Oben