|
分類:[.NET 全般]
2014/05/21(Wed) 15:11:00 編集(投稿者)
iPhoneのウィジェットのjavaについてご質問させて頂きます。 時計のウィジェットなんですが、文字の太さを変更したく色々調べてはやってみたのですが全く分かりませんでした…。 どの部分になにを入力すればいいのか教えて頂ければ幸いです。 ちなみに私はjavaの知識はないに等しいのでどうかお手柔らかにお願いします。 環境はHTMLです。
<html>
<head>
<title>Drifters Clock Widget</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script>
function updateClock() {
var currentTime = new Date();
var currentHours = currentTime.getHours();
var currentMinutes = currentTime.getMinutes() < 10 ? '0' + currentTime.getMinutes() : currentTime.getMinutes();
var currentDate = currentTime.getDate() < 10 ? '0' + currentTime.getDate() : currentTime.getDate();
var currentYear = currentTime.getFullYear();
timeOfDay = ( currentHours < 12 ) ? " AM" : " PM";
if (Clock == "24h") {
timeOfDay = "";
currentHours = ( currentHours < 10 ? "0" : "" ) + currentHours;
currentTimeString = currentHours + ":" + currentMinutes;}
if (Clock == "12h") {
currentHours = ( currentHours > 12 ) ? currentHours - 12 : currentHours;
currentHours = ( currentHours == 0 ) ? 12 : currentHours;
currentTimeString = currentHours + ":" + currentMinutes;}
document.getElementById("Timestring").innerHTML = currentHours + ":" + currentMinutes + "<span style='font-size:60%'>" + timeOfDay + "</span>";}
function init(){
updateClock();
setInterval("updateClock();", 1000);}
</script>
<style>
@font-face {font-family: "Algerian"; src: url('Fonts/Algerian.ttf');}
@font-face {font-family: "AmazoneBT"; src: url('Fonts/AmazoneBT.ttf');}
@font-face {font-family: "Bauhaus"; src: url('Fonts/Bauhaus.ttf');}
@font-face {font-family: "Box"; src: url('Fonts/Box.ttf');}
@font-face {font-family: "English"; src: url('Fonts/English.ttf');}
@font-face {font-family: "Founders"; src: url('Fonts/Founders.ttf');}
@font-face {font-family: "LockClock"; src: url('Fonts/LockClock.ttf');}
@font-face {font-family: "SegoeUILight"; src: url('Fonts/SegoeUILight.ttf');}
body {
position:absolute;
width:250px;
height:50px;
top:0px;
left:0px;
margin:0;
padding:0;
line-height:50px;
text-shadow: 0 3px 6px #000, 0 3px 6px #000;}
#Clock{display:none;}
</style>
</head>
<body onload="init()">
<div id="Timestring"></div>
<div id="Clock"></div>
<script>
var span = document.getElementById("Timestring");
span.style.fontSize = (sizevariable) + "px";
span.style.fontFamily = (fontvariable);
span.style.color = (colorvariable);
span.style.textAlign = (alignvariable);
</script>
</body>
</html>
|