Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • Mathison/calculator
  • Dashes/calculator
2 results
Show changes
Commits on Source (85)
Showing
with 1655 additions and 104 deletions
# Calculator
## Getting started
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
## Add your files
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
```
git remote add origin https://git.ustc.edu.cn/Dashes/calculator.git
git branch -M main
git push -uf origin main
```
## Integrate with your tools
- [ ] [Set up project integrations](https://git.ustc.edu.cn/Mathison/calculator/-/settings/integrations)
## Collaborate with your team
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
- [ ] [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
## Test and Deploy
Use the built-in continuous integration in GitLab.
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
***
# Editing this README
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template.
## Suggestions for a good README
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
## Name
Choose a self-explaining name for your project.
## Description
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
## Badges
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
## Visuals
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
## Installation
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
## Usage
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
## Support
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
## Roadmap
If you have ideas for releases in the future, it is a good idea to list them in the README.
## Contributing
State if you are open to contributions and what your requirements are for accepting them.
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
## Authors and acknowledgment
Show your appreciation to those who have contributed to the project.
## License
For open source projects, say how it is licensed.
## Project status
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
File deleted
File deleted
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="fdfb5684-fb8e-4628-bca4-64dbb3220269" name="Changes" comment="" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="MarkdownSettingsMigration">
<option name="stateVersion" value="1" />
</component>
<component name="ProjectId" id="28grNU8uBIDiZPW2TbmngyLIeHK" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
"RunOnceActivity.OpenProjectViewOnStart": "true",
"RunOnceActivity.ShowReadmeOnStart": "true",
"last_opened_file_path": "D:/Git/flaskr"
}
}]]></component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="fdfb5684-fb8e-4628-bca4-64dbb3220269" name="Changes" comment="" />
<created>1651649029544</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1651649029544</updated>
</task>
<servers />
</component>
</project>
\ No newline at end of file
import os
from flask import Flask
from flask import Flask,render_template
import sys
sys.path.append(__file__[:-12])
def create_app(test_config=None):
# create and configure the app
......@@ -25,9 +25,9 @@ def create_app(test_config=None):
pass
# a simple page that says hello
@app.route('/hello')
def hello():
return 'Hello, World!'
@app.route('/')
def index():
return render_template('base.html')
from . import calc
app.register_blueprint(calc.bp)
......
File added
No preview for this file type
File deleted
File added
No preview for this file type
File added
File added
File added
File added
import functools
from latex_transer import Trans,Trans_equal
from sympy import *
from sympy_rewrite import *
from flask import (
Blueprint, flash, g, redirect, render_template, request, session, url_for
)
from werkzeug.security import check_password_hash, generate_password_hash
bp = Blueprint('calc', __name__, url_prefix='')
@bp.route('/calc', methods=('GET', 'POST'))
deletes=['\\left','\\right','\\operatorname']
common_vars=['x','y','z','a','b','c','u','v','w']
def Work(content,Func=None,var_=None,order_=None,lows_=None,highs_=None):
if var_!=None:
print("var",type(var_[0]));
for i in range(len(var_)):
var_[i]=Trans(var_[i])
if lows_!=None:
print("low",type(lows_[0]));
for i in range(len(lows_)):
lows_[i]=Trans(lows_[i])
if highs_!=None:
print("hig",type(highs_[0]));
for i in range(len(highs_)):
highs_[i]=Trans(highs_[i])
if content=='':
return ''
try:
for dele in deletes:
content=content.replace(dele,'')
print(content)
content=Trans(content)
if Func!=None:
content=Func(content,var_,order_,lows_,highs_)
content=latex(content)
print('content',content)
content=content.replace('&','')
content=content.replace('\\:',':')
content=content.replace('\\,','')
content=content.replace('\\\\',';')
content=content.replace('\\begin{cases}','')
content=content.replace('\\end{cases}','')
content=content.replace('{sin}','\\sin')
content=content.replace('{cos}','\\cos')
content=content.replace('{tan}','\\tan')
content=content.replace('{asin}','\\asin')
content=content.replace('{acos}','\\acos')
content=content.replace('{atan}','\\atan')
return content
except BaseException as e:
return '\\text{'+str(e)+'}'
@bp.route("/home", methods=['GET', 'POST'])
def home():
return render_template('home.html')
@bp.route('/calc', methods=['GET', 'POST'])
def calc():
if request.method == 'POST':
input = request.form['input']
flash(input)
return render_template('calc.html')
content=''
if request.method=='POST':
content = request.form.get('editor_content')
if content==None:
content=''
return render_template('calc.html',editor=content,result=Work(content))
#求导
@bp.route('/diff', methods=['GET', 'POST'])
def diff():
if request.method=='GET':
content=''
cloneCount=1
var_=['x']
order_=[1]
else:
cloneCount=int(request.form.get('cloneCount'))
content = request.form.get('editor_content')
if content==None:
content=''
if cloneCount==None:
cloneCount=1
var_=['x']
order_=[1]
else:
var_=[]
order_=[]
for i in range(1,cloneCount+1):
var_.append(request.form.get('var'+str(i)))
order_.append(request.form.get('order'+str(i)))
if var_[i-1]=='':
var_[i-1]=common_vars[i-1]
order_[i-1]=1
return render_template('diff.html',editor=content
,result=Work(content,diff_,var_,order_)
,cloneCount=cloneCount
,var_=var_
,order_=order_)
#不定积分
@bp.route('/indefinite_integral', methods=['GET', 'POST'])
def indefinite_integral():
if request.method=='GET':
content=''
cloneCount=1
var_=['x']
else:
cloneCount=int(request.form.get('cloneCount'))
content = request.form.get('editor_content')
if content==None:
content=''
if cloneCount==None:
cloneCount=1
var_=['x']
else:
var_=[]
for i in range(1,cloneCount+1):
var_.append(request.form.get('var'+str(i)))
if var_[i-1]=='':
var_[i-1]=common_vars[i-1]
return render_template('indefinite_integral.html',editor=content
,result=Work(content,indefinite_integral_,var_)
,cloneCount=cloneCount
,var_=var_)
#定积分
@bp.route('/definite_integral', methods=['GET', 'POST'])
def definite_integral():
if request.method=='GET':
content=''
cloneCount=1
var_=['x']
lows_=[0]
highs_=[0]
else:
cloneCount=int(request.form.get('cloneCount'))
content = request.form.get('editor_content')
if content==None:
content=''
if cloneCount==None:
cloneCount=1
var_=['x']
lows_=[0]
highs_=[0]
else:
var_=[]
lows_=[]
highs_=[]
for i in range(1,cloneCount+1):
var_.append(request.form.get('var'+str(i)))
lows_.append(request.form.get('low'+str(i)))
highs_.append(request.form.get('high'+str(i)))
if var_[i-1]=='':
var_[i-1]=common_vars[i-1]
lows_[i-1]=0
highs_[i-1]=0
return render_template('definite_integral.html',editor=content
,result=Work(content,definite_integral_,var_,None,lows_,highs_)
,cloneCount=cloneCount
,var_=var_
,lows_=lows_
,highs_=highs_)
#解方程组
@bp.route('/solve', methods=['GET', 'POST'])#路由到/solve地址
def solve():
if request.method=='GET':#通过url进入网页时,进行数据初始化
cloneCount=1#方程个数
var_=['']#变量列表,初始为一个空变量
content=['']#方程列表,初始为一个空方程
else:#通过POST事件运行本函数情况
cloneCount=int(request.form.get('cloneCount'))#从前端或许方程个数
var_=[]
content=[]
for i in range(1,cloneCount+1):
'''从前端获取各方程和变量内容'''
content.append(request.form.get('editor_content'+str(i)))
var_.append(request.form.get('var'+str(i)))
var__=var_#保留字符串形式的变量
for i in range(len(var_)):
var_[i]=Trans(var_[i])#变量转为符号类型
cont=[]
for i in range(len(content)):
for dele in deletes:
content[i]=content[i].replace(dele,'')#删除格式表达
if content[i]!='':
cont.append(Trans_equal(content[i]))#将表达式从方程转为函数
try:
solutions=solve_(cont,var_)
if len(solutions)==0:
result='\\text{no solution}'#无解
else:
result=''
for v in var_:#变量名打包
result+=','+latex(v)#sympy转回latex
result='('+result[1:]+')='
for s in solutions:#解集打包
for t in range(len(s)):
if t==0:
result+='('
else:
result+=','
result+=latex(s[t])
result+='),'
result=result[:len(result)-1]
if '\\emptyset' in result:
result='\\text{no solution}'#无解
else:
'''调整latex表达'''
result=result.replace('&','')
result=result.replace('\\:',':')
result=result.replace('\\,','')
result=result.replace('\\\\',';')
result=result.replace('\\begin{cases}','')
result=result.replace('\\end{cases}','')
result=result.replace('{sin}','\\sin')
result=result.replace('{cos}','\\cos')
result=result.replace('{tan}','\\tan')
result=result.replace('{asin}','\\asin')
result=result.replace('{acos}','\\acos')
result=result.replace('{atan}','\\atan')
except:
result='\\text{no solution}'#无解
'''将处理后的数据回传至网页'''
print(result)
return render_template('solve.html',editor=content
,result=result
,cloneCount=cloneCount
,var_=var__)
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="./static/jquery.js"></script>
<script src="./static/my.min.js"></script>
</head>
<body>
<div id="myEdit"></div>
<button id="getVal">获取值</button>
<button id="getLatex">获取Latex值</button>
<script>
var mathEdit = new window.MathEdit({
elId: 'myEdit',
config: {
defaultFontSize: '18px',
viewFontSize: '12px'
},
init_content: 'x=\\frac{\\sqrt{6}}{2} + \\frac{11}{2} + \\frac{\\sqrt{14 \\sqrt{6} + 87}}{2}'
})
document.getElementById('getVal').addEventListener('click', function () {
console.log(mathEdit.getValue())
})
document.getElementById('getLatex').addEventListener('click', function () {
console.log(mathEdit.getLatex())
})
</script>
</body>
flaskr/flask使用方法.jpg

4.94 KiB

from sympy import *
Ee=E
'''
getUnit '{} () [] \\' 独立表达模块
getIndepend 'abcd' 独立符号
getContinuous '1234. a^b a_b {x'}' 连续符号
getElement '* / ' 强连续运算
getAll '+ -' 弱连续运算(全部)
'=' 全表达式
'''
syms={
"\\alpha","\\beta","\\gamma","\\varepsilon","\\varphi","\\lambda","\\mu","\\rho","\\theta","\\omega","\\Gamma","\\Delta","\\Omega","\\Lambda","\\Phi","\\Psi","\\delta","\\kappa"
}
basicNumber="1234567890."
def warning(warn):
print("Unknow elem:",warn)
def getUnit(E,dep):
dep=dep+1
print(' '*dep*2,'>getUnit',E)
res=''
if E[0]=='{' or E[0]=='(' or E[0]=='[':
res,E=getAll(E[1:],dep)
elif E[:5]=='\\frac':
elem1,E=getUnit(E[5:],dep)
elem2,E=getUnit(E,dep)
res=elem1/elem2
elif E[0]=='^':
elem1mE=getUnit(E[1:],dep)
elem2,E=getUnit(E,dep)
res=elem1/elem2
elif E[:6]=='\\sqrt[':
elem1,E=getUnit(E[5:],dep)
elem2,E=getUnit(E,dep)
print(elem1,elem2)
res=pow(elem2,1/elem1)
elif E[:5]=='\\sqrt':
res,E=getUnit(E[5:],dep)
res=sqrt(res)
elif E[:5]=='\\sum^':#inf \\sum^{high}_{n=low}elem
high,E=getIndepend(E[5:],dep)
high=int(high)
n,E=getContinuous(E[2:],dep)
n=str(n)
low,E=getAll(E[1:],dep)
low=int(low)
elem,E=getElement(E,dep)
res=0
for i in range(low,high+1):
res+=elem.evalf(subs={n:i})
elif E[:5]=='\\sum_':#inf \\sum_{n=low}^{high}elem
n,E=getContinuous(E[6:],dep)
n=str(n)
low,E=getAll(E[1:],dep)
low=int(low)
high,E=getIndepend(E[1:],dep)
high=int(high)
elem,E=getElement(E,dep)
res=0
for i in range(low,high+1):
res+=elem.evalf(subs={n:i})
elif E[:5]=='\\log_':
# print('here')
log_,E=getIndepend(E[5:],dep)
elem,E=getElement(E,dep)
res=log(elem)/log(log_)
elif E[:3]=='\\ln':
elem,E=getContinuous(E[3:],dep)
res=log(elem)
elif E[:4]=='\\cos':
elem,E=getContinuous(E[4:],dep)
res=cos(elem)
elif E[:4]=='\\sin':
elem,E=getContinuous(E[4:],dep)
res=sin(elem)
elif E[:4]=='\\tan':
elem,E=getContinuous(E[4:],dep)
res=tan(elem)
elif E[:4]=='\\cot':
elem,E=getContinuous(E[4:],dep)
res=cot(elem)
elif E[:5]=='\\acos':
elem,E=getContinuous(E[5:],dep)
res=acos(elem)
elif E[:5]=='\\asin':
elem,E=getContinuous(E[5:],dep)
res=asin(elem)
elif E[:5]=='\\atan':
elem,E=getContinuous(E[5:],dep)
res=atan(elem)
elif E[:5]=='\\acot':
elem,E=getContinuous(E[5:],dep)
res=acot(elem)
elif E[:3]=='\\pi':
res=pi
E=E[3:]
elif E[0]=='e' or E[0]=='E':
res=E
E=E[1:]
elif E[:6]=='\\infty':
res=oo
E=E[6:]
elif E[0]=='i':
res=I
E=E[1:]
else:
for s in syms:
if E[:len(s)]==s:
res=symbols(s,real=True)
E=E[len(s):]
break
elif E[:len(s)-1]==s[1:]:
res=symbols(s,real=True)
E=E[len(s):]
break
print(' '*dep*2,'<getUnit',res,E)
return res,E
def getIndepend(E,dep):
dep=dep+1
print(' '*dep*2,'>getIndepend',E)
res=''
if E[0]=='{' or E[0]=='(' or E[0]=='[' or E[0]=='\\' or E[0]=='^':
res,E=getUnit(E,dep)
elif E[0] in "0123456789":
res=int(E[0])
E=E[1:]
elif E[:3]=='\\pi':
res=pi
E=E[3:]
elif E[0]=='e' or E[0]=='E':
res=Ee
E=E[1:]
elif E[:6]=='\\infty':
res=oo
E=E[6:]
elif E[0]=='i':
res=I
E=E[1:]
else:
for s in syms:
if E[:len(s)]==s:
res=symbols(s,real=True)
E=E[len(s):]
break
elif E[:len(s)-1]==s[1:]:
res=symbols(s,real=True)
E=E[len(s):]
break
if res=='':
res=symbols(E[0],real=True)
E=E[1:]
print(' '*dep*2,'<getIndepend',res,E)
return res,E
def getIndependStr(E,dep):
dep=dep+1
print(' '*dep*2,'<getIndependStr',E)
if E[0]=='{' or E[0]=='('or E[0]=='[':
cnt=0
s=""
for i in E:
if i=='{' or i=='('or E[0]=='[':
cnt+=1
elif i=='}' or i==')' or E[0]==']':
cnt-=1
s+=i
if cnt==0:
return s,E[len(s):]
elif E[0] in "0123456789":
return E[0],E[1:]
elif E[:3]=='\\pi':
return E[:3],E[3:]
elif E[0]=='e' or E[0]=='E':
return E[0],E[1:]
elif E[:6]=='\\infty':
return E[:6],E[6:]
elif E[0]=='i':
return E[0],E[1:]
else:
for s in syms:
if E[:len(s)]==s:
return s,E[len(s):]
return E[0],E[1:]
print(' '*dep*2,'<getIndepend',res,E)
def getContinuous(E,dep):
dep=dep+1
print(' '*dep*2,'>getContinuous',E)
s=""
for i in E:
if i in basicNumber:
s=s+i
else:
break
if s!='':
elem=s
try:
res=int(elem)
except:
res=float(elem)
E=E[len(elem):]
else:
res,E=getIndepend(E,dep)
elem=str(res)
if E!='':
if E[0]=='^':
elemSuper,E=getIndependStr(E[1:],dep)
if E!='' and E[0]=='_':
elemSub,E=getIndependStr(E[1:],dep)
res=symbols(elem+'_'+elemSub,real=True)
try:
elemSuper,tmp=getIndepend(elemSuper,dep)
res=pow(res,elemSuper)
except:
res=symbols(s+'^'+elemSuper,real=True)
elif E[0]=='_':
elemSub,E=getIndependStr(E[1:],dep)
res=symbols(elem+'_'+elemSub,real=True)
if E!='' and E[0]=='^':
try:
elemSuper,E=getIndepend(E[1:],dep)
res=pow(res,elemSuper)
except:
elemSuper,E=getIndependStr(E[1:],dep)
res=symbols(res+'^'+elemSuper,real=True)
print(' '*dep*2,'<getContinuous',res,E)
return res,E
def getElement(E,dep):
dep=dep+1
print(' '*dep*2,'>getElement',E)
res,E=getContinuous(E,dep)
while E!='':
if E[0]=='*':
elem,E=getContinuous(E[1:],dep)
res=res*elem
elif E[:5]=='\\cdot':
elem,E=getContinuous(E[5:],dep)
res=res*elem
elif E[:6]=='\\times':
elem,E=getContinuous(E[6:],dep)
res=res*elem
elif E[:4]=='\\ast':
elem,E=getContinuous(E[4:],dep)
res=res*elem
elif E[0]=='/':
elem,E=getContinuous(E[1:],dep)
try:
res=res/elem
except ZeroDivisionError as e:
print(e)
elif E[:4]=='\\div':
elem,E=getContinuous(E[4:],dep)
try:
res=res/elem
except ZeroDivisionError as e:
print(e)
elif E[0]!='+' and E[0]!='-' and E[0]!='}' and E[0]!=')' and E[0]!=']':
elem,E=getContinuous(E,dep)
res=res*elem
else:
break
print(' '*dep*2,'<getElement',res,E)
return res,E
def getAll(E,dep):
dep=dep+1
print(' '*dep*2,'>getAll',E)
if E[0]=='+':
res,E=getElement(E[1:],dep)
elif E[0]=='-':
res,E=getElement(E[1:],dep)
res=-res
elif E[0]=='}' or E[0]==')' or E[0]==']':
res=''
else:
res,E=getElement(E,dep)
while E!='':
if E[0]=='+':
elem,E=getElement(E[1:],dep)
res=res+elem
elif E[0]=='-':
elem,E=getElement(E[1:],dep)
res=res-elem
else:
break
E=E[1:]
print(' '*dep*2,'<getAll',res,E)
return res,E
def Trans(E):
if E=='':
return E
print('Trans',E,type(E))
if type(E)==str:
E='{'+E+'}'
else:
E='{'+str(E)+'}'
E=E.replace(' ','')
E=E.replace('/_','/')
try:
res,E=getUnit(E,0)
print('trans got',res)
return cancel(ratsimp(expand_log(simplify(res))))
except BaseException as e:
print(e)
return 'error'
def Trans_equal(E):
for i in range(len(E)):
if E[i]=='=':
return Trans('('+E[:i]+')-('+E[i+1:]+')')
print("Trans_equal",E)
return Trans(E)
if __name__=='__main__':
# E=input('')
E='\\lnx^3'
res=Trans(E)
print(res)
/*
* jQuery FlexSlider v2.7.1
* http://www.woothemes.com/flexslider/
*
* Copyright 2012 WooThemes
* Free to use under the GPLv2 and later license.
* http://www.gnu.org/licenses/gpl-2.0.html
*
* Contributing author: Tyler Smith (@mbmufffin)
*
*/
/* ====================================================================================================================
* FONT-FACE
* ====================================================================================================================*/
@font-face {
font-family: 'flexslider-icon';
src: url('../fonts/flexslider-icon.eot');
src: url('../fonts/flexslider-icon.eot?#iefix') format('embedded-opentype'), url('../fonts/flexslider-icon.woff') format('woff'), url('../fonts/flexslider-icon.ttf') format('truetype'), url('../fonts/flexslider-icon.svg#flexslider-icon') format('svg');
font-weight: normal;
font-style: normal;
}
/* ====================================================================================================================
* RESETS
* ====================================================================================================================*/
.flex-container a:hover,
.flex-slider a:hover {
outline: none;
}
.slides,
.slides > li,
.flex-control-nav,
.flex-direction-nav {
margin: 0;
padding: 0;
list-style: none;
}
.flex-pauseplay span {
text-transform: capitalize;
}
/* ====================================================================================================================
* BASE STYLES
* ====================================================================================================================*/
.flexslider {
margin: 0;
padding: 0;
}
.flexslider .slides > li {
display: none;
-webkit-backface-visibility: hidden;
}
.flexslider .slides img {
width: 100%;
display: block;
}
.flexslider .slides:after {
content: "\0020";
display: block;
clear: both;
visibility: hidden;
line-height: 0;
height: 0;
}
html[xmlns] .flexslider .slides {
display: block;
}
* html .flexslider .slides {
height: 1%;
}
.no-js .flexslider .slides > li:first-child {
display: block;
}
/* ====================================================================================================================
* DEFAULT THEME
* ====================================================================================================================*/
.flexslider {
margin: 0;
background: #fff;
border: 4px solid #fff;
position: relative;
zoom: 1;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
-webkit-box-shadow: '' 0 1px 4px rgba(0, 0, 0, 0.2);
-moz-box-shadow: '' 0 1px 4px rgba(0, 0, 0, 0.2);
-o-box-shadow: '' 0 1px 4px rgba(0, 0, 0, 0.2);
box-shadow: '' 0 1px 4px rgba(0, 0, 0, 0.2);
}
.flexslider .slides {
zoom: 1;
}
.flexslider .slides img {
height: auto;
-moz-user-select: none;
}
.flex-viewport {
max-height: 2000px;
-webkit-transition: all 1s ease;
-moz-transition: all 1s ease;
-ms-transition: all 1s ease;
-o-transition: all 1s ease;
transition: all 1s ease;
}
.loading .flex-viewport {
max-height: 300px;
}
@-moz-document url-prefix() {
.loading .flex-viewport {
max-height: none;
}
}
.carousel li {
margin-right: 5px;
}
.flex-direction-nav {
*height: 0;
}
.flex-direction-nav a {
text-decoration: none;
display: block;
width: 40px;
height: 40px;
line-height: 40px;
margin: -20px 0 0;
position: absolute;
top: 50%;
z-index: 10;
overflow: hidden;
opacity: 0;
cursor: pointer;
color: rgba(0, 0, 0, 0.8);
text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.3);
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-ms-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
}
.flex-direction-nav a:before {
font-family: "flexslider-icon";
font-size: 26px;
display: inline-block;
content: '\f001';
color: rgba(0, 0, 0, 0.8);
text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.3);
}
.flex-direction-nav a.flex-next:before {
content: '\f002';
}
.flex-direction-nav .flex-prev {
left: -50px;
}
.flex-direction-nav .flex-next {
right: -50px;
text-align: right;
}
.flexslider:hover .flex-direction-nav .flex-prev {
opacity: 0.7;
left: 10px;
}
.flexslider:hover .flex-direction-nav .flex-prev:hover {
opacity: 1;
}
.flexslider:hover .flex-direction-nav .flex-next {
opacity: 0.7;
right: 10px;
}
.flexslider:hover .flex-direction-nav .flex-next:hover {
opacity: 1;
}
.flex-direction-nav .flex-disabled {
opacity: 0!important;
filter: alpha(opacity=0);
cursor: default;
z-index: -1;
}
.flex-pauseplay a {
display: block;
width: 20px;
height: 20px;
position: absolute;
bottom: 5px;
left: 10px;
opacity: 0.8;
z-index: 10;
overflow: hidden;
cursor: pointer;
color: #000;
}
.flex-pauseplay a:before {
font-family: "flexslider-icon";
font-size: 20px;
display: inline-block;
content: '\f004';
}
.flex-pauseplay a:hover {
opacity: 1;
}
.flex-pauseplay a.flex-play:before {
content: '\f003';
}
.flex-control-nav {
width: 100%;
position: absolute;
bottom: -40px;
text-align: center;
}
.flex-control-nav li {
margin: 0 6px;
display: inline-block;
zoom: 1;
*display: inline;
}
.flex-control-paging li a {
width: 11px;
height: 11px;
display: block;
background: #666;
background: rgba(0, 0, 0, 0.5);
cursor: pointer;
text-indent: -9999px;
-webkit-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3);
-moz-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3);
-o-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3);
box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3);
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
border-radius: 20px;
}
.flex-control-paging li a:hover {
background: #333;
background: rgba(0, 0, 0, 0.7);
}
.flex-control-paging li a.flex-active {
background: #000;
background: rgba(0, 0, 0, 0.9);
cursor: default;
}
.flex-control-thumbs {
margin: 5px 0 0;
position: static;
overflow: hidden;
}
.flex-control-thumbs li {
width: 25%;
float: left;
margin: 0;
}
.flex-control-thumbs img {
width: 100%;
height: auto;
display: block;
opacity: .7;
cursor: pointer;
-moz-user-select: none;
-webkit-transition: all 1s ease;
-moz-transition: all 1s ease;
-ms-transition: all 1s ease;
-o-transition: all 1s ease;
transition: all 1s ease;
}
.flex-control-thumbs img:hover {
opacity: 1;
}
.flex-control-thumbs .flex-active {
opacity: 1;
cursor: default;
}
/* ====================================================================================================================
* RESPONSIVE
* ====================================================================================================================*/
@media screen and (max-width: 860px) {
.flex-direction-nav .flex-prev {
opacity: 1;
left: 10px;
}
.flex-direction-nav .flex-next {
opacity: 1;
right: 10px;
}
}
This diff is collapsed.