Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <h2>Since you ask for alternatives to jQuery solutions</h2> <p>You could play a little with <code>margins</code> and <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/box-shadow"><code>box-shadow</code></a> and keyframe animations.</p> <p>Something in this direction for the shape (depends on what you want to do with which part - add content ... and in what way you want it to be responsive):</p> <p><strong>html:</strong></p> <pre><code>&lt;div class="wrapper"&gt; &lt;div class="header"&gt;&lt;img src="http://i.imgur.com/CUbOIxr.png" alt="Company name" /&gt;&lt;/div&gt; &lt;div class="content"&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p><strong>CSS:</strong></p> <pre><code>body { background:orange; width:100%; height:100%; } .wrapper { width:40%; height:90%; border:30px solid #000; border-right-width:100px; border-bottom-width:100px; } .header { width:100%; border-bottom:10px solid transparent; -webkit-box-shadow: 0 30px 0 #000; -moz-box-shadow: 0 30px 0 #000; box-shadow: 0 30px 0 #000; } .header img { width:100%; } .content { width:95%; height:400px; background-color:#000; margin-top:30px; } </code></pre> <p><a href="http://jsfiddle.net/KZfd7/2/"><strong>DEMO</strong></a></p> <p>This way no javascript is needed. And for the background you can use a <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/linear-gradient"><strong>linear gradient</strong></a> and do all animations with css <a href="https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Using_CSS_transitions"><strong>transitions</strong></a> or <a href="https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Using_CSS_animations"><strong>keyframe animations</strong></a>. You also need to play with the lengths and adjust the borders and box-shadows to your needs, maybe add some @media queries for the <a href="http://alistapart.com/article/responsive-web-design"><strong>responsiveness</strong></a>.</p> <p>Hope this helps you a little in the right direction =)</p> <hr> <h2>Update:</h2> <p>I hoped the gradients changing was the smaller problem ;-) Silly me, sorry.</p> <p>I will elaborate my CSS-only suggestion for the animation, but you can choose a javascript slider for the background animation, if you don't like CSS3 solutions - although this is the hot stuff now ;-)</p> <p>Ok. So, I would add some more fixed positioned elements with gradient backgrounds (layer1 and layer2).</p> <p>To have something in this direction in the <strong>html</strong> now:</p> <pre><code>&lt;div class="layer layer1"&gt;&lt;/div&gt; &lt;div class="layer layer2"&gt;&lt;/div&gt; &lt;div class="wrapper"&gt; &lt;div class="header"&gt; &lt;img src="http://newtpond.com/test/company-name.png" alt="Company name" /&gt; &lt;/div&gt; &lt;div class="content"&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p>and add a keyframe animation on them in <strong>CSS</strong> (here it is just with the -webkit vendor prefix [probably cause I am a lazy bum], but I hope you can get the idea, and could add the others):</p> <pre><code>body { width:100%; height:100%; margin:0; padding:0; } /* for the animation */ .layer { position:fixed; width:100%; height:100%; } @-webkit-keyframes GoLayer1 { 0% { opacity:1; } 50% { opacity:0; } 100% { opacity:1; } } @-webkit-keyframes GoLayer2 { 0% { opacity:0; } 50% { opacity:1; } 100% { opacity:0; } } .layer1 { background: -webkit-linear-gradient(bottom, rgb(43, 70, 94) 29%, rgb(194, 41, 41) 65%, rgb(155, 171, 38) 83%); -webkit-animation: GoLayer1 5s infinite; } .layer2 { background: -webkit-linear-gradient(bottom, rgb(225, 202, 230) 29%, rgb(39, 163, 194) 65%, rgb(36, 124, 171) 83%); -webkit-animation: GoLayer2 5s infinite; } /* the wrapper shape */ .wrapper { z-index:999; opacity:1; position:relative; width:40%; height:90%; border:30px solid #000; border-right-width:100px; border-bottom-width:100px; } .header { width:100%; border-bottom:10px solid transparent; -webkit-box-shadow: 0 30px 0 #000; -moz-box-shadow: 0 30px 0 #000; box-shadow: 0 30px 0 #000; } .header img { width:100%; } .content { width:95%; height:400px; background-color:#000; margin-top:28px; } </code></pre> <p><a href="http://jsfiddle.net/KZfd7/11/"><strong>DEMO</strong></a> (tested in Chrome 26 - looked cool =)</p> <p>This is now where I can point you according this CSS-only approach. There is still stuff to modify and consider browser compatibility. But it is certainly an alternative ... and a step in the direction where html5 and css3 is going (if you want to be hot and cool ;-), hehe, sorry, too much silliness.</p> <p>Good luck!</p> <hr> <h2>Update 2:</h2> <p>So, I overcame my laziness a tiny bit and added some more vendor prefixes to the top example (and of course you can use any image as background):</p> <h2><a href="http://jsfiddle.net/KZfd7/12/">DEMO</a></h2> <p>And here I add another example, that is using a png image for the gradient, and is sliding up and down in the background (as another alternative):</p> <h2><a href="http://jsfiddle.net/KZfd7/9">DEMO</a></h2>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload