OSDN Git Service

[clean] : 無駄なコードを削除
authorhayao <hayao@fascode.net>
Thu, 18 Feb 2021 07:20:40 +0000 (16:20 +0900)
committerhayao <hayao@fascode.net>
Thu, 18 Feb 2021 07:20:40 +0000 (16:20 +0900)
buildmydist-2/index.php
buildmydist-2/script/footerFixed.js.disabled [new file with mode: 0644]
buildmydist-2/script/main.js
buildmydist-2/style/common.css
buildmydist-2/style/sp.css

index d4126da..da08863 100644 (file)
 </head>
 <body>
     <?php include("${commonhtml}/header.php"); ?>
-
     <main>
         <h1>タイトル</h1>
         <p>本文本文本文本文本文本文本文本文本文本文本文</p>
+        a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>v
+        <p>Hello</p>
+        
     </main>
 
     <?php include("${commonhtml}/footer.php"); ?>
diff --git a/buildmydist-2/script/footerFixed.js.disabled b/buildmydist-2/script/footerFixed.js.disabled
new file mode 100644 (file)
index 0000000..3b70e2a
--- /dev/null
@@ -0,0 +1,64 @@
+
+
+new function(){
+    var footer = document.getElementsByTagName("footer")[0];
+    function footerFixed(){
+        footer.style.top = "0px";
+        var ft = footer.offsetTop;
+        var fh = footer.offsetHeight;
+        if (window.innerHeight){
+            var wh = window.innerHeight;
+        }else if(document.documentElement && document.documentElement.clientHeight != 0){
+            var wh = document.documentElement.clientHeight;
+        }
+        if(ft+fh<wh){
+            footer.style.position = "relative";
+            footer.style.top = (wh-fh-ft)+"px";
+        }
+    }
+
+
+    function checkFontSize(func){
+        var e = document.createElement("div");
+        var s = document.createTextNode("S");
+        e.appendChild(s);
+        e.style.visibility="hidden"
+        e.style.position="absolute"
+        e.style.top="0"
+        document.body.appendChild(e);
+        var defHeight = e.offsetHeight;
+
+
+        function checkBoxSize(){
+            if(defHeight != e.offsetHeight){
+                func();
+                defHeight= e.offsetHeight;
+            }
+        }
+        setInterval(checkBoxSize,1000)
+    }
+
+    function addEvent(elm,listener,fn){
+        try{
+            elm.addEventListener(listener,fn,false);
+        }catch(e){
+            elm.attachEvent("on"+listener,fn);
+        }
+    }
+
+       function Run(){
+               checkFontSize(footerFixed);
+               footerFixed();
+       }
+       /*
+    addEvent(window,"load",footerFixed);
+    addEvent(window,"load",function(){
+        checkFontSize(footerFixed);
+    });
+    addEvent(window,"resize",footerFixed);
+       */
+
+       addEvent(window,"load", Run);
+       addEvent(window,"resize", footerFixed);
+
+}
\ No newline at end of file
index 33dc9e6..e69de29 100644 (file)
@@ -1,36 +0,0 @@
-// 高さを設定
-/* 
-function SetMainHeight(){
-    // ヘッダー高さ
-    //HeaderHeight = document.getElementsByTagName("header")[0].clientHeight;
-    var HeaderHeight = $('header').outerHeight(true);
-    //console.log(HeaderHeight);
-
-    // フッター高さ
-    //FooterHeight = document.getElementsByTagName("footer")[0].clientHeight;
-    var FooterHeight = $('footer').outerHeight(true);
-    //console.log(FooterHeight);
-
-    // ウィンドウ高さ
-    var BodyHeight = window.innerHeight;
-    //console.log(BodyHeight);
-
-    // mainのpaddingとmargin
-    var MainMargin = parseFloat($("main").css("margin")) * 2;
-    var MainPadding = parseFloat($("main").css("padding")) * 2;
-
-    // 設定
-    document.getElementsByTagName("main")[0].style.height = BodyHeight - FooterHeight - HeaderHeight - MainMargin - MainPadding + "px";
-}
-*/
-
-function SetMainHeight(){
-    var $ftr = $('footer');
-    if( window.innerHeight > $ftr.offset().top + $ftr.outerHeight() ){
-         //$ftr.attr({'style': 'position:fixed; top:' + (window.innerHeight - $ftr.outerHeight()) + 'px;' });
-         $ftr.css("position", "fixed");
-         $ftr.css("top", (window.innerHeight - $ftr.outerHeight()) + "px" );
-    }
-}
-window.addEventListener("resize", SetMainHeight, false);
-window.addEventListener("load", SetMainHeight, false);
index 3b3d876..5d0a58a 100644 (file)
@@ -12,6 +12,9 @@ header{
 
     /* 文字色 */
     color: var(--white-1);
+
+    /* 高さ */
+    height: 5rem;
 }
 
 * { 
@@ -27,8 +30,8 @@ header{
     cursor: pointer;
 
     /* 左右に空白を作る */
-    padding-left: 2%;
-    padding-right: 2%;
+    padding-left: 0.1%;
+    padding-right: 0.1%;
 
 
     /* 選択を無効化 */
@@ -104,5 +107,6 @@ footer{
     width: 100vw;
     padding-top: 0.3%;
     padding-bottom: 0.3%;
+
 }
 /* === ここまでフッター === */
index 6ab0594..e69de29 100644 (file)
@@ -1,28 +0,0 @@
-/* 横並びを解除して中央に表示 */
-#bar-container{
-    display: initial;
-    text-align: center;
-}
-
-/* ロゴをいっぱいに表示 */
-.bar-logo{
-    width: 100vw;
-}
-
-/* 普段は隠す */
-.bar-item{
-    width: auto;
-    display: none;
-}
-
-/* 説明を消す */
-/*
-.description{
-    display: none;
-}
-*/
-
-/* ロゴがクリックされたときに追加されるclass */
-.show-menu{
-    display: inline-block;
-}