My favorites | Sign in
Project Logo
                
Search
for
Updated May 15, 2008 by Auston.Bunsen
HowTo  
Find out how to do certain things with Safire.

How To

Pretty much everything that you can do with Safire is listed here. Just look for what you want, if you can't find it please E-mail me.

BASICS:

I want to...


HAVE iPHONE STYLE ICONS

Simple -

  1. Get an icon set or use one included in the framework.
  2. Class the unordered list element with a class of "iphone-icons".

For example:

<ul class="iphone-icons">
   <li>
	<a href="#news.php" class="icon" type="news">
		<img src='images/sticker-icons/news.png' width='55'/><span>News</span>
	</a>
  </li>
  <li>
	<a href="#photos.php" class="icon" type="photos">
		<img src='images/sticker-icons/photos.png' width='55'/><span>Photos</span>
	</a>
  </li>
  <li>
	<a href="#video.php" class="icon" type="video">
		<img src='images/sticker-icons/youtube.png' width='55'/><span>Video</span>
	</a>
  </li>
  <li>
	<a href="#settings.php" class="icon" type="settings">
		<img src='images/sticker-icons/settings.png' width='55'/><span>Settings</span>
	</a>
  </li>
</ul>

HAVE iPHONE STYLE LISTS THAT SLIDE

A little more detailed but -

  1. Class your unordered list element with 'list-items'
  2. Class your links with 'list-item'
  3. Set a unique type attribute for every link (this will id your the new div replacing the old one)
  4. Set your href attribute to have a hash that is the location of the content you want to slide in

Example:

<ul class="list-items" id="mixx-news">
  <li>
      <a href="#news.php?id=289629" type="289629" class="list-item">
             <span class="votes">46</span><sup>votes</sup><br>100 Best Travel Journal Blogs
      </a>
  </li>
  <li>
      <a href="#news.php?id=289621" type="289621'" class="list-item">
             <span class="votes">73</span><sup>votes</sup><br>100 Best Jobs for Lazy Bones
      </a>
  </li>
</ul>

HAVE iPHONE STYLE BUTTONS

Requires some CSS knowledge -

  1. Create a custom class (css selector) or use one of our classes for a href
  2. Choose or create your own iPhone button (we have green, red, light gray and dark gray)
  3. Set a '-webkit-border-image' property value of 'url(yourimage.png) 0 12 0 12' for optimal appearance
  4. Set a 'text-shadow' property value of 'yourcolor 0px 1px 1px' for that iphone-ish button text
  5. Set a 'color' property value of 'yourcolor'

Example:

<!--css-->

.submit-button{
  -webkit-border-image: url(images/buttons/lightgrayButton.png) 0 12 0 12 !important;
  text-shadow: #fff 0px 1px 1px !important;
  color: black !important;
}

<!--html-->


<a href="#results.php?re=false" class="submit-button">Search!</a>

LINK TO TELEPHONE NUMBERS

Very Simple -

  1. Output a the phone number like so:
<a href="tel: 9546703289">Call Me</a>

LINK TO YOUTUBE VIDEOS

Little bit harder -

  1. You need the youtube video id (its the 'v' parameter in the url) and then you output like this:
<a href="youtube: v-id">Call Me</a>

INTERMEDIATE:

I want to...


HAVE TABS

CSS Knowledge Required -

  1. Create a parent div with and id of 'nav'
  2. Create child divs with classes of 'tabs' and 'tab-div1', 'tab-div2', etc..
  3. Add an id of 'selected' to the one you want to appear to be selected.
  4. Customize the css for the tabs based on the number of tabs you are using by adding a 'left' property of l = 100% / no. of tabs, incrementally adding l for each tab 'tab-div2' should be 33% & 'tab-div3' should be 66% if there are 3 tabs total.

Code:

<!--CSS-->

#nav div.tabs{
	width: 50% !important;
	position: absolute !important;
}

#nav > div.tab-div2{
	left: 50% !important;
}
	
#nav > div#selected{
	border-top: 5px solid rgba(135,206,250,0.7) !important;
}
	
#nav > div#selected a{
	color: #333333 !important;
	font-weight: bold !important;
}

<!--HTML-->

<div id="nav">
	<div class="tabs tab-div1" id="selected">
		<a href="#search.php" class="tab" type="all">Search</a>
	</div>

	<div class="tabs tab-div2">
		<a href="#history.php" class="tab" type="all">History</a>
	</div>
</div>

HAVE iPHONE OVERLAYS

Easy -

  1. Put 1 div nested inside of another at the bottom of the page, right before the body tag
  2. Class the first div (the parent) with 'overlay' and set style to 'display: none;'
  3. Set the id to something unique
  4. Class the second div (the child) with 'lightbox'
  5. Create a href with a class of 'cancel-button' and make sure it is inside of the second div (the child)
  6. To trigger the showing of the overlay create a href outside of the first div (the parent) and class it with 'overlay-link' and set it's type attribute to be the same as the first div's (the parent's) id attribute.

Example:

<a href="#feedback-overlay" class="overlay-link" type="feedback" selected="button">
Feedback
</a>

<div id="feedback" class="overlay" style="display: none;">
	<div class="lightbox">
		<form method="post">
			<label>Feedback:</label><br/>
			<textarea name="feedback"></textarea>
			<a href="#form.php" class="submit-button" id="greenbutton" callback="alertresponse(response);">Go!</a>
			<a href="#close" class="cancel-button" id="redbutton">Cancel</a>
		</form>
	</div>
</div>

HAVE SUB NAVIGATION

OK.

Example:

<div id="sub-nav">
	<a href="#maps.html" class="sub-nav">Maps</a>
	<a href="#results.php" class="sub-nav">Ads</a>
	<a href="#top10.html" class="sub-nav" id="selected">Top 10</a>
	<a href="#icons.html" class="sub-nav">Icons</a>
</div>

ADVANCED:

I want to...


PROVIDE A CALLBACK FOR MY FORM

Requires Javascript Knowledge -

  1. Create a form element that ONLY contains a method attribute
  2. Place all of your form elements (input, textarea, select, radiobuttons) within that form element
  3. Where you specify your button (as a href), make sure you place an href of the actual form action
  4. Specify a 'callback' attribute which accepts a response argument
  5. Write your your callback.

Here is an example:

<!--Javascript-->

function showResults(html){
	$('stage-mat').innerHTML = html;
}

<!--HTML-->
<form method="post">

	<label>Job Title</label><br/>
	<input type="text" name="job-title" id="job-title" />
	<br/>
	<label>Location</label><br/>
	<input type="text" name="location" id="location" /><br/>

	<a href="#results.php?re=false" class="submit-button" callback="showResults(response);">Search!</a>

</form>

ADD A CALLBACK TO A LINK BEFORE IT GETS A PAGE

This is not possible yet. But you can create an event handler for onclick events. Requires JavaScript knowlege -

  1. Write your callback function
  2. Specify your callback as an onclick event

<li>
  <a href='#results.php?re=true&x=5643' class='list-item' type='5643' onclick='updateHist()'>Ajax / PHP Developer</a>
</li>

HAVE A BACK BUTTON

Coming in the next release of Safire (June 08')

MAKE MY OWN ANIMATIONS

Coming in the next release of Safire (June 08')

HAVE MY OWN CALLBACKS FOR ANY LINK

Coming in the next release of Safire (June 08')


Comment by admin.digitalsoftware, Mar 26, 2009

Is this project still alive? I'm finding it very useful. If you need ANY help developing this project, please do not hesitate. As, I am interested in the same subject, and want to develop an all-purpose framework just for that, but since you already have one, might as well not re-invent the wheel?

Let me know.

Comment by Auston.Bunsen, Mar 26, 2009

Not dead... new release soon.

Comment by romulotr, Jun 24, 2009

Cool! Waiting for news :)


Sign in to add a comment
Hosted by Google Code