netbozum
wmaraci reklam

Blogger Sitesini Sadece Mobil de Göstermek

3 Mesajlar 977 Okunma
Toplam 3 mesaj ve 977 görüntüleme
acebozum
KaplanBozum

gaometri gaometri WM Aracı Kullanıcı
  • Üyelik 17.05.2015
  • Yaş/Cinsiyet 35 / E
  • Meslek öğrenci
  • Konum Diyarbakır
  • Ad Soyad R** S**
  • Mesajlar 491
  • Beğeniler 178 / 179
  • Ticaret 4, (%100)



Merhaba arkadaşlar blogger sitesini sadece mobil olarak göstermek isteyen arkadaşlar için bu kodu paylaşmak istiyorum. Bu kod sayesinde web sitesini sadece mobilde göstermek ve içeriklere sadece mobilde erişmesini sağlamak için bu kodu paylaşıyorum.

Ana sayfaya bir intro eklemedim fakat değiştirebilirsiniz.

Bu kodu etiketinin hemen altına yapıştırın




Ardından şu kodu etiketinin üstüne yapıştırın

<script></script>
<script>
// class App extends React.Component {

constructor(props) {
super(props);
this.state = {
pos: { x: 0, y: 0 },
shadow: true,
colors: [
{
"background": "#2A2C39",
"text": "#ffffff",
"bold": "#FF4056" },
{
"background": "#FCF751",
"text": "#2A2C39",
"bold": "#14151c" }],

background: null,
text: null,
bold: null };

}

componentDidMount() {
this.RandomBackground();
}

onMouseMove(e) {
this.setState({
pos: {
x: e.pageX,
y: e.pageY } });



this.CreateShadow();
}

CreateShadow() {

if ('ontouchstart' in window == false && this.state.shadow) {

let [moveX, moveY] = [this.state.pos.x / -100, this.state.pos.y / -120];

let [Section, firstWord, secondWord] = [React.findDOMNode(this.refs.section), React.findDOMNode(this.refs.playword_1), React.findDOMNode(this.refs.playword_2)];

firstWord.style.transform = `translate3d(${moveX / 2}px, ${moveY}px, 0)`;
secondWord.style.transform = `translate3d(${moveX / 2}px, ${moveY}px, 0)`;
Section.style.textShadow = `${moveX}px ${-moveY}px rgba(0, 0, 0, 0.1)`;

}
}

RandomBackground() {
let getRandomInt = (min, max) => {
return Math.floor(Math.random() * (max - min + 1) + min);
};

let RandomID = getRandomInt(0, 1),
SelectColor = this.state.colors[RandomID];

console.log(RandomID);

this.setState({
background: this.state.colors[RandomID].background,
text: this.state.colors[RandomID].text,
bold: this.state.colors[RandomID].bold });

}

render() {
let sectionStyle = {
backgroundColor: this.state.background,
color: this.state.text };

let boldStyle = {
color: this.state.bold };


return React.createElement("section", { id: "app", onMouseMove: this.onMouseMove.bind(this), style: sectionStyle },
React.createElement("h1", { className: "middle", ref: "section" }, "Bu web sitesi ",
React.createElement("span", { className: "bold", ref: "playword_1", style: boldStyle }, "sadece"), ".",
React.createElement("br", null), "mobil olarak ",
React.createElement("span", { className: "bold", ref: "playword_2", style: boldStyle }, "çalışmaktadır"), "."));


}}


React.render(React.createElement(App, null),
document.querySelector('body'));
//]]>
</script>


Herhangi bir sorun ile karşılaşırsanız lütfen yazın
 

 

wmaraci
reklam

ali159 ali159 WM Aracı Kullanıcı
  • Üyelik 26.12.2014
  • Yaş/Cinsiyet 25 / E
  • Meslek öğrenci
  • Konum Ankara
  • Ad Soyad A** Y**
  • Mesajlar 368
  • Beğeniler 95 / 94
  • Ticaret 0, (%0)
Elinize sağlık :)

kişi bu mesajı beğendi.

private59 private59 Kimlik Onayı Bekliyor Banlı Kullanıcı
  • Üyelik 08.03.2019
  • Yaş/Cinsiyet 33 / E
  • Meslek Sosyal Medya
  • Konum İstanbul Avrupa
  • Ad Soyad O** A**
  • Mesajlar 128
  • Beğeniler 4 / 58
  • Ticaret 0, (%0)
elinize sağlık paylaşım için teşekkürler

kişi bu mesajı beğendi.

Site Ayarları
  • Tema Seçeneği
  • Site Sesleri
  • Bildirimler
  • Özel Mesaj Al