2017年8月24日 星期四

[CSS]Flex (Taker course)

https://www.everyonecanwebsite.com/blog/post/flexbox-basic?utm_source=facebook&medium=video-post&utm_content=flexbox

https://www.youtube.com/watch?v=epHSeA7OCZU

取代 flaot的平易近人新屬性,以上課程連結 (Taker)。

display: flex;
設定後除了本身,其所有子元素會自動帶有此屬性,但只限一層,再下去就沒有了。

main axis & cross axis: flex line 與 main axis平行
各自還有 start & end,預設上,寫一個"十"字可以理解。

flex 主要設定方向、寬度、對齊方式


  • flex container
    • about axis
    • about wrap
  • flex item


flex: 0 1 auto; /*defult
flex-grow: 值有(0,1);設定 item是否展開填滿容器,想像為是否要從樹成長成林
flex-shrink: 值有值有(0,1);設定 overflow時是否自動縮小
flex-basis: 單位有(px,%)還可設定為 auto;設定 item的寬度

2017年8月15日 星期二

[Git]完整學會Git GitHub Git Server 的24堂課 Unit.1~Unit.3

Unit. 1

git init

git add 'poem.txt' /* preparing add, can be files or file fold
git status

git commit -m 'description' --author='name <email>' /* acting adding

git commit --amend -m 'new description' --author='(changed) name <email>'
/* modifying description or author name/ email

gitk

exit
----

Unit. 2

git config alias.name 'full commend'

e.g.

git config alias.con 'config -l'

/* then,
/* git con = git config -l
----

Unit. 3

touch .gitignore

2017年8月8日 星期二

[jQM]Udemy Keen Cen 9語言0基礎 #165-#174 流水帳筆記

#168-#169
手機程序型網頁範例
但教學中是直接刪改官方檔案

將 .click 改為 .on("vclick", function())

減少裝置反應延遲

示範不切換網址切換內容頁面
可能會有網址列#1-1改#1-2內容卻沒切換的問題

#170-171
如何將 jQ 製成的程序轉換成不同平台(安卓、蘋果、win...)
由 node.js (網頁服務器)
cordova


2017年8月1日 星期二

[php]Udemy Keen Cen 9語言0基礎 #128-#146 流水帳筆記

#137
php 發送郵件若成功,會回傳 1,表 true

$emailTo="";
$subject="";
$body="";
$headers="";


mail($emailTo, $subject, $body, $headers)

#143-145 天氣預報網站範例
擷取外部網頁特定部分資料

background-position: center;
background-size: cover;

<?php

$city= $_GET['city'];

$city= str_replace(" ", "", $city); // 空格替換成沒有空格,從$city取出替換

$content= file_get_contents("http://www.weather-forecast.com/locations/San-Francisco/forcasts/latest");

preg_match("/3 Day Weather Forecast Summary:/i", $content, $matches);

print_r($matches)

?>

2017年7月29日 星期六

[BS]Udemy Keen Cen 9語言0基礎 #107-#120 流水帳筆記

http://getbootstrap.com 官網有 tutorial 可學!
w3school 一樣也有

#109
CDN = Content Delivery Network


#110
.col-md-* grid classes
class = "col-md-6"

#117-119
至 w3sch Get Started Bootstrap CDN 添加完整程式碼

2017年7月28日 星期五

[jQuery]Udemy Keen Cen 9語言0基礎 #84-#106 流水帳筆記

jQuery / jQuery UI 官網有 tutorial 可學!

#88
$('p').html("This is test text.")
<iframe>
.css("display","none") = .hide() 或 .fadeOut( 時間 )

#92
$.ajax ({
  url:"test.html"
}).done(function(data)){
    $("h1").append(data);
});
呼叫外部文件

#93
RegExp
搜尋、檢查字串

#94-95
表單檢查範例:

除了控制輸入框大小,也能控制輸入字的大小、字與邊框距離。
在 input 前運用 label 清楚定義;input 中運用 type="password" 設定密碼文字不顯示

e.preventDefault()
阻止提交

在#95 2:21直接套用 email 驗證程式碼

$isNumeric()
驗證數值(字)
----

#98
jQuery UI
這裡示範在 document 中直接線上引用 google API jQuery UI,而非下載檔案使用

#99
使用 .resizable() 前要先載入 jQuery UI 的 CSS <link>

#101
.accordion() 可以很容易使多個文章變成標題卷軸,也可嘗試運用在 nav menu 上
.sortable() 讓使用者將項目拖動並排列

#102-105
代碼播放器範例:
切 JS Bin 網站

$(window).height();
$('.className').height(varName or method+'px');

$().click(function(){
  $(this).toggleClass('selected');
});

var activeDiv = $(this).html();
$('#'+activeDiv+'Container'
).toggle();

var showingDiv = $('.codeContainer').filter(function(){    return($(this).css('display') != none );
}).length;

CSS屬性: overflow: hidden;

$('iframe').contents().find('html').html($('#htmlcode').val());

2017年7月25日 星期二

[JS]Udemy Keen Cen 9語言0基礎 #65-#83 流水帳筆記

#72
如需重新讀取 input 值,記得在函數中再 assign 一次。

#73
善用 array 中 splice 的參數。
console.log(arrayName) 能在 console 輸出 array

#77
while loop 常用在循環次數未知的情況
(相較於 for loop)

#81
split 可以將字串化為 array
Math.floor() 無條件捨去

2017年7月20日 星期四

[練習]切版 科技島讀 7/19~7/21

#7/19
花一天的時間切出 70%,
差 slide-showing menu、
頁面滾動超過一定的範圍浮現的 top bar、
下方 fixed footer bar。

top bar 教學:
https://www.minwt.com/webdesign-dev/js/8891.html

#7/20
top bar 直接套用失敗了,只好自己想辦法生。

下方 fixed footer bar 做伸縮效果花好多時間,
尤其為了只讓 bar 區域游標維持 pointer,所以沒把整個 bar height拉高,而是分割,
試了margin-bottom 在 click 時增加而向上推移,
但第二次 click 為了要讓它向下,
賦予一個暫時用 id (或 class) 再將 margin 改回來,沒有成功。
最後成功結果如下,文字再回彈卻沒有顯現:

$(function () {
$('#getmoreclick').hide();
$('.fixedfooter')
.click(function (e) {
if ($('.fixedfooter').css('marginBottom') === '358px') {
$('.fixedfooter').animate({
marginBottom: '0px'
}, 500);
$('.getmore img').attr('src', 'pic/up-arrow-footer.png');
$('.getmore p').css('opacity', '1');
} else {
$('.fixedfooter').animate({
marginBottom: '358px'
}, 500);
$('.getmore img').attr('src', 'pic/down-arrow-footer.png');
$('.getmore p').css('opacity', '0');
}

if ($('#getmoreclick').css('display') === 'block') {
$('#getmoreclick').slideUp(500);

$('.getmore p').hide();
} else {
$('#getmoreclick').slideDown(500);
}
});
});

#7/21
找到另一個 top bar 教學,
只要能讀取得到網頁滑動高度,就有辦法做!

取得 body 捲動後高度 JS & jQuery:
http://www.eion.com.tw/Blogger/?Pid=1154

照此方法 5分鐘搞定!太適合自誇了!!

$(function () {
$('#top-bar').hide();
$(window).scroll(function () {
var scrollH = $(this).scrollTop();
if (scrollH > 205) {
$('#top-bar').slideDown(500);
} else {
$('#top-bar').slideUp(500);
}
});
});

最後是 slide-showing menu 與 整份間距微調,即大功告成!
slide-showing menu 已經邊改邊想到腦袋疲乏,決定尋覓高人指點學功夫,
間距懶得調了,先眠去補充體力。本次切版決定告一段落!

2017年7月17日 星期一

[HTML/CSS]Udemy Keen Cen 9語言0基礎 #0-#64 流水帳筆記

https://www.udemy.com/ken-cens/learn/v4/overview



#24
作品集加入表單 form HTML5 的元素,不然都沒練習到,
就放在 reserve 裡試試。

#25
自定義屬性,HTML5 的特性,之後在 php 或 boostrap 可能會使用到。

CSS & CSS3

#37
區別流向的不同:
一個 div 包兩個元素,加入 float;兩個 div 個別包一個元素,加入 float


#40
padding 會延伸原本設定的 width & height,而不是往內擠,
這好像挺重要的但常常忽略,自然而然就讓 padding 幫我延伸。


#41
如何用 border 畫圓框?

#42
擅用 w3school 幫忙寫字體的順序,很方便!

#44
visited 在統一色調的時候跟 hover 一樣重要;
在 CSS 就設定表現會更好,與script相比,因讀取的順序


#46
box-sizing: border-box
畫圓形、水滴狀

#47

background: linear-gradient()
漸層顏色

#48

box-shadow

#49
column-count,分欄。要注意瀏覽器相容的問題與對應寫法

#50
animation-name-duration
-delay ... 還有很多,
如一次控制多個、時間差表現、單一物件的長寬色不同時間差


#51-#53
實作範例:靜態動畫地球軌跡,以 CSS 寫成。

突然覺得因學過 PS 有圖層概念,滿有幫助的,真幸運~
@keyframe name {from{}to{}}

#54-#62
切版:BBC 網站。別忘善用 span

2017年7月13日 星期四

[Life]進補 P2P夏季大會 18小時關鍵字

其實只是和大 Peter 聚餐並討教,
趕快記下關鍵字:

標籤準確度
float & flex (?)
父子都要 clear
z-index & position
抽獎、彩球、轉盤設計最近好夯 (機率、統計)
Dashapp、MAMP、emmet

髒東西
作品集推薦整個專案
Git大概知道即可,但 Github很值得「現在」就拿來用
「精熟」只是人資寫的

買課程不要衝動、不要跟風
眼神有可見光、碰到撞牆不要放棄
Youtube 一定要打上 tutorial

感恩!又一個貴人,好幸運

2017年7月11日 星期二

[jQuery]HF學習 第一章關鍵字紀錄

這次要試試"回想關鍵字"紀錄:不詳述,只顯示想到的關鍵字

CH 1

display: block none
slide toggle