-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathButtonImage.page
57 lines (50 loc) · 2.2 KB
/
ButtonImage.page
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<apex:page sidebar="false" showHeader="false"
applyHtmlTag="false" applyBodyTag="false" standardStylesheets="false"
ContentType="image/svg+xml" >
<apex:variable var="textWidth" value="{! 37 + LEN( $CurrentPage.parameters.Text ) * 9 }"/>
<apex:variable var="halfWidth" value="{! textWidth / 2 }"/>
<apex:variable var="buttonColor" value="{!IF( $CurrentPage.parameters.Color = null, 'red', $CurrentPage.parameters.Color )}" />
<apex:variable var="textColor" value="{!IF( $CurrentPage.parameters.fgColor = null, 'white', $CurrentPage.parameters.fgColor )}" />
<svg id="layer_1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
height="40" width="{! textWidth }">
<defs>
<linearGradient id="highlightGradient1" x1="0" x2="0" y1="0" y2="100%" >
<stop offset="0" style="stop-color:#ffffff;stop-opacity:1" />
<stop offset="25%" style="stop-color:#ffffff;stop-opacity:0" />
</linearGradient>
<linearGradient id="shadowGradient1" x1="0" x2="0" y1="0" y2="100%" >
<stop offset="75%" style="stop-color:#000000;stop-opacity:0" />
<stop offset="1" style="stop-color:#000000;stop-opacity:0.25" />
</linearGradient>
</defs>
<rect height="40" ry="20"
id="ButtonBase"
width="{! textWidth }"
style="fill:{! buttonColor };stroke:none">
</rect>
<rect height="40" ry="20" x="3" y="3"
id="ButtonHighlight"
width="{! textWidth - 6 }"
style="fill:url(#highlightGradient1);stroke:none">
</rect>
<rect height="40" ry="20"
id="ButtonShadow"
width="{! textWidth }"
style="fill:url(#shadowGradient1);stroke:none">
</rect>
<text x="{! halfWidth }" y="26.5"
font-family="Verdana" font-weight="bold"
style="text-align:center;text-anchor:middle;"
fill="#000000">
{!$CurrentPage.parameters.Text}
</text>
<text x="{! halfWidth }" y="25"
font-family="Verdana" font-weight="bold"
style="text-align:center;text-anchor:middle;"
fill="{! textColor }">
{!$CurrentPage.parameters.Text}
</text>
</svg>
</apex:page>