人人都是產(chǎn)品經(jīng)理【起點學(xué)院】,BAT實戰(zhàn)派產(chǎn)品總監(jiān)手把手系統(tǒng)帶你學(xué)產(chǎn)品、學(xué)運營。
產(chǎn)品設(shè)計時細(xì)節(jié)是產(chǎn)品經(jīng)理最頭疼的問題,一個button,一個鏈接都要考慮太多的細(xì)節(jié)問題。作者整理了常見的一些功能設(shè)計問題,一篇文章看懂這些功能設(shè)計。來學(xué)習(xí)吧。
鏈接也稱為超鏈接,所謂的超鏈接是指從一個網(wǎng)頁指向一個目標(biāo)的連接關(guān)系,這個目標(biāo)可以是另一個網(wǎng)頁,也可以是相同網(wǎng)頁上的不同位置,還可以是一個圖片,一個電子郵件地址,一個文件,甚至是一個應(yīng)用程序。而在一個網(wǎng)頁中用來超鏈接的對象,可以是一段文本或者是一個圖片。當(dāng)瀏覽者單擊已經(jīng)鏈接的文字或圖片后,鏈接目標(biāo)將顯示在瀏覽器上,并且根據(jù)目標(biāo)的類型來打開或運行。
鏈接可以是一個字或是一段字這樣的文本,也可以是一個按鈕,一張圖片,當(dāng)你點擊后跳轉(zhuǎn)到另一個目標(biāo),當(dāng)你把鼠標(biāo)指針移到某個鏈接時會變成一個小手,當(dāng)然在手機(jī)上沒有這一特點。
文本樣式的鏈接一般在搜索引擎的網(wǎng)站呈現(xiàn)藍(lán)色字樣,大多會在下面加上下劃線以便識別,不過現(xiàn)如今考慮到不影響文本的可讀性與用戶體驗,逐漸取消了下劃線。而在一些別的網(wǎng)站考慮到界面設(shè)計風(fēng)格各方面的因素而不用藍(lán)色。
谷歌的文本鏈接是藍(lán)色,沒有下劃線
百度的文本鏈接也是藍(lán)色,關(guān)鍵詞是紅色,有下劃線
而京東的文本鏈接有灰色,有白色,有黑色
按鈕樣式的鏈接比文本樣式的更容易識別,每一個按鈕都是一樣鏈接。
按鈕樣式鏈接
圖片樣式的鏈接可以是單獨的一張圖片,也可以是文字與按鈕一起組成一張圖片,只是鼠標(biāo)指針掃過圖片的任何一個部位都會變成小手。
如桌面彈出這種游戲小窗口的圖片式鏈接
由文字/圖/按鈕樣式一起構(gòu)成的一張圖片式按鈕,鼠標(biāo)可以點擊圖中任何一部位
鏈接打開的方式有三種:第一種是在當(dāng)前頁面刷新跳轉(zhuǎn),國外的網(wǎng)站大多是這樣的打開式;第二種是在新標(biāo)簽頁面打開鏈接,國內(nèi)大多采用這種;第三種是提示用APP打開。當(dāng)然現(xiàn)在出現(xiàn)了一種新的打開方式,那就是二維碼掃描。
提示用美拍APP打開
按照連接路徑的不同,網(wǎng)頁中超鏈接一般分為以下3種類型:內(nèi)部鏈接,錨點鏈接和外部鏈接。
鏈接還可以分為動態(tài)鏈接和靜態(tài)鏈接。動態(tài)超鏈接指的是可以通過改變HTML代碼來實現(xiàn)動態(tài)變化的鏈接,例如我們可以實現(xiàn)將鼠標(biāo)移動到某個文字鏈接上,文字就會象動畫一樣動起來或改變顏色的效果,也可以實現(xiàn)鼠標(biāo)移到圖片上圖片就產(chǎn)生反色或朦朧等等的效果。而靜態(tài)鏈接,顧名思義,就是沒有動態(tài)效果的鏈接。
與外部鏈接(即反向鏈接)相反,內(nèi)部鏈接是指同一網(wǎng)站域名下的內(nèi)容頁面之間互相鏈接。如頻道、欄目、終極內(nèi)容頁之間的鏈接,乃至站內(nèi)關(guān)鍵詞之間的Tag鏈接都可以歸類為內(nèi)部鏈接,因此內(nèi)部鏈接我們也可以稱之為站內(nèi)鏈接,對內(nèi)部鏈接的優(yōu)化其實就是對網(wǎng)站的站內(nèi)鏈接的優(yōu)化。
HTML中的鏈接,正確的說法應(yīng)該稱作"錨點",它命名錨點鏈接(也叫書簽鏈接)常常用于那些內(nèi)容龐大繁瑣的網(wǎng)頁,通過點擊命名錨點,不僅讓我們能指向文檔,還能指向頁面里的特定段落,更能當(dāng)作"精準(zhǔn)鏈接"的便利工具,讓鏈接對象接近焦點。便于瀏覽者查看網(wǎng)頁內(nèi)容。類似于我們閱讀書籍時的目錄頁碼或章回提示。在需要指定到頁面的特定部分時,標(biāo)記錨點是最佳的方法。
外部鏈接,又常被稱為:“反向鏈接”或“導(dǎo)入鏈接”,是指通過其他網(wǎng)站鏈接到你的網(wǎng)站的鏈接。
外部鏈接指的是針對搜索引擎,與其它站點所做的友情鏈接。高質(zhì)量的外部鏈接指:和你的網(wǎng)站建立鏈接的網(wǎng)站知名度高,訪問量大,同時相對的外部鏈接較少,有助于快速提升你的網(wǎng)站知名度和排名的其他網(wǎng)站的友情鏈接。
如果按照使用對象的不同,網(wǎng)頁中的鏈接又可以分為:文本超鏈接,圖像超鏈接,E-mail鏈接,錨點鏈接,多媒體文件鏈接,空鏈接等。
鏈接是一種對象,它以特殊編碼的文本或圖形的形式來實現(xiàn)鏈接,如果單擊該鏈接,則相當(dāng)于指示瀏覽器移至同一網(wǎng)頁內(nèi)的某個位置,或打開一個新的網(wǎng)頁,或打開某一個新的WWW網(wǎng)站中的網(wǎng)頁。
鏈接在交互上一般會呈現(xiàn)4種狀態(tài),即默認(rèn)狀態(tài)/懸停時狀態(tài)/點擊時狀態(tài)/點擊后狀態(tài)。比如谷哥網(wǎng)站的交互體驗。如下圖:
點擊前
懸停時,下面浮現(xiàn)半透明線條
點擊時,有波紋暈開的動態(tài)效果
點擊后,下面線條粗
有時候是3種狀態(tài),比如百度網(wǎng)和知乎應(yīng)用:
默認(rèn)狀態(tài)
點擊時鏈接變紅
點擊后鏈接變成紫色
IOS系統(tǒng)知乎應(yīng)用的3種狀態(tài),而在Android系統(tǒng)沒有用力點擊這一狀態(tài)。
默認(rèn)狀態(tài)
點擊狀態(tài)
用力點擊會彈出預(yù)覽小窗口
有些時候只有2種狀態(tài),如下圖谷歌網(wǎng):
默認(rèn)和點擊后狀態(tài)一樣
鼠標(biāo)懸停時出現(xiàn)下劃線
默認(rèn)狀態(tài)
點擊時
而有時候比如在APP里有時候就一直只有一種狀態(tài),也可以稱靜態(tài)鏈接,之前的可以稱之為動態(tài)鏈接。在不同的使用場景會因為當(dāng)時的情況選擇最合適的交互體驗設(shè)計。有的情況下還會加上點擊的音效,使用戶體驗更暢快,這在移動端用的使用情況多一些。
總之鏈接是網(wǎng)頁不可缺少的構(gòu)成部分,每一個鏈接的呈現(xiàn)都是經(jīng)過深思熟慮的。
作者:潘瑤瓊(簡書作者)
本文由 @潘瑤瓊 授權(quán)發(fā)布于人人都是產(chǎn)品經(jīng)理,未經(jīng)作者許可,禁止轉(zhuǎn)載。
果圖
各位長友,大家好!
今天給大家?guī)淼脑创a是 13款鼠標(biāo)劃過特效CSS3樣式源碼!
大家可以自己搭配修改,應(yīng)用到自己的項目中!
有想要文件版源碼的朋友 可以來我的HTML5學(xué)習(xí)交流:581549454 里面都是做前端開發(fā)的,拒絕賣課和廣告!純學(xué)習(xí)交流,每天會上傳一些優(yōu)秀的作品和源碼,歡迎初學(xué)者和大神們。
廢話不多說,上源碼!
@import url(http://fonts.googleapis.com/css?family=Raleway:400,500,700,900|Dosis:800|Playfair+Display:400,400italic,900italic|Lora:700|Syncopate:700|Roboto+Condensed:300italic|Oswald:700);
@font-face {
font-weight: normal;
font-style: normal;
font-family: 'codropsicons';
src:url('../fonts/codropsicons/codropsicons.eot');
src:url('../fonts/codropsicons/codropsicons.eot?#iefix') format('embedded-opentype'),
url('../fonts/codropsicons/codropsicons.woff') format('woff'),
url('../fonts/codropsicons/codropsicons.ttf') format('truetype'),
url('../fonts/codropsicons/codropsicons.svg#codropsicons') format('svg');
}
這個用戶體驗為王的時代,有各種酷炫主流的畫面操作,毫無疑問是非常重要的,今天我們就來實現(xiàn)鼠標(biāo)特效——火焰
代碼實現(xiàn):
<html> <head> <meta charset="utf-8"> <title>HTML5 Canvas火焰跟隨鼠標(biāo)動畫DEMO演示</title> <style> html, body { margin:0; padding:0; height: 100%; } </style> </head> <body> <div style="text-align:center;clear:both;"> <script src="/gg_bd_ad_720x90.js" type="text/javascript"></script> <script src="/follow.js" type="text/javascript"></script> </div> <canvas id="fire"></canvas> <script> var Fire = function(){ this.canvas = document.getElementById('fire'); this.ctx = this.canvas.getContext('2d'); this.canvas.height = window.innerHeight; this.canvas.width = window.innerWidth; this.aFires = []; this.aSpark = []; this.aSpark2 = []; this.mouse = { x : this.canvas.width * .5, y : this.canvas.height * .75, } this.init(); } Fire.prototype.init = function() { this.canvas.addEventListener('mousemove', this.updateMouse.bind( this ), false); } Fire.prototype.run = function(){ this.update(); this.draw(); if( this.bRuning ) requestAnimationFrame( this.run.bind( this ) ); } Fire.prototype.start = function(){ this.bRuning = true; this.run(); } Fire.prototype.stop = function(){ this.bRuning = false; } Fire.prototype.update = function(){ this.aFires.push( new Flame( this.mouse ) ); this.aSpark.push( new Spark( this.mouse ) ); this.aSpark2.push( new Spark( this.mouse ) ); for (var i = this.aFires.length - 1; i >= 0; i--) { if( this.aFires[i].alive ) this.aFires[i].update(); else this.aFires.splice( i, 1 ); } for (var i = this.aSpark.length - 1; i >= 0; i--) { if( this.aSpark[i].alive ) this.aSpark[i].update(); else this.aSpark.splice( i, 1 ); } for (var i = this.aSpark2.length - 1; i >= 0; i--) { if( this.aSpark2[i].alive ) this.aSpark2[i].update(); else this.aSpark2.splice( i, 1 ); } } Fire.prototype.draw = function(){ this.ctx.globalCompositeOperation = "source-over"; this.ctx.fillStyle = "rgba( 15, 5, 2, 1 )"; this.ctx.fillRect( 0, 0, window.innerWidth, window.innerHeight ); this.grd = this.ctx.createRadialGradient( this.mouse.x, this.mouse.y - 200,200,this.mouse.x, this.mouse.y - 100,0 ); this.grd.addColorStop(0,"rgb( 15, 5, 2 )"); this.grd.addColorStop(1,"rgb( 30, 10, 2 )"); this.ctx.beginPath(); this.ctx.arc( this.mouse.x, this.mouse.y - 100, 200, 0, 2*Math.PI ); this.ctx.fillStyle= this.grd; this.ctx.fill(); this.ctx.font = "15em Amatic SC"; this.ctx.textAlign = "center"; this.ctx.strokeStyle = "rgb(50, 20, 0)"; this.ctx.fillStyle = "rgb(120, 10, 0)"; this.ctx.lineWidth = 2; this.ctx.strokeText("Fire",this.canvas.width/2, this.canvas.height * .72 ); this.ctx.fillText("Fire",this.canvas.width/2, this.canvas.height * .72 ); this.ctx.globalCompositeOperation = "overlay";//or lighter or soft-light for (var i = this.aFires.length - 1; i >= 0; i--) { this.aFires[i].draw( this.ctx ); } this.ctx.globalCompositeOperation = "soft-light";//"soft-light";//"color-dodge"; for (var i = this.aSpark.length - 1; i >= 0; i--) { if( ( i % 2 ) === 0 ) this.aSpark[i].draw( this.ctx ); } this.ctx.globalCompositeOperation = "color-dodge";//"soft-light";//"color-dodge"; for (var i = this.aSpark2.length - 1; i >= 0; i--) { this.aSpark2[i].draw( this.ctx ); } } Fire.prototype.updateMouse = function( e ){ this.mouse.x = e.clientX; this.mouse.y = e.clientY; //this.aFires.push( new Flame( this.mouse ) ); } var Flame = function( mouse ){ this.cx = mouse.x; this.cy = mouse.y; this.x = rand( this.cx - 25, this.cx + 25); this.y = rand( this.cy - 5, this.cy + 5); this.vy = rand( 1, 3 ); this.vx = rand( -1, 1 ); this.r = rand( 20, 30 ); this.life = rand( 3, 6 ); this.alive = true; this.c = { h : Math.floor( rand( 2, 40) ), s : 100, l : rand( 80, 100 ), a : 0, ta : rand( 0.8, 0.9 ) } } Flame.prototype.update = function() { this.y -= this.vy; this.vy += 0.05; this.x += this.vx; if( this.x < this.cx ) this.vx += 0.1; else this.vx -= 0.1; if( this.r > 0 ) this.r -= 0.1; if( this.r <= 0 ) this.r = 0; this.life -= 0.15; if( this.life <= 0 ){ this.c.a -= 0.05; if( this.c.a <= 0 ) this.alive = false; }else if( this.life > 0 && this.c.a < this.c.ta ){ this.c.a += .08; } } Flame.prototype.draw = function( ctx ){ ctx.beginPath(); ctx.arc( this.x, this.y, this.r * 3, 0, 2*Math.PI ); ctx.fillStyle = "hsla( " + this.c.h + ", " + this.c.s + "%, " + this.c.l + "%, " + (this.c.a/20) + ")"; ctx.fill(); ctx.beginPath(); ctx.arc( this.x, this.y, this.r, 0, 2*Math.PI ); ctx.fillStyle = "hsla( " + this.c.h + ", " + this.c.s + "%, " + this.c.l + "%, " + this.c.a + ")"; ctx.fill(); } var Spark = function( mouse ){ this.cx = mouse.x; this.cy = mouse.y; this.x = rand( this.cx -40, this.cx + 40); this.y = rand( this.cy, this.cy + 5); this.lx = this.x; this.ly = this.y; this.vy = rand( 1, 3 ); this.vx = rand( -4, 4 ); this.r = rand( 0, 1 ); this.life = rand( 4, 5 ); this.alive = true; this.c = { h : Math.floor( rand( 2, 40) ), s : 100, l : rand( 40, 100 ), a : rand( 0.8, 0.9 ) } } Spark.prototype.update = function() { this.lx = this.x; this.ly = this.y; this.y -= this.vy; this.x += this.vx; if( this.x < this.cx ) this.vx += 0.2; else this.vx -= 0.2; this.vy += 0.08; this.life -= 0.1; if( this.life <= 0 ){ this.c.a -= 0.05; if( this.c.a <= 0 ) this.alive = false; } } Spark.prototype.draw = function( ctx ){ ctx.beginPath(); ctx.moveTo( this.lx , this.ly); ctx.lineTo( this.x, this.y); ctx.strokeStyle = "hsla( " + this.c.h + ", " + this.c.s + "%, " + this.c.l + "%, " + (this.c.a / 2) + ")"; ctx.lineWidth = this.r * 2; ctx.lineCap = 'round'; ctx.stroke(); ctx.closePath(); ctx.beginPath(); ctx.moveTo( this.lx , this.ly); ctx.lineTo( this.x, this.y); ctx.strokeStyle = "hsla( " + this.c.h + ", " + this.c.s + "%, " + this.c.l + "%, " + this.c.a + ")"; ctx.lineWidth = this.r; ctx.stroke(); ctx.closePath(); } rand = function( min, max ){ return Math.random() * ( max - min) + min; }; onresize = function () { oCanvas.canvas.width = window.innerWidth; oCanvas.canvas.height = window.innerHeight; }; var oCanvas; init = function() { oCanvas = new Fire(); oCanvas.start(); } window.onload = init; </script> </body> </html>
學(xué)習(xí)從來不是一個人的事情,要有個相互監(jiān)督的伙伴,想要學(xué)習(xí)或交流前端問題的小伙伴可以私信回復(fù)小明“學(xué)習(xí)” 獲取前端學(xué)習(xí)資料,一起學(xué)習(xí)!
*請認(rèn)真填寫需求信息,我們會在24小時內(nèi)與您取得聯(lián)系。