06 1 / 2012

Lock Screen Button

- (TTStyle*)lockButtonIcon:(UIControlState)state {
    return [TTImageStyle styleWithImageURL:nil defaultImage:nil contentMode:UIViewContentModeScaleAspectFill size:CGSizeMake(24, 24) next:
            [TTBoxStyle styleWithMargin:UIEdgeInsetsMake(13, -10, 0, 0) next:nil]];
}

- (TTStyle*)lockButton:(UIControlState)state {
    TTStyle *style;
    if (state == UIControlStateNormal) {
        style = [TTInsetStyle styleWithInset:UIEdgeInsetsMake(0, 0, 25, 0) next:
                 [TTLinearGradientFillStyle styleWithColor1:RGBACOLOR(255, 255, 255, 0.2) color2:RGBACOLOR(255, 255, 255, 0) next:
                  [TTFourBorderStyle styleWithTop:RGBACOLOR(255, 255, 255, 0.2) right:nil bottom:nil left:nil width:1 next:
                   [TTPartStyle styleWithName:@"image" style:TTSTYLESTATE(lockButtonIcon:, state) next:
                    nil]]]];
    } else if (state == UIControlStateHighlighted) {
        style = [TTInsetStyle styleWithInset:UIEdgeInsetsMake(0, 0, 25, 0) next:
                 [TTLinearGradientFillStyle styleWithColor1:RGBACOLOR(255, 255, 255, 0.1) color2:RGBACOLOR(255, 255, 255, 0) next:
                  [TTPartStyle styleWithName:@"image" style:TTSTYLESTATE(lockButtonIcon:, state) next:
                   nil]]];
    }
    
    return [TTShapeStyle styleWithShape:[TTRoundedRectangleShape shapeWithRadius:10] next:
            [TTSolidBorderStyle styleWithColor:RGBACOLOR(255, 255, 255, 0.2) width:1 next:
             [TTSolidBorderStyle styleWithColor:RGBCOLOR(17, 17, 17) width:2 next:
              [TTShapeStyle styleWithShape:[TTRoundedRectangleShape shapeWithRadius:8] next:
               [TTSolidFillStyle styleWithColor:RGBACOLOR(20, 20, 20, 0.8) next:
                style]]]]];
}
Note: button should be 50x50 px

06 1 / 2012

Lock Screen Gloss Bottom Bar

- (TTStyle*)lockBottomBar {
    return [TTLinearGradientFillStyle styleWithColor1:RGBACOLOR(0, 0, 0, 0) color2:RGBACOLOR(0, 0, 0, 0.8) next:
            [TTInsetStyle styleWithInset:UIEdgeInsetsMake(300, 0, 0, 0) next:
             [TTLinearGradientFillStyle styleWithColor1:RGBACOLOR(0, 0, 0, 0.5) color2:RGBACOLOR(0, 0, 0, 0.6) next:
              [TTInsetStyle styleWithInset:UIEdgeInsetsMake(1, 0, 0, 0) next:
               [TTFourBorderStyle styleWithTop:RGBACOLOR(255, 255, 255, 0.4) right:nil bottom:RGBACOLOR(255, 255, 255, 0.2) left:nil width:1 next:
                [TTInsetStyle styleWithInset:UIEdgeInsetsMake(0, 0, 50, 0) next:
                 [TTLinearGradientFillStyle styleWithColor1:RGBACOLOR(255, 255, 255, 0.25) color2:RGBACOLOR(255, 255, 255, 0.2) next:
                  nil]]]]]]];
}
Note: bar frame height should be 400px

06 1 / 2012

Lock Screen Gloss Top Bar

- (TTStyle*)lockTopBar {
    return [TTLinearGradientFillStyle styleWithColor1:RGBACOLOR(0, 0, 0, 0.5) color2:RGBACOLOR(0, 0, 0, 0.6) next:
            [TTInsetStyle styleWithInset:UIEdgeInsetsMake(0, 0, 1, 0) next:
             [TTFourBorderStyle styleWithTop:RGBACOLOR(255, 255, 255, 0.4) right:nil bottom:RGBACOLOR(255, 255, 255, 0.2) left:nil width:1 next:
              [TTInsetStyle styleWithInset:UIEdgeInsetsMake(0, 0, 50, 0) next:
               [TTLinearGradientFillStyle styleWithColor1:RGBACOLOR(255, 255, 255, 0.25) color2:RGBACOLOR(255, 255, 255, 0.2) next:
                nil]]]]];
}

04 1 / 2012

Green Pill

- (TTStyle*)greenPillButton:(UIControlState)state {
    UIColor *color1;
    UIColor *color2;
    
    if (state == UIControlStateNormal) {
        color1 = RGBCOLOR(179, 196, 160);
        color2 = RGBCOLOR(102, 154, 25);
    } else if (state == UIControlStateHighlighted) {
        color1 = RGBCOLOR(99, 107, 89);
        color2 = RGBCOLOR(57, 86, 22);
    }
    
    return
        [TTShapeStyle styleWithShape:[TTRoundedRectangleShape shapeWithRadius:8] next:
         [TTLinearGradientBorderStyle styleWithColor1:RGBCOLOR(51, 51, 51) color2:RGBCOLOR(124, 124, 124) width:1 next:
          [TTInsetStyle styleWithInset:UIEdgeInsetsMake(3, 3, 3, 3) next:
           [TTShapeStyle styleWithShape:[TTRoundedRectangleShape shapeWithRadius:5] next:
            [TTLinearGradientFillStyle styleWithColor1:color1 color2:color2 next:
             [TTTextStyle styleWithFont:[UIFont boldSystemFontOfSize:18] color:RGBCOLOR(255, 255, 255) shadowColor:[UIColor colorWithWhite:0 alpha:0.4] shadowOffset:CGSizeMake(0, -1) next:
              nil]]]]]];
}

Tags:

Permalink 11 notes

03 1 / 2012

Red Inset

- (TTStyle*)insetSquare{
  return [TTShapeStyle styleWithShape:[TTRoundedRectangleShape shapeWithRadius:8] next:
  [TTLinearGradientFillStyle styleWithColor1:RGBCOLOR(218, 0, 0) color2:RGBCOLOR(140, 0, 0) next:
  [TTInnerShadowStyle styleWithColor:RGBCOLOR(104, 2, 2) blur:3 offset:CGSizeMake(0, 1) next:nil]]];
}

(Source: twocentstudios.com)

03 1 / 2012

Error Bubble

- (TTStyle*)errorBubbleAbove:(UIControlState)state {
    return [self errorBubbleForState:state atLocation:270];
}

- (TTStyle*)errorBubbleBelow:(UIControlState)state {
    return [self errorBubbleForState:state atLocation:90];    
}

- (TTStyle*)errorBubbleForState:(UIControlState)state atLocation:(int)location{
    UIColor* tintColor;
    if (state == UIControlStateNormal) {
        tintColor = RGBCOLOR(220, 53, 34);
    } else {
        tintColor = RGBCOLOR(220, 53, 34);
    }
    UIEdgeInsets insets;
    if (location == 90) {
        insets = UIEdgeInsetsMake(14, 8, 4, 8);
    } else {
        insets = UIEdgeInsetsMake(4, 8, 14, 8);
    }
    
    UIColor* stateTextColor = [TTSTYLESHEET toolbarButtonTextColorForState:state];
    
    return [TTShapeStyle styleWithShape:[TTSpeechBubbleShape shapeWithRadius:5 pointLocation:location
                                                                  pointAngle:location
                                                                   pointSize:CGSizeMake(20,10)] next:
            [TTSolidFillStyle styleWithColor:tintColor next:
            [TTBoxStyle styleWithPadding:insets next:
            [TTTextStyle styleWithFont:[UIFont systemFontOfSize:12]
                                 color:stateTextColor shadowColor:[UIColor colorWithWhite:0 alpha:0.2]
                          shadowOffset:CGSizeMake(0, -1) next:nil]]]];
}

Tags:

Permalink 3 notes

03 1 / 2012

Disclosure Button

- (TTStyle*)disclosureIcon:(UIControlState)state {
    CGFloat scale = [[UIScreen mainScreen] scale];
    return [TTImageStyle styleWithImageURL:nil defaultImage:nil contentMode:UIViewContentModeScaleAspectFill size:CGSizeMake(20 * scale, 20 * scale) next:
           [TTBoxStyle styleWithMargin:UIEdgeInsetsMake(18 - (10 * scale), 290 - (10 * scale), 0, 0) next:nil]];
}

- (TTStyle*)disclosureButton:(UIControlState)state {
    UIColor* tintColor;
    if (state == UIControlStateNormal) {
        tintColor = RGBCOLOR(237, 233, 222);
    } else {
        tintColor = RGBCOLOR(186, 183, 174);
    }
    
    UIColor* stateTextColor = RGBCOLOR(30, 30, 32);
    CGFloat scale = [[UIScreen mainScreen] scale];
    
    return [TTShapeStyle styleWithShape:[TTRectangleShape shape] next:
           [TTSolidFillStyle styleWithColor:tintColor next:
           [TTBoxStyle styleWithPadding:UIEdgeInsetsMake(8, 20 - (20 * scale), 8, 8) next:
           [TTSolidBorderStyle styleWithColor:RGBCOLOR(206, 203, 194) width:1 next:

           [TTTextStyle styleWithFont:[UIFont boldSystemFontOfSize:16]
                                color:stateTextColor
                      minimumFontSize:0
                          shadowColor:[UIColor colorWithWhite:0 alpha:0.2]
                         shadowOffset:CGSizeMake(0, -1)
                        textAlignment:UITextAlignmentLeft
                    verticalAlignment:UIControlContentVerticalAlignmentCenter
                        lineBreakMode:UILineBreakModeWordWrap
                        numberOfLines:1
                                 next:
           [TTPartStyle styleWithName:@"image" style:TTSTYLESTATE(disclosureIcon:, state) next: nil
           ]]]]]];
}

Tags:

Permalink 4 notes

03 1 / 2012

Flat Silver

- (TTStyle*)flatSilverButtonIcon:(UIControlState)state {
    
    return [TTImageStyle styleWithImageURL:nil defaultImage:nil contentMode:UIViewContentModeScaleAspectFill size:CGSizeMake(32, 32) next:
            [TTBoxStyle styleWithMargin:UIEdgeInsetsMake(3, 8, 0, 0) next:nil]];
}

- (TTStyle*)flatSilverButton:(UIControlState)state {
    UIColor *color1;
    UIColor *color2;
    UIColor *text = RGBCOLOR(51, 51, 51);
                               
    if (state == UIControlStateNormal) {
        color1 = RGBCOLOR(254, 254, 254);
        color2 = RGBCOLOR(200, 200, 200);
    } else if (state == UIControlStateHighlighted) {
        color1 = RGBCOLOR(200, 200, 200);
        color2 = RGBCOLOR(254, 254, 254);
    }
    
    return [TTShapeStyle styleWithShape:[TTRectangleShape shape] next:
            [TTFourBorderStyle styleWithTop:RGBCOLOR(168, 168, 168) width:1 next:
            [TTLinearGradientFillStyle styleWithColor1:color1 color2:color2 next:
             [TTBoxStyle styleWithPadding:UIEdgeInsetsMake(8, 24, 8, 8) next:
              [TTTextStyle styleWithFont:[UIFont boldSystemFontOfSize:20]
                                   color:text textAlignment:UITextAlignmentLeft next:
               [TTPartStyle styleWithName:@"image" style:TTSTYLESTATE(flatSilverButtonIcon:, state) next: nil
               ]]]]]];
}

Tags:

Permalink 2 notes

03 1 / 2012

TTCatalog: Inner Shadow

- (TTStyle*)innerShadow:(UIControlState)state {
    return
        [TTShapeStyle styleWithShape:[TTRoundedRectangleShape shapeWithRadius:10] next:
         [TTSolidFillStyle styleWithColor:[UIColor whiteColor] next:
          [TTInnerShadowStyle styleWithColor:RGBACOLOR(0,0,0,0.5) blur:6 offset:CGSizeMake(1, 1) next:
           [TTSolidBorderStyle styleWithColor:RGBCOLOR(0, 0, 0) width:1 next:nil]]]];
}

03 1 / 2012

TTCatalog: Embossed Button

- (TTStyle*)embossedButton:(UIControlState)state {
    if (state == UIControlStateNormal) {
        return
            [TTShapeStyle styleWithShape:[TTRoundedRectangleShape shapeWithRadius:8] next:
            [TTInsetStyle styleWithInset:UIEdgeInsetsMake(0, 0, 1, 0) next:
            [TTShadowStyle styleWithColor:RGBACOLOR(255,255,255,0) blur:1 offset:CGSizeMake(0, 1) next:
            [TTLinearGradientFillStyle styleWithColor1:RGBCOLOR(255, 255, 255)
                                       color2:RGBCOLOR(216, 221, 231) next:
            [TTSolidBorderStyle styleWithColor:RGBCOLOR(161, 167, 178) width:1 next:
            [TTBoxStyle styleWithPadding:UIEdgeInsetsMake(10, 12, 9, 12) next:
            [TTTextStyle styleWithFont:nil color:TTSTYLEVAR(linkTextColor)
                         shadowColor:[UIColor colorWithWhite:255 alpha:0.4]
                         shadowOffset:CGSizeMake(0, -1) next:nil]]]]]]];
    } else if (state == UIControlStateHighlighted) {
        return
            [TTShapeStyle styleWithShape:[TTRoundedRectangleShape shapeWithRadius:8] next:
            [TTInsetStyle styleWithInset:UIEdgeInsetsMake(0, 0, 1, 0) next:
            [TTShadowStyle styleWithColor:RGBACOLOR(255,255,255,0.9) blur:1 offset:CGSizeMake(0, 1) next:
            [TTLinearGradientFillStyle styleWithColor1:RGBCOLOR(225, 225, 225)
                                     color2:RGBCOLOR(196, 201, 221) next:
            [TTSolidBorderStyle styleWithColor:RGBCOLOR(161, 167, 178) width:1 next:
            [TTBoxStyle styleWithPadding:UIEdgeInsetsMake(10, 12, 9, 12) next:
            [TTTextStyle styleWithFont:nil color:[UIColor whiteColor]
                       shadowColor:[UIColor colorWithWhite:255 alpha:0.4]
                       shadowOffset:CGSizeMake(0, -1) next:nil]]]]]]];
    } else {
        return nil;
    }
}