Saludos, este es mi primer tutorial en Cristalab. Los seguidores del animé y manga conocerán a Naruto, en ese universo existe algo llamado "Sharingan", para resumir, es una forma y color muy particular que toman los ojos. En éste tutorial lo crearemos sólo con CSS3.
La imagen anterior expone el objetivo (es decir, crear algo lo más parecido pero no idéntico ) y cómo estará estructurado. Cabe decir que éste tutorial tiene como fin ser un experimento CSS3, antes de continuar sería mucho mas breve el código CSS si se utiliza prefixfree, hay un artículo que explica de qué trata eso. A continuación el HTML:
Código :
<!DOCTYPE html> <html lang="es"> <head> <meta charset="utf-8"/> <title>Sharingan pure CSS3</title> <link rel="stylesheet" type="text/css" media="all" href="sharingan.css"/> <script type="text/javascript" src="prefixfree.min.js"></script> <body> <!--Borde negro exterior--> <div id="sharingan"> <!--Iris --> <ul> <!--Pupila--> <li> </li> <!-- Anillo que completa al iris--> <li class="ring"> </li> <!--Aspas del Sharingan --> <li class="aspa sup"> <p> </p></li> <li class="aspa der"> <p> </p></li> <li class="aspa izq"> <p> </p></li> </ul> </div> </body> </html>
Dividiremos el CSS en dos partes, la primera con los estilos para hacer el ojo en su estado inactivo/activo (al hacer :hover se mostrará como está en la primera imagen) y la segunda parte la animación CSS para mover las aspas de forma más o menos circular.
Código :
/*div que agrupa todos los elementos a utilizar y que sirve como borde negro exterior*/ div#sharingan { height: 226px; width: 255px; margin: 0 auto; padding: 5px 0; border:1px solid; background: #000; box-shadow:0px 0px 24px rgba(0,0,0,0.6); border-radius: 132px / 117px 117px 117px 117px; } /*Elemento ul con borde circular y que será una parte del iris, pero en su forma inactiva tiene un fondo de color #5A6992 luego al hacer hover en el cambia a #B20000, color típico del sharingan. Está posicionado de forma relativa, tiene una serie 3 box-shadow para recrear una forma esférica un poco más realista y finalmente una transición CSS3 para la propiedad background-color */ ul { /*Aquí pueden usar otros colores excepto el rojo por ejemplo: #383838 */ background-color: #5A6992; margin: 0 0 0 8px; width: 199px; height: 224px; position: relative; top: 1px; border-radius: 139px 139px 139px 139px / 124px 124px 124px 124px; box-shadow:3px 0px 58px rgba(255,255,255,0.5) inset,0px 0px 20px rgba(255,255,255,0.1) inset,0px 0px 9px 7px rgba(0,0,0,1); transition:background 0.5s ease-in; } ul:hover { background-color: #B20000; } ul li { list-style:none; position: relative; background: transparent; } /*Pupila*/ ul li:first-child { background:#000; left: -9%; top: 39%; width: 51px; height: 51px; margin: 0 auto; box-shadow: 0 0 25px rgba(0,0,0,0.7); border-radius: 68px / 64px; /*Escalado a 0.5 ya que es el tamaño de la pupila en su estado normal y una transición con cubic-bezier(0, 1, 1, 2) para darle un efecto bounce*/ transition:transform .5s cubic-bezier(0, 1, 1, 2); transform:scale(0.5); } /*Transición de la pupila al hacer :hover, que con transform:scale(1) devuelve a li:first-child a su escala original y con el efecto rebote ya mencionado */ ul:hover li:first-child { transition:transform .5s cubic-bezier(0, 1, 1, 2); transform:scale(1); } /*Ultima parte del iris, .ring es el anillo por el que se moverán de forma circular las aspas del sharingan,con una transición de la propiedad transform para cuando vuelva a su estado original. */ .ring { top: 0; left: 9%; height: 125px; width: 125px; box-shadow: 0 0 74px rgba(255, 255, 255, 0.3), 0 0 17px rgba(255, 255, 255, 0.3) inset,0 0 5px rgba(0,0,0,0.3) inset; border-radius: 70px 70px 70px 70px; transition:transform 0.1s ease-in; } /*Transición del anillo del iris el cual se escala a 1.1 al hacer hover en ul*/ ul:hover .ring { transition:transform 0.1s ease-in; transform:scale(1.1); } /* Las 3 aspas del sharingan, mejor dicho una parte de ellas: .aspas son los 3 elementos li que con los siguientes estilos formaran un circulo de 25px, posicionados de forma relativa pero los valores en top y left son sólo del aspa superior (al igual que .aspa p) y con su respectiva transición para la propiedad background. */ .aspa { top: -61%; left: 68px; height: 25px; width: 25px; border-radius: 50px 50px 50px 50px; transition:background .5s ease-out; } /*Punta de las 3 aspas (elementos p dentro de los li.aspa), que se logran gracias a las propiedades border-radius y transform: skew() dándole una forma parecida a las puntas de la primera imagen y posicionadas de forma correcta por encima de su elemento padre y con una transición para la propiedad background*/ .aspa p { position: relative; top: -43px; left: 4px; border-radius: 197px 0px 371px 273px; transform: skew(-46deg, -10deg); transition:background .5s ease-out; } /*Al hacer hover en ul pues se le aplica un fondo negro tanto a las aspas (li.aspa) como a las puntas de las aspas (li.aspa p) para hacerlas "visibles"*/ ul:hover .aspa, ul:hover .aspa p { background-color:#000; } /*.der e .izq son las clases para las aspas derecha e izquierda, que ya con posicionadas de forma relativa se rotan cada una en el angulo deseado con transform rotate() para que sea lo mas parecido a un sharingan */ .der { left: 120px; top: -62px; transform: rotate(69deg); } .izq { left: 15px; top: -87px; transform: rotate(200deg); }
Finalmente, el código CSS para la animación:
Código :
/*Hasta este punto ya se tiene un sharingan nivel 1 completo, pero le falta su movimiento circular, éste se logra definiendo 3 keyframes que apliquen 'transform: translate(px,px) rotate(deg)' a cada una de las aspas (.sup,.der,.izq) en 7 pasos siguiendo la trayectoria de .ring */ @keyframes aspa1 { 0% { transform: translate(0px,0px) rotate(0deg); } 50% { transform:translate(59px,28px) rotate(28deg); } 60% { transform:translate(51px,100px) rotate(68deg); } 70% { transform:translate(4px,129px) rotate(146deg); } 80% { transform:translate(-54px,98px) rotate(197deg); } 90% { transform:translate(-67px,53px) rotate(255deg); } 100% { transform: translate(3px,-1px) rotate(349deg); } } @keyframes aspa2 { 0% { transform: translate(0px,0px) rotate(75deg); } 50% { transform:translate(-36px,17px) rotate(92deg); } 60% { transform:translate(-106px,2px) rotate(205deg); } 70% { transform:translate(-112px,-60px) rotate(248deg); } 80% { transform:translate(-49px,-103px) rotate(354deg); } 90% { transform:translate(11px,-54px) rotate(387deg); } 100% { transform: translate(5px,0px) rotate(441deg); } } @keyframes aspa3 { 0% { transform: translate(0,0) rotate(200deg); } 50% { transform:translate(-8px,-34px) rotate(219deg); } 60% { transform:translate(55px,-98px) rotate(350deg); } 70% { transform:translate(116px,-43px) rotate(410deg); } 80% { transform:translate(106px,3px) rotate(442deg); } 90% { transform:translate(55px,27px) rotate(503deg); } 100% { transform: translate(2px,1px) rotate(551deg); } } /*Aplicando una animación con dirección normal, con un retraso de 1s, una duración de 0.5s, realizando 2 vueltas o ciclos y de forma lineal */ ul:hover .sup { animation-name: aspa1; animation-duration: .5s; animation-iteration-count: 2; animation-timing-function: linear; animation-delay:1s; animation-direction: normal; } ul:hover .der { animation-name: aspa2; animation-duration: .5s; animation-iteration-count: 2; animation-timing-function: linear; animation-delay:1s; animation-direction: normal; } ul:hover .izq { animation-name: aspa3; animation-duration: .5s; animation-iteration-count: 2; animation-timing-function: linear; animation-delay:1s; animation-direction: normal; }
Este ejemplo ha sido testeado en Chrome, Firefox y Opera, donde sólo en los 2 primeros funciona la animación, por supuesto pueden verlo en acción desde el siguiente enlace: Sharingan CSS3. Bueno así finaliza mi primer tutorial en Cristalab, espero que les haya gustado y cualquier consejo o sugerencia será bien aceptado.
P.S: En unos días publico cómo realizar un Sharingan nivel 2 (mejor conocido como Mangekyou Sharingan) haciendo sólo algunas modificaciones del código previo.
¿Sabes SQL? ¿No-SQL? Aprende MySQL, PostgreSQL, MongoDB, Redis y más con el Curso Profesional de Bases de Datos que empieza el martes, en vivo.
Por Kinduff el 11 de Junio de 2012
Por lordcaos el 12 de Junio de 2012
Por lordcaos el 12 de Junio de 2012
Por v3on el 12 de Junio de 2012
Por lordcaos el 12 de Junio de 2012
Por Mariux el 12 de Junio de 2012
lordcaos :
es que hubo un problema con la visualización del código
gracias por el aporte!
Por NeoCesar el 12 de Junio de 2012
Por locki el 12 de Junio de 2012
Por Freddie el 12 de Junio de 2012
NeoCesar :
Por lordcaos el 12 de Junio de 2012
NeoCesar :
Tienes toda la razón, el Sharingan nivel 1 es el que tiene un aspa,no se que me paso , Friki Mode OFF.
Por jpcw el 13 de Junio de 2012
pero sin querer desacreditar ni mucho menos, pero y la aplicación a la vida real, cual sería?
Por lordcaos el 13 de Junio de 2012
jpcw :
pero sin querer desacreditar ni mucho menos, pero y la aplicación a la vida real, cual sería?
Pues no lo realice con alguna aplicación en especifico a la "vida real", precisamente por eso en el tuto indique "Cabe decir que éste tutorial tiene como fin ser un experimento CSS3", sólo eso, es decir, simplemente una practica de algunas de las nuevas propiedades CSS3 como transform,transition, las animaciones,entre otros.
Por jpcw el 13 de Junio de 2012
lordcaos :
Pues no lo realice con alguna aplicación en especifico a la "vida real", precisamente por eso en el tuto indique "Cabe decir que éste tutorial tiene como fin ser un experimento CSS3", sólo eso, es decir, simplemente una practica de algunas de las nuevas propiedades CSS3 como transform,transition, las animaciones,entre otros.
Ok, te entiendo, y la verdad me gusto, pensare como aplicarlo y te cuento
Por JJFolken el 14 de Junio de 2012
Por lordcaos el 14 de Junio de 2012
JJFolken-blog :
Ahh perfecto , yo lo había testeado en Opera 11.64
Por el 31 de Julio de 2016
Por José el 31 de Enero de 2018
classroom rental space
training rrom rental in singapore
training rooms in singapore
seminar room rental in singapore
indoor team building activities
corporate team building games singapore
team bonding in singapore
team building activities singapore
team building games singapore
10 soft skills you need
administrative office procedures
administrative support courses
adult learning mental skills
adult learning physical skills
anger management courses in singapore
appreciative inquiry courses
archiving and records management
assertiveness and self confidence
attention management courses
basic bookkeeping courses
being a likeable boss
body language basics courses
budgets and financial reports
business acumen courses
business ethics courses
business etiquette courses in singapore
business succession planning courses
business writing courses in singapore
call center training courses
change management courses in singapore
coaching and mentoring courses
coaching sales people courses
collaborative business writing
communication strategies courses
conducting annual employee reviews
conflict resolution courses
contact center training courses
contract management courses in singapore
creating a great webinar
creative problem solving courses
crisis management courses
critical thinking courses in singapore
customer service courses in singapore
customer support courses
cyber security courses in singapore
delivering constructive criticism
developing a lunch and learn
developing corporate behavior
developing creativity courses
developing new managers
digital citizenship courses
emotional intelligence courses
employee motivation courses
employee on boarding courses
employee recognition courses
employee recruitment courses
employee termination processes
entrepreneurship courses in singapore
event planning courses in singapore
executive and personal assistants
facilitation skills courses
generation gaps courses
goal setting and getting things done
handling a difficult customer
health and wellness at work courses
high performance teams inside the company
high performance teams remote work force
hiring strategies courses
human resource management courses in singapore
improving mindfulness
improving self awareness
increasing your happiness
internet marketing fundamentals courses
interpersonal skills courses
job search skills courses
knowledge management courses in singapore
leadership and influence courses
lean process and six sigma
life coaching essentials courses
manager management courses
managing personal finances courses
managing work place anxiety
marketing basics courses
measuring results from training
media and public relations courses
meeting management courses
middle manager courses
millennial on boarding courses
m learning essentials
motivating your sales team
multi level marketing courses
negotiation skills courses
networking outside the company
networking within the company
office politics for managers
organizational skills courses
overcoming sales objections
performance management courses
personal branding courses in singapore
personal productivity courses
presentation skills courses in singapore
project management courses in singapore
proposal writing courses
prospecting and lead generation
public speaking courses in singapore
risk assessment and management courses
safety in the work place courses
sales fundamentals courses
sales training courses in singapore
servant leadership courses
it courses in singapore
microsoft training singapore
corporate training in singapore
corporate sgx
social intelligence courses
social learning courses
social media in the work place
social media marketing courses in singapore
soft skills courses in singapore
stress management courses in singapore
supervising others
supply chain management courses
taking initiative courses
talent management courses
team building for managers
team building through chemistry
teamwork and team building
telephone etiquette courses
telework and telecommuting
time management courses in singapore
trade show staff training
train the trainer courses
virtual team building and management
women in leadership courses
work life balance courses in singapore
work place diversity courses
work place harassment courses
work place violence courses
sancy suraj
sancy suraj
sancy suraj
sancy suraj
sancy suraj
sancy suraj
sancy suraj
sancy suraj
[url=https://books.google.com.sg/books?id=1QykBQAAQBAJ&pg=PT362&lpg=PT362&dq=%22sancy+suraj+singh%22&source=bl&ots=E86QDyrLG2&sig=H-6a_YH-kTWaZWTfPSr1xfm4BOs&hl=en&sa=X&ved=0ahUKEwi3_56hhubVAhWJLo8KHcxTBxQ4ChDoAQgjMAA#v=onepage&q =% 22sancy% 20suraj% 20singh% 22 & f = false]sancy suraj[/url]
sancy suraj
longest colour sequence memorised
sancy suraj
longest colour sequence memorised
memory training course
memory training course
memory training course
memory training course
memory training course
memory training course
memory training course
memory training course
memory training course
memory training course
memory training course
memory training course
memory training course
memory training course
memory training course
memory training course
memory training course
memory training course
lunch talks
lunch talks
memory training course
memory training course
cabin crew
online memory course
memory training course
memory training course
memory training course
memory training course
memory training course
speed reading
tuition
tuition
tuition
tuition
tuition
tuition
tuition
tuition
tuition
tuition
geography tuition for secondary school students in singapore
geography tuition for secondary school students singapore
geography tuition for secondary school students singapore
geography tuition for secondary school students singapore
geography tuition for secondary school students singapore
secondary geography tuition in singapore
history tuition for secondary school students in singapore
social studies tuition for secondary school students in singapore
psle english tuition in singapore
psle science tuition in singapore
secondary 1 chemistry tuition in singapore
secondary 1 physics tuition in singapore
school holiday workshops courses for students in singapore
school holidays activitie in singapore
school holidays activitie in singapore
[url=http://umonictuitionadvantage.com/2017-november-school-holidays-activities-programmes-workshop-courses-camps-for- students-kids-in-singapore/]school holidays activitie in singapore[/url]
school holidays activitie in singapore
study skills
study skills
study skills workshops course in singapore
study skills workshops course in singapore
speed reading
speed reading
tuition
tuition
tuition
tuition
tuition
tuition
tuition
tuition
tuition
tuition
tuition
tuition
tuition
tuition
tuition
tuition[
tuition[
tuition[
tuition[
tuition[
tuition[
tuition[
tuition[
student courses
corporate training
corporate training
corporate training
corporate training
corporate training
corporate training
corporate training
corporate training
corporate training
corporate training
corporate training
corporate training
corporate training
corporate training
corporate training
corporate training
corporate training
corporate training
corporate training
corporate training
corporate training
corporate training
lunch talk
lunch talk
lunch talk
lunch talk
lunch talk
lunch talk
lunch talk
lunch talk
lunch talk
lunch talk
lunch talk
lunch talk
corporate lunch talk
corporate lunch talk
corporate lunch talk
corporate lunch talk
corporate lunch talk
corporate lunch talk
corporate lunch talk
corporate lunch talk
corporate lunch talk
corporate lunch talk
corporate lunch talk
corporate lunch talk
corporate lunch talk
corporate lunch talk
team building
team building ideas
team building activities
unique team building
team building
corporate training in singapore
corporate training courses
corporate training courses
corporate training courses
corporate training courses
corporate health talk
corporate health talk
corporate health talk
lunch and learn talk
workplace lunch and learn
corporate training companies in singapore
training companies in singapore
emcee
emcee
health talks
soft skills training course
corporate training providers
professional development courses
training and development courses
short courses in singapore
corporate training courses in singapore
corporate training courses
corporate training in singapore
school holiday workshops courses for students in singapore
business students memory course in singapore
business students memory improvement workshop in singapore
memory improvement course for business students
memory improvement course for business students
business students memory improvement course
business students memory course in singapore
corporate health talks singapore
corporate health talks in singapore
corporate health talk singapore
corporate health talk in singapore
corporate health talks singapore
corporate health talks singapore
finance students memory training course in singapore
finance students memory training course in singapore
finance students memory training course in singapore
memory training courses for finance students in singapore
memory training courses for finance students in singapore
memory improvement courses for finance students in singapore
pinnacle minds
memory course
study skills
speed reading
memory training
school holiday
lunch and learn
march school holidays workshops
march school holidays workshops
march school holidays workshops
march school holidays workshops
march school holidays workshops
june school holidays workshops
june school holidays workshops
june school holidays workshops
june school holidays workshops
september 2018 school holidays workshops
september 2018 school holidays workshops
september 2018 school holidays workshops
september 2018 school holidays workshops
november 2018 school holidays workshops
november 2018 school holidays workshops
november 2018 school holidays workshops
november 2018 school holidays workshops
december 2018 school holidays workshops
december 2018 school holidays workshops
december 2018 school holidays workshops
december 2018 school holidays workshops
top 10 soft skills you need training course
administrative office procedures training course
administrative support training course
anger management training course
appreciative inquiry training course
archiving and records management training course
archiving and records management training course
self confidence and assertiveness training course
improving your attention management training course
bacis bookkeeping training course
being a likeable boss training course
body language training course
budgets and-financial reports training course
business acumen training course
business ethics training course
business etiquette training course
business succession planning training course
business writing training course
call centre training course
change management training course
civility in the workplace training course
coaching and mentoring training course
coaching salespeople training course
collaborative business writing training course
communication strategies training course
conducting annual employee reviews training course
conflict resolution training course
contact centre training course
contract management training course
creating a great webinar training course
creative problem solving training course
crisis management training course
critical thinking training course
customer service training course
customer support training course
cyber security training course
delivering constructive criticism training course
developing lunch and learn training course
developing corporate behavior training course
developing creativity training course
developing new managers training course
digital citizenship training course
emotional intelligence training course
employee motivation training course
employee onboarding training course
employee recognition training course
employee recruitment training course
employee termination processes training course
entrepreneurship training course
event planning training course
executive and personal assistants training course
facilitation skills training course
generation gaps training course
goal setting and getting things done training course
handling a difficult customer training course
health and wellness at work training course
high performance teams inside the company training course
high performance teams remote workforce training course
hiring strategies training course
human resource management training course
improving mindfulness training course
improving self awareness training course
internet marketing fundamentals training course
interpersonal skills training course
job search skills training course
knowledge management training course
leadership and influence training course
lean process and six sigma training course
life coaching essentials training course
manager management training course
managing personal finances training course
managing workplace anxiety training course
marketing basics training course
measuring results from training course
media and public relations training course
meeting management training course
middle manager training course
millennial onboarding training course
mlearning essentials training course
motivating your sales team training course
negotiation skills training course
networking outside the company training course
networking within the company training course
office politics for managers training course
organizational skills training course
overcoming sales objections training course
performance management training course
personal branding training course
personal productivity training course
presentation skills training course
project management training course
proposal writing training course
prospecting and lead generation training course
public speaking training course
risk assessment and management training course
safety in the workplace training course
sales fundamentals training course
servant leadership training course
social intelligence training course
social learning training course
social media in the workplace training course
social media marketing training course
stress management training course
supervising others training course
supply chain management training course
taking initiative training course
talent management training course
team building for managers training course
team building through chemistry training course
teamwork and team building training course
telephone etiquette training course
telework and telecommuting training course
time management training course
top 10 sales secrets training course
trade show staff training course
train the trainer training course
virtual team building and management training course
women in leadership training course
work life balance training course
workplace diversity training course
workplace harassment training course
workplace violence training course
half day memory improvement courses workshops
speed reading courses workshops in singapore
10 soft skills you need corporate training course in singapore
administrative office procedures corporate training course in singapore
administrative support corporate training course in singapore
anger management corporate training course in singapore
appreciative inquiry corporate training course in singapore
archiving and records management corporate training course in singapore
self confidence assertiveness corporate training course in singapore
improving your attention management corporate training course in singapore
basic bookkeeping corporate training course in singapore
being a likeable boss corporate training course in singapore
body language basics corporate training course in singapore
budgets and financial reports corporate training course in singapore
business acumen corporate training course in singapore
business ethics corporate training course in singapore
business etiquette corporate training course in singapore
business succession planning corporate training course in singapore
business writing corporate training course in singapore
call center corporate training course in singapore
change management corporate training course in singapore
civility in the workplace corporate training course in singapore
coaching and mentoring corporate training course in singapore
coaching salespeople corporate training course in singapore
collaborative business writing corporate training course in singapore
communication strategies corporate training course in singapore
conducting annual employee reviews corporate training course in singapore
conflict resolution corporate training course in singapore
contact center corporate training course in singapore
contract management corporate training course in singapore
creating a great webinar corporate training course in singapore
creative problem solving corporate training course in singapore
crisis-management corporate training course in singapore
critical thinking corporate training course in singapore
customer service corporate training course in singapore
customer support corporate training course in singapore
cyber security corporate training course in singapore
delivering constructive criticism corporate training course in singapore
developing a lunch and learn corporate training course in singapore
developing corporate behavior corporate training course in singapore
developing creativity corporate training course in singapore
developing new managers corporate training course in singapore
digital citizenship corporate training course in singapore
emotional intelligence corporate training course in singapore
employee motivation corporate training course in singapore
employee onboarding corporate training course in singapore
employee recognition corporate training course in singapore
employee recruitment corporate training course in singapore
employee termination processes corporate training course in singapore
entrepreneurship training course in singapore
event planning corporate training course in singapore
executive and personal assistants corporate training course in singapore
facilitation skills corporate training course in singapore
generation gaps corporate training course in singapore
goal setting and getting things done corporate training course in singapore
handling a difficult customer corporate training course in singapore
health and wellness at work corporate training course in singapore
high performance teams inside the company corporate training course in singapore
high performance teams remote workforce corporate training course in singapore
hiring strategies corporate training course in singapore
human resource management corporate training course in singapore
improving mindfulness corporate training course in singapore
improving self awareness corporate training course in singapore
increasing your happiness corporate training course in singapore
internet marketing fundamentals corporate training course in singapore
interpersonal skills corporate training course in singapore
job search skills corporate training course in singapore
knowledge management corporate training course in singapore
leadership and influence corporate training course in singapore
lean process and six sigma corporate training course in singapore
life coaching essentials corporate training course in singapore
manager management corporate training course in singapore
managing personal finances corporate training course in singapore
marketing basics corporate training course in singapore
measuring results from corporate training course in singapore
media and public relations corporate training course in singapore
meeting management corporate training course in singapore
middle manager corporate training course in singapore
millennial onboarding corporate training course in singapore
mlearning essentials corporate training course in singapore
motivating your sales team corporate training course in singapore
negotiation skills corporate training course in singapore
networking outside the company corporate training course in singapore
networking within the company corporate training course in singapore
office politics for managers corporate training course in singapore
organizational skills corporate training course in singapore
overcoming sales objections corporate training course in singapore
performance management corporate training course in singapore
personal branding corporate training course in singapore
personal productivity corporate training course in singapore
presentation skills corporate training course in singapore
project management corporate training course in singapore
proposal writing corporate training course in singapore
prospecting and lead generation corporate training course in singapore
public speaking corporate training course in singapore
[url